@@ -31,17 +31,6 @@ public MoneroDaemonRpcFixture()
3131 BINARY_BLOCK_CTX . txContext . fromGetTxPool = false ;
3232 BINARY_BLOCK_CTX . txContext . hasOutputIndices = false ;
3333 BINARY_BLOCK_CTX . txContext . fromBinaryBlock = true ;
34- try
35- {
36- StartMining . Start ( ) ;
37- GenUtils . WaitFor ( 5000 ) ;
38- StopMining . Stop ( ) ;
39- GenUtils . WaitFor ( 5000 ) ;
40- }
41- catch
42- {
43-
44- }
4534
4635 TestUtils . WALLET_TX_TRACKER . Reset ( ) ; // all wallets need to wait for txs to confirm to reliably sync
4736 }
@@ -80,10 +69,15 @@ public TestMoneroDaemonRpc(MoneroDaemonRpcFixture fixture)
8069 var rpcConnection = daemon . GetRpcConnection ( ) ;
8170
8271 Assert . True ( rpcConnection . IsConnected ( ) , "Daemon offline" ) ;
72+ var daemonHeight = daemon . GetHeight ( ) ;
73+ if ( daemonHeight == 1 )
74+ {
75+ MineBlocks ( ) ;
76+ }
8377 }
8478
8579 #region Non Relays Tests
86-
80+
8781 [ Fact ]
8882 public void TestGetVersion ( )
8983 {
@@ -185,8 +179,8 @@ public void TestGetBlockHeadersByRange()
185179 Assert . True ( TEST_NON_RELAYS ) ;
186180
187181 // determine start and end height based on number of blocks and how many blocks ago
188- ulong numBlocks = 100 ;
189- ulong numBlocksAgo = 100 ;
182+ ulong numBlocks = 10 ;
183+ ulong numBlocksAgo = 10 ;
190184 ulong currentHeight = daemon . GetHeight ( ) ;
191185 ulong startHeight = currentHeight - numBlocksAgo ;
192186 ulong endHeight = currentHeight - ( numBlocksAgo - numBlocks ) - 1 ;
@@ -1420,6 +1414,21 @@ public void TestBlockListener()
14201414
14211415 #region Test Helpers
14221416
1417+ private static void MineBlocks ( )
1418+ {
1419+ try
1420+ {
1421+ StartMining . Start ( ) ;
1422+ GenUtils . WaitFor ( 10000 ) ;
1423+ StopMining . Stop ( ) ;
1424+ GenUtils . WaitFor ( 10000 ) ;
1425+ }
1426+ catch ( Exception e )
1427+ {
1428+ MoneroUtils . Log ( 0 , e . Message ) ;
1429+ }
1430+ }
1431+
14231432 private static void TestBlockHeader ( MoneroBlockHeader ? header , bool isFull )
14241433 {
14251434 Assert . NotNull ( header ) ;
0 commit comments