diff --git a/msp/mgmt/mgmt.go b/msp/mgmt/mgmt.go index 02f4d652ad7..806fdbae359 100644 --- a/msp/mgmt/mgmt.go +++ b/msp/mgmt/mgmt.go @@ -113,15 +113,6 @@ func GetDeserializers() map[string]msp.IdentityDeserializer { return clone } -// GetManagerForChainIfExists returns the MSPManager associated to ChainID -// it it exists -func GetManagerForChainIfExists(ChainID string) msp.MSPManager { - m.Lock() - defer m.Unlock() - - return mspMap[ChainID] -} - // XXXSetMSPManager is a stopgap solution to transition from the custom MSP config block // parsing to the configtx.Manager interface, while preserving the problematic singleton // nature of the MSP manager diff --git a/msp/mgmt/mgmt_test.go b/msp/mgmt/mgmt_test.go index 28ec8e9879b..a22eede58c5 100644 --- a/msp/mgmt/mgmt_test.go +++ b/msp/mgmt/mgmt_test.go @@ -21,6 +21,7 @@ import ( configvaluesmsp "github.com/hyperledger/fabric/common/config/msp" "github.com/hyperledger/fabric/msp" + "github.com/stretchr/testify/assert" ) func TestGetManagerForChains(t *testing.T) { @@ -54,3 +55,16 @@ func TestGetManagerForChains_usingMSPConfigHandlers(t *testing.T) { t.FailNow() } } + +func TestGetIdentityDeserializer(t *testing.T) { + XXXSetMSPManager("baz", &configvaluesmsp.MSPConfigHandler{MSPManager: msp.NewMSPManager()}) + ids := GetIdentityDeserializer("baz") + assert.NotNil(t, ids) + ids = GetIdentityDeserializer("") + assert.NotNil(t, ids) +} + +func TestGetLocalSigningIdentityOrPanic(t *testing.T) { + sid := GetLocalSigningIdentityOrPanic() + assert.NotNil(t, sid) +}