@@ -191,7 +191,7 @@ func TestUnit_NodeLifecycle_aliveLoop(t *testing.T) {
191191 })
192192 defer func () { assert .NoError (t , node .close ()) }()
193193 poolInfo := newMockPoolChainInfoProvider (t )
194- poolInfo .On ("LatestChainInfo" ).Return (1 , ChainInfo {
194+ poolInfo .On ("LatestChainInfo" , mock . Anything ).Return (0 , ChainInfo {
195195 BlockNumber : 20 ,
196196 }).Once ()
197197 node .SetPoolChainInfoProvider (poolInfo )
@@ -218,7 +218,7 @@ func TestUnit_NodeLifecycle_aliveLoop(t *testing.T) {
218218 })
219219 defer func () { assert .NoError (t , node .close ()) }()
220220 poolInfo := newMockPoolChainInfoProvider (t )
221- poolInfo .On ("LatestChainInfo" ).Return (1 , ChainInfo {
221+ poolInfo .On ("LatestChainInfo" , mock . Anything ).Return (0 , ChainInfo {
222222 BlockNumber : 20 ,
223223 }).Once ()
224224 node .SetPoolChainInfoProvider (poolInfo )
@@ -250,7 +250,7 @@ func TestUnit_NodeLifecycle_aliveLoop(t *testing.T) {
250250 const mostRecentBlock = 20
251251 rpc .On ("GetInterceptedChainInfo" ).Return (ChainInfo {BlockNumber : mostRecentBlock }, ChainInfo {BlockNumber : 30 })
252252 poolInfo := newMockPoolChainInfoProvider (t )
253- poolInfo .On ("LatestChainInfo" ).Return (10 , ChainInfo {
253+ poolInfo .On ("LatestChainInfo" , mock . Anything ).Return (10 , ChainInfo {
254254 BlockNumber : syncThreshold + mostRecentBlock + 1 ,
255255 TotalDifficulty : big .NewInt (10 ),
256256 })
@@ -285,7 +285,7 @@ func TestUnit_NodeLifecycle_aliveLoop(t *testing.T) {
285285 const mostRecentBlock = 20
286286 rpc .On ("GetInterceptedChainInfo" ).Return (ChainInfo {BlockNumber : mostRecentBlock }, ChainInfo {BlockNumber : 30 })
287287 poolInfo := newMockPoolChainInfoProvider (t )
288- poolInfo .On ("LatestChainInfo" ).Return (1 , ChainInfo {
288+ poolInfo .On ("LatestChainInfo" , mock . Anything ).Return (0 , ChainInfo {
289289 BlockNumber : syncThreshold + mostRecentBlock + 1 ,
290290 TotalDifficulty : big .NewInt (10 ),
291291 })
@@ -313,7 +313,7 @@ func TestUnit_NodeLifecycle_aliveLoop(t *testing.T) {
313313 const mostRecentBlock = 20
314314 rpc .On ("GetInterceptedChainInfo" ).Return (ChainInfo {BlockNumber : mostRecentBlock }, ChainInfo {BlockNumber : 30 }).Twice ()
315315 poolInfo := newMockPoolChainInfoProvider (t )
316- poolInfo .On ("LatestChainInfo" ).Return (1 , ChainInfo {
316+ poolInfo .On ("LatestChainInfo" , mock . Anything ).Return (0 , ChainInfo {
317317 BlockNumber : syncThreshold + mostRecentBlock + 1 ,
318318 TotalDifficulty : big .NewInt (10 ),
319319 })
@@ -389,7 +389,7 @@ func TestUnit_NodeLifecycle_aliveLoop(t *testing.T) {
389389 })
390390 defer func () { assert .NoError (t , node .close ()) }()
391391 poolInfo := newMockPoolChainInfoProvider (t )
392- poolInfo .On ("LatestChainInfo" ).Return (1 , ChainInfo {
392+ poolInfo .On ("LatestChainInfo" , mock . Anything ).Return (0 , ChainInfo {
393393 BlockNumber : 20 ,
394394 TotalDifficulty : big .NewInt (10 ),
395395 }).Once ()
@@ -414,7 +414,7 @@ func TestUnit_NodeLifecycle_aliveLoop(t *testing.T) {
414414 })
415415 defer func () { assert .NoError (t , node .close ()) }()
416416 poolInfo := newMockPoolChainInfoProvider (t )
417- poolInfo .On ("LatestChainInfo" ).Return (1 , ChainInfo {
417+ poolInfo .On ("LatestChainInfo" , mock . Anything ).Return (0 , ChainInfo {
418418 BlockNumber : 20 ,
419419 TotalDifficulty : big .NewInt (10 ),
420420 }).Once ()
@@ -640,7 +640,7 @@ func TestUnit_NodeLifecycle_aliveLoop(t *testing.T) {
640640 })
641641 defer func () { assert .NoError (t , node .close ()) }()
642642 poolInfo := newMockPoolChainInfoProvider (t )
643- poolInfo .On ("LatestChainInfo" ).Return (1 , ChainInfo {
643+ poolInfo .On ("LatestChainInfo" , mock . Anything ).Return (0 , ChainInfo {
644644 BlockNumber : 20 ,
645645 TotalDifficulty : big .NewInt (10 ),
646646 }).Once ()
@@ -668,13 +668,12 @@ func TestUnit_NodeLifecycle_aliveLoop(t *testing.T) {
668668 })
669669 defer func () { assert .NoError (t , node .close ()) }()
670670 poolInfo := newMockPoolChainInfoProvider (t )
671- poolInfo .On ("LatestChainInfo" ).Return (1 , ChainInfo {
671+ poolInfo .On ("LatestChainInfo" , mock . Anything ).Return (0 , ChainInfo {
672672 BlockNumber : 20 ,
673673 TotalDifficulty : big .NewInt (10 ),
674674 }).Once ()
675675 node .SetPoolChainInfoProvider (poolInfo )
676676 // tries to redial in outOfSync
677- // tries to redial in outOfSync
678677 rpc .On ("Dial" , mock .Anything ).Return (errors .New ("failed to dial" )).Run (func (_ mock.Arguments ) {
679678 assert .Equal (t , nodeStateOutOfSync , node .State ())
680679 }).Once ()
@@ -1043,7 +1042,7 @@ func TestUnit_NodeLifecycle_outOfSyncLoop(t *testing.T) {
10431042 })
10441043 defer func () { assert .NoError (t , node .close ()) }()
10451044 poolInfo := newMockPoolChainInfoProvider (t )
1046- poolInfo .On ("LatestChainInfo" ).Return (0 , ChainInfo {
1045+ poolInfo .On ("LatestChainInfo" , mock . Anything ).Return (0 , ChainInfo {
10471046 BlockNumber : 100 ,
10481047 TotalDifficulty : big .NewInt (200 ),
10491048 })
@@ -1081,7 +1080,7 @@ func TestUnit_NodeLifecycle_outOfSyncLoop(t *testing.T) {
10811080 })
10821081 defer func () { assert .NoError (t , node .close ()) }()
10831082 poolInfo := newMockPoolChainInfoProvider (t )
1084- poolInfo .On ("LatestChainInfo" ).Return (0 , ChainInfo {
1083+ poolInfo .On ("LatestChainInfo" , mock . Anything ).Return (0 , ChainInfo {
10851084 BlockNumber : 100 ,
10861085 TotalDifficulty : big .NewInt (200 ),
10871086 })
@@ -1121,7 +1120,7 @@ func TestUnit_NodeLifecycle_outOfSyncLoop(t *testing.T) {
11211120 defer func () { assert .NoError (t , node .close ()) }()
11221121 poolInfo := newMockPoolChainInfoProvider (t )
11231122 const highestBlock = 20
1124- poolInfo .On ("LatestChainInfo" ).Return (1 , ChainInfo {
1123+ poolInfo .On ("LatestChainInfo" , mock . Anything ).Return (1 , ChainInfo {
11251124 BlockNumber : highestBlock * 2 ,
11261125 TotalDifficulty : big .NewInt (200 ),
11271126 })
@@ -1774,7 +1773,7 @@ func TestUnit_NodeLifecycle_outOfSyncWithPool(t *testing.T) {
17741773 config : testNodeConfig {syncThreshold : 1 },
17751774 })
17761775 poolInfo := newMockPoolChainInfoProvider (t )
1777- poolInfo .On ("LatestChainInfo" ).Return (1 , ChainInfo {}).Once ()
1776+ poolInfo .On ("LatestChainInfo" , mock . Anything ).Return (1 , ChainInfo {}).Once ()
17781777 node .SetPoolChainInfoProvider (poolInfo )
17791778 assert .Panics (t , func () {
17801779 _ , _ = node .isOutOfSyncWithPool ()
@@ -1820,7 +1819,7 @@ func TestUnit_NodeLifecycle_outOfSyncWithPool(t *testing.T) {
18201819 },
18211820 })
18221821 poolInfo := newMockPoolChainInfoProvider (t )
1823- poolInfo .On ("LatestChainInfo" ).Return (nodesNum , ChainInfo {
1822+ poolInfo .On ("LatestChainInfo" , mock . Anything ).Return (nodesNum , ChainInfo {
18241823 BlockNumber : highestBlock ,
18251824 TotalDifficulty : big .NewInt (totalDifficulty ),
18261825 })
@@ -1880,7 +1879,7 @@ func TestUnit_NodeLifecycle_outOfSyncWithPool(t *testing.T) {
18801879 })
18811880
18821881 poolInfo := newMockPoolChainInfoProvider (t )
1883- poolInfo .On ("LatestChainInfo" ).Return (nodesNum , ChainInfo {
1882+ poolInfo .On ("LatestChainInfo" , mock . Anything ).Return (nodesNum , ChainInfo {
18841883 BlockNumber : highestBlock ,
18851884 TotalDifficulty : big .NewInt (totalDifficulty ),
18861885 })
0 commit comments