@@ -281,7 +281,7 @@ func (sct *SmartContractTest) prepareBlockchain(
281
281
if sct .InitGenesis .IsBering {
282
282
cfg .Genesis .Blockchain .BeringBlockHeight = 0
283
283
}
284
- registry := protocol.Registry {}
284
+ registry := protocol .NewRegistry ()
285
285
acc := account .NewProtocol ()
286
286
r .NoError (registry .Register (account .ProtocolID , acc ))
287
287
rp := rolldpos .NewProtocol (cfg .Genesis .NumCandidateDelegates , cfg .Genesis .NumDelegates , cfg .Genesis .NumSubEpochs )
@@ -296,9 +296,9 @@ func (sct *SmartContractTest) prepareBlockchain(
296
296
cfg ,
297
297
dao ,
298
298
blockchain .InMemStateFactoryOption (),
299
- blockchain .RegistryOption (& registry ),
299
+ blockchain .RegistryOption (registry ),
300
300
)
301
- reward := rewarding .NewProtocol (bc , rp )
301
+ reward := rewarding .NewProtocol (nil , rp )
302
302
r .NoError (registry .Register (rewarding .ProtocolID , reward ))
303
303
304
304
r .NotNil (bc )
@@ -319,7 +319,7 @@ func (sct *SmartContractTest) prepareBlockchain(
319
319
Producer : identityset .Address (27 ),
320
320
GasLimit : uint64 (10000000 ),
321
321
Genesis : cfg .Genesis ,
322
- Registry : & registry ,
322
+ Registry : registry ,
323
323
})
324
324
_ , err = ws .RunActions (ctx , 0 , nil )
325
325
r .NoError (err )
@@ -465,7 +465,7 @@ func TestProtocol_Handle(t *testing.T) {
465
465
cfg .Chain .IndexDBPath = testIndexPath
466
466
cfg .Chain .EnableAsyncIndexWrite = false
467
467
cfg .Genesis .EnableGravityChainVoting = false
468
- registry := protocol.Registry {}
468
+ registry := protocol .NewRegistry ()
469
469
acc := account .NewProtocol ()
470
470
require .NoError (registry .Register (account .ProtocolID , acc ))
471
471
rp := rolldpos .NewProtocol (cfg .Genesis .NumCandidateDelegates , cfg .Genesis .NumDelegates , cfg .Genesis .NumSubEpochs )
@@ -482,7 +482,7 @@ func TestProtocol_Handle(t *testing.T) {
482
482
cfg ,
483
483
dao ,
484
484
blockchain .DefaultStateFactoryOption (),
485
- blockchain .RegistryOption (& registry ),
485
+ blockchain .RegistryOption (registry ),
486
486
)
487
487
exeProtocol := NewProtocol (bc .BlockDAO ().GetBlockHash )
488
488
require .NoError (registry .Register (ProtocolID , exeProtocol ))
@@ -506,7 +506,7 @@ func TestProtocol_Handle(t *testing.T) {
506
506
Producer : identityset .Address (27 ),
507
507
GasLimit : gasLimit ,
508
508
Genesis : cfg .Genesis ,
509
- Registry : & registry ,
509
+ Registry : registry ,
510
510
})
511
511
_ , err = ws .RunActions (ctx , 0 , nil )
512
512
require .NoError (err )
0 commit comments