@@ -506,7 +506,6 @@ func TestCreateBlockchain(t *testing.T) {
506
506
sf ,
507
507
protocol .NewGenericValidator (sf , accountutil .AccountState ),
508
508
)),
509
- blockchain .BlockTimeCalculatorBuilderOption (testutil .DummyBlockTimeBuilder ()),
510
509
)
511
510
ep := execution .NewProtocol (dao .GetBlockHash , rewarding .DepositGas , fakeGetBlockTime )
512
511
require .NoError (ep .Register (registry ))
@@ -563,7 +562,6 @@ func TestGetBlockHash(t *testing.T) {
563
562
sf ,
564
563
protocol .NewGenericValidator (sf , accountutil .AccountState ),
565
564
)),
566
- blockchain .BlockTimeCalculatorBuilderOption (testutil .DummyBlockTimeBuilder ()),
567
565
)
568
566
ep := execution .NewProtocol (dao .GetBlockHash , rewarding .DepositGas , fakeGetBlockTime )
569
567
require .NoError (ep .Register (registry ))
@@ -729,7 +727,6 @@ func TestBlockchain_MintNewBlock(t *testing.T) {
729
727
sf ,
730
728
protocol .NewGenericValidator (sf , accountutil .AccountState ),
731
729
)),
732
- blockchain .BlockTimeCalculatorBuilderOption (testutil .DummyBlockTimeBuilder ()),
733
730
)
734
731
ep := execution .NewProtocol (dao .GetBlockHash , rewarding .DepositGas , fakeGetBlockTime )
735
732
require .NoError (t , ep .Register (registry ))
@@ -800,7 +797,6 @@ func TestBlockchain_MintNewBlock_PopAccount(t *testing.T) {
800
797
sf ,
801
798
protocol .NewGenericValidator (sf , accountutil .AccountState ),
802
799
)),
803
- blockchain .BlockTimeCalculatorBuilderOption (testutil .DummyBlockTimeBuilder ()),
804
800
)
805
801
rp := rolldpos .NewProtocol (cfg .Genesis .NumCandidateDelegates , cfg .Genesis .NumDelegates , cfg .Genesis .NumSubEpochs )
806
802
require .NoError (t , rp .Register (registry ))
@@ -944,7 +940,6 @@ func createChain(cfg config.Config, inMem bool) (blockchain.Blockchain, factory.
944
940
sf ,
945
941
protocol .NewGenericValidator (sf , accountutil .AccountState ),
946
942
)),
947
- blockchain .BlockTimeCalculatorBuilderOption (testutil .DummyBlockTimeBuilder ().SetBlockInterval (func (height uint64 ) time.Duration { return time .Second })),
948
943
)
949
944
btc , err := blockutil .NewBlockTimeCalculator (func (uint64 ) time.Duration { return time .Second },
950
945
bc .TipHeight , func (height uint64 ) (time.Time , error ) {
@@ -1490,7 +1485,6 @@ func TestConstantinople(t *testing.T) {
1490
1485
sf ,
1491
1486
protocol .NewGenericValidator (sf , accountutil .AccountState ),
1492
1487
)),
1493
- blockchain .BlockTimeCalculatorBuilderOption (testutil .DummyBlockTimeBuilder ()),
1494
1488
)
1495
1489
ep := execution .NewProtocol (dao .GetBlockHash , rewarding .DepositGas , fakeGetBlockTime )
1496
1490
require .NoError (ep .Register (registry ))
@@ -1745,7 +1739,6 @@ func TestLoadBlockchainfromDB(t *testing.T) {
1745
1739
sf ,
1746
1740
protocol .NewGenericValidator (sf , accountutil .AccountState ),
1747
1741
)),
1748
- blockchain .BlockTimeCalculatorBuilderOption (testutil .DummyBlockTimeBuilder ()),
1749
1742
)
1750
1743
ep := execution .NewProtocol (dao .GetBlockHash , rewarding .DepositGas , fakeGetBlockTime )
1751
1744
require .NoError (ep .Register (registry ))
@@ -1775,7 +1768,6 @@ func TestLoadBlockchainfromDB(t *testing.T) {
1775
1768
sf ,
1776
1769
protocol .NewGenericValidator (sf , accountutil .AccountState ),
1777
1770
)),
1778
- blockchain .BlockTimeCalculatorBuilderOption (testutil .DummyBlockTimeBuilder ()),
1779
1771
)
1780
1772
require .NoError (bc .Start (ctx ))
1781
1773
defer func () {
@@ -2054,7 +2046,6 @@ func TestBlockchainInitialCandidate(t *testing.T) {
2054
2046
dao ,
2055
2047
factory .NewMinter (sf , ap ),
2056
2048
blockchain .BlockValidatorOption (sf ),
2057
- blockchain .BlockTimeCalculatorBuilderOption (testutil .DummyBlockTimeBuilder ()),
2058
2049
)
2059
2050
rolldposProtocol := rolldpos .NewProtocol (
2060
2051
cfg .Genesis .NumCandidateDelegates ,
@@ -2096,7 +2087,7 @@ func TestBlockchain_AccountState(t *testing.T) {
2096
2087
store , err := filedao .NewFileDAOInMemForTest ()
2097
2088
require .NoError (err )
2098
2089
dao := blockdao .NewBlockDAOWithIndexersAndCache (store , []blockdao.BlockIndexer {sf }, cfg .DB .MaxCacheSize )
2099
- bc := blockchain .NewBlockchain (cfg .Chain , cfg .Genesis , dao , factory .NewMinter (sf , ap ), blockchain . BlockTimeCalculatorBuilderOption ( testutil . DummyBlockTimeBuilder ()) )
2090
+ bc := blockchain .NewBlockchain (cfg .Chain , cfg .Genesis , dao , factory .NewMinter (sf , ap ))
2100
2091
require .NoError (bc .Start (ctx ))
2101
2092
require .NotNil (bc )
2102
2093
defer func () {
@@ -2128,7 +2119,7 @@ func TestNewAccountAction(t *testing.T) {
2128
2119
store , err := filedao .NewFileDAOInMemForTest ()
2129
2120
require .NoError (err )
2130
2121
dao := blockdao .NewBlockDAOWithIndexersAndCache (store , []blockdao.BlockIndexer {sf }, cfg .DB .MaxCacheSize )
2131
- bc := blockchain .NewBlockchain (cfg .Chain , cfg .Genesis , dao , factory .NewMinter (sf , ap ), blockchain . BlockTimeCalculatorBuilderOption ( testutil . DummyBlockTimeBuilder ()) )
2122
+ bc := blockchain .NewBlockchain (cfg .Chain , cfg .Genesis , dao , factory .NewMinter (sf , ap ))
2132
2123
require .NoError (bc .Start (ctx ))
2133
2124
require .NotNil (bc )
2134
2125
defer func () {
@@ -2173,7 +2164,7 @@ func TestNewAccountAction(t *testing.T) {
2173
2164
store , err := filedao .NewFileDAOInMemForTest ()
2174
2165
require .NoError (err )
2175
2166
dao1 := blockdao .NewBlockDAOWithIndexersAndCache (store , []blockdao.BlockIndexer {sf1 }, cfg .DB .MaxCacheSize )
2176
- bc1 := blockchain .NewBlockchain (cfg .Chain , cfg .Genesis , dao1 , factory .NewMinter (sf1 , ap ), blockchain . BlockTimeCalculatorBuilderOption ( testutil . DummyBlockTimeBuilder ()) )
2167
+ bc1 := blockchain .NewBlockchain (cfg .Chain , cfg .Genesis , dao1 , factory .NewMinter (sf1 , ap ))
2177
2168
require .NoError (bc1 .Start (ctx ))
2178
2169
require .NotNil (bc1 )
2179
2170
defer func () {
@@ -2242,7 +2233,7 @@ func TestBlocks(t *testing.T) {
2242
2233
dao := blockdao .NewBlockDAOWithIndexersAndCache (store , []blockdao.BlockIndexer {sf }, dbcfg .MaxCacheSize )
2243
2234
2244
2235
// Create a blockchain from scratch
2245
- bc := blockchain .NewBlockchain (cfg .Chain , cfg .Genesis , dao , factory .NewMinter (sf , ap ), blockchain . BlockTimeCalculatorBuilderOption ( testutil . DummyBlockTimeBuilder ()) )
2236
+ bc := blockchain .NewBlockchain (cfg .Chain , cfg .Genesis , dao , factory .NewMinter (sf , ap ))
2246
2237
require .NoError (bc .Start (context .Background ()))
2247
2238
defer func () {
2248
2239
require .NoError (bc .Stop (context .Background ()))
@@ -2325,7 +2316,6 @@ func TestActions(t *testing.T) {
2325
2316
sf ,
2326
2317
protocol .NewGenericValidator (sf , accountutil .AccountState ),
2327
2318
)),
2328
- blockchain .BlockTimeCalculatorBuilderOption (testutil .DummyBlockTimeBuilder ()),
2329
2319
)
2330
2320
require .NoError (bc .Start (context .Background ()))
2331
2321
defer func () {
@@ -2381,7 +2371,7 @@ func TestBlockchain_AddRemoveSubscriber(t *testing.T) {
2381
2371
store , err := filedao .NewFileDAOInMemForTest ()
2382
2372
req .NoError (err )
2383
2373
dao := blockdao .NewBlockDAOWithIndexersAndCache (store , []blockdao.BlockIndexer {sf }, cfg .DB .MaxCacheSize )
2384
- bc := blockchain .NewBlockchain (cfg .Chain , cfg .Genesis , dao , factory .NewMinter (sf , ap ), blockchain . BlockTimeCalculatorBuilderOption ( testutil . DummyBlockTimeBuilder ()) )
2374
+ bc := blockchain .NewBlockchain (cfg .Chain , cfg .Genesis , dao , factory .NewMinter (sf , ap ))
2385
2375
// mock
2386
2376
ctrl := gomock .NewController (t )
2387
2377
mb := mock_blockcreationsubscriber .NewMockBlockCreationSubscriber (ctrl )
@@ -2621,7 +2611,6 @@ func newChain(t *testing.T, stateTX bool) (blockchain.Blockchain, factory.Factor
2621
2611
sf ,
2622
2612
protocol .NewGenericValidator (sf , accountutil .AccountState ),
2623
2613
)),
2624
- blockchain .BlockTimeCalculatorBuilderOption (testutil .DummyBlockTimeBuilder ()),
2625
2614
)
2626
2615
require .NotNil (bc )
2627
2616
ep := execution .NewProtocol (dao .GetBlockHash , rewarding .DepositGas , fakeGetBlockTime )
0 commit comments