diff --git a/platform/fabric/core/generic/driver/provider.go b/platform/fabric/core/generic/driver/provider.go index 2cf0a5032..a59dfde68 100644 --- a/platform/fabric/core/generic/driver/provider.go +++ b/platform/fabric/core/generic/driver/provider.go @@ -46,20 +46,24 @@ func NewProvider( kvss *kvs.KVS, ) *Provider { return &Provider{ - configProvider: configProvider, - channelProvider: channelProvider, - identityProvider: identity.NewProvider(configProvider, endpointService), - metricsProvider: metricsProvider, - sigService: sigService, - mspManagerProvider: &localMSPManagerProvider{ - configProvider: configProvider, - endpointService: endpointService, - sigService: sigService, - identityLoaders: identityLoaders, - deserializerManager: deserializerManager, - idProvider: idProvider, - kvss: kvss, - }, + configProvider: configProvider, + channelProvider: channelProvider, + identityProvider: identity.NewProvider(configProvider, endpointService), + metricsProvider: metricsProvider, + sigService: sigService, + mspManagerProvider: NewMSPManagerProvider(configProvider, endpointService, sigService, identityLoaders, deserializerManager, idProvider, kvss), + } +} + +func NewMSPManagerProvider(configProvider config.Provider, endpointService identity.EndpointService, sigService *sig.Service, identityLoaders []NamedIdentityLoader, deserializerManager driver.DeserializerManager, idProvider vdriver.IdentityProvider, kvss *kvs.KVS) *localMSPManagerProvider { + return &localMSPManagerProvider{ + configProvider: configProvider, + endpointService: endpointService, + sigService: sigService, + identityLoaders: identityLoaders, + deserializerManager: deserializerManager, + idProvider: idProvider, + kvss: kvss, } }