@@ -144,11 +144,11 @@ func TestManagerImpl(t *testing.T) {
144144 manager := NewRegistrar (lf , mockCrypto ())
145145 manager .Initialize (consenters )
146146
147- _ , ok := manager .GetChain ("Fake" )
148- assert .False (t , ok , "Should not have found a chain that was not created" )
147+ chainSupport := manager .GetChain ("Fake" )
148+ assert .Nilf (t , chainSupport , "Should not have found a chain that was not created" )
149149
150- chainSupport , ok : = manager .GetChain (genesisconfig .TestChainID )
151- assert .True (t , ok , "Should have gotten chain which was initialized by ramledger" )
150+ chainSupport = manager .GetChain (genesisconfig .TestChainID )
151+ assert .NotNilf (t , chainSupport , "Should have gotten chain which was initialized by ramledger" )
152152
153153 messages := make ([]* cb.Envelope , conf .Orderer .BatchSize .MaxMessageCount )
154154 for i := 0 ; i < int (conf .Orderer .BatchSize .MaxMessageCount ); i ++ {
@@ -198,8 +198,8 @@ func TestNewChain(t *testing.T) {
198198
199199 wrapped := wrapConfigTx (ingressTx )
200200
201- chainSupport , ok := manager .GetChain (manager .SystemChannelID ())
202- assert .True (t , ok , "Could not find system channel" )
201+ chainSupport := manager .GetChain (manager .SystemChannelID ())
202+ assert .NotNilf (t , chainSupport , "Could not find system channel" )
203203
204204 chainSupport .Configure (wrapped , 0 )
205205 func () {
@@ -216,9 +216,8 @@ func TestNewChain(t *testing.T) {
216216 assert .True (t , proto .Equal (wrapped , utils .UnmarshalEnvelopeOrPanic (block .Data .Data [0 ])), "Orderer config block contains wrong transaction" )
217217 }()
218218
219- chainSupport , ok = manager .GetChain (newChainID )
220-
221- if ! ok {
219+ chainSupport = manager .GetChain (newChainID )
220+ if chainSupport == nil {
222221 t .Fatalf ("Should have gotten new chain which was created" )
223222 }
224223
0 commit comments