fix: we need to pass out the protocol in both struct and interface form for fx to read it properly
This commit is contained in:
parent
98c1784518
commit
10ecaebbf2
|
@ -46,6 +46,7 @@ type S5ProtocolParams struct {
|
|||
type S5ProtocolResult struct {
|
||||
fx.Out
|
||||
Protocol registry.Protocol `group:"protocol"`
|
||||
S5Protocol *S5Protocol
|
||||
}
|
||||
|
||||
var S5ProtocolModule = fx.Module("s5_protocol",
|
||||
|
@ -56,14 +57,17 @@ var S5ProtocolModule = fx.Module("s5_protocol",
|
|||
func NewS5Protocol(
|
||||
params S5ProtocolParams,
|
||||
) (S5ProtocolResult, error) {
|
||||
return S5ProtocolResult{
|
||||
Protocol: &S5Protocol{
|
||||
proto := &S5Protocol{
|
||||
config: params.Config,
|
||||
logger: params.Logger,
|
||||
storage: params.Storage,
|
||||
identity: params.Identity,
|
||||
providerStore: params.ProviderStore,
|
||||
},
|
||||
}
|
||||
|
||||
return S5ProtocolResult{
|
||||
Protocol: proto,
|
||||
S5Protocol: proto,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue