1313from utils import MoneroTestUtils as Utils , TestContext , BinaryBlockContext
1414
1515
16- @pytest .mark .monero_daemon_rpc
16+ # TODO enable rpc daemon tests
17+ @pytest .mark .skipif (True , reason = "TODO" )
1718class TestMoneroDaemonRpc :
1819 _daemon : MoneroDaemonRpc = Utils .get_daemon_rpc ()
19- _wallet : MoneroWalletRpc = Utils .get_wallet_rpc ()
20+ _wallet : MoneroWalletRpc # = Utils.get_wallet_rpc()
2021 BINARY_BLOCK_CTX : BinaryBlockContext = BinaryBlockContext ()
2122
2223 # Can get the daemon's version
23- @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , "TEST_NON_RELAYS disabled" )
24+ @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , reason = "TEST_NON_RELAYS disabled" )
2425 def test_get_version (self ):
2526 version : MoneroVersion = self ._daemon .get_version ()
2627 assert version .number is not None
2728 Utils .assert_true (version .number > 0 )
2829 Utils .assert_not_none (version .is_release )
2930
3031 # Can indicate if it's trusted
31- @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , "TEST_NON_RELAYS disabled" )
32+ @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , reason = "TEST_NON_RELAYS disabled" )
3233 def test_is_trusted (self ):
3334 self ._daemon .is_trusted ()
3435
3536 # Can get the blockchain height
36- @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , "TEST_NON_RELAYS disabled" )
37+ @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , reason = "TEST_NON_RELAYS disabled" )
3738 def test_get_height (self ):
3839 height = self ._daemon .get_height ()
3940 Utils .assert_true (height > 0 , "Height must be greater than 0" )
4041
4142 # Can get a block hash by height
42- @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , "TEST_NON_RELAYS disabled" )
43+ @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , reason = "TEST_NON_RELAYS disabled" )
4344 def test_get_block_id_by_height (self ):
4445 last_header : MoneroBlockHeader = self ._daemon .get_last_block_header ()
4546 assert last_header .height is not None
@@ -48,19 +49,19 @@ def test_get_block_id_by_height(self):
4849 Utils .assert_equals (64 , len (hash_str ))
4950
5051 # Can get a block template
51- @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , "TEST_NON_RELAYS disabled" )
52+ @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , reason = "TEST_NON_RELAYS disabled" )
5253 def test_get_block_template (self ):
5354 template : MoneroBlockTemplate = self ._daemon .get_block_template (Utils .ADDRESS , 2 )
5455 Utils .test_block_template (template )
5556
5657 # Can get the last block's header
57- @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , "TEST_NON_RELAYS disabled" )
58+ @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , reason = "TEST_NON_RELAYS disabled" )
5859 def test_get_last_block_header (self ):
5960 last_header : MoneroBlockHeader = self ._daemon .get_last_block_header ()
6061 Utils .test_block_header (last_header , True )
6162
6263 # Can get a block header by hash
63- @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , "TEST_NON_RELAYS disabled" )
64+ @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , reason = "TEST_NON_RELAYS disabled" )
6465 def test_get_block_header_by_hash (self ):
6566 # retrieve by hash of last block
6667 last_header : MoneroBlockHeader = self ._daemon .get_last_block_header ()
@@ -77,7 +78,7 @@ def test_get_block_header_by_hash(self):
7778 Utils .assert_equals (last_header .height - 1 , header .height )
7879
7980 # Can get a block header by height
80- @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , "TEST_NON_RELAYS disabled" )
81+ @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , reason = "TEST_NON_RELAYS disabled" )
8182 def test_get_block_header_by_height (self ):
8283 # retrieve by height of last block
8384 last_header : MoneroBlockHeader = self ._daemon .get_last_block_header ()
@@ -93,7 +94,7 @@ def test_get_block_header_by_height(self):
9394
9495 # Can get block headers by range
9596 # TODO: test start with no end, vice versa, inclusivity
96- @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , "TEST_NON_RELAYS disabled" )
97+ @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , reason = "TEST_NON_RELAYS disabled" )
9798 def test_get_block_headers_by_range (self ):
9899 # determine start and end height based on number of blocks and how many blocks ago
99100 num_blocks = 100
@@ -115,7 +116,7 @@ def test_get_block_headers_by_range(self):
115116 i += 1
116117
117118 # Can get a block by hash
118- @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , "TEST_NON_RELAYS disabled" )
119+ @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , reason = "TEST_NON_RELAYS disabled" )
119120 def test_get_block_by_hash (self ):
120121 # test config
121122 ctx = TestContext ()
@@ -141,12 +142,12 @@ def test_get_block_by_hash(self):
141142 Utils .assert_equals (None , block .txs )
142143
143144 # Can get blocks by hash which includes transactions (binary)
144- @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , "TEST_NON_RELAYS disabled" )
145+ @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , reason = "TEST_NON_RELAYS disabled" )
145146 def test_get_blocks_by_hash_binary (self ) -> None :
146147 raise NotImplementedError ("Not implemented" )
147148
148149 # Can get a block by height
149- @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , "TEST_NON_RELAYS disabled" )
150+ @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , reason = "TEST_NON_RELAYS disabled" )
150151 def test_get_block_by_height (self ):
151152 # config for testing blocks
152153 ctx = TestContext ()
@@ -168,7 +169,7 @@ def test_get_block_by_height(self):
168169 Utils .assert_equals (last_header .height - 1 , block .height )
169170
170171 # Can get blocks by height which includes transactions (binary)
171- @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , "TEST_NON_RELAYS disabled" )
172+ @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , reason = "TEST_NON_RELAYS disabled" )
172173 def test_get_blocks_by_height_binary (self ):
173174 # set number of blocks to test
174175 num_blocks = 100
@@ -207,7 +208,7 @@ def test_get_blocks_by_height_binary(self):
207208 Utils .assert_true (tx_found , "No transactions found to test" )
208209
209210 # Can get transaction pool statistics
210- @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , "TEST_NON_RELAYS disabled" )
211+ @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , reason = "TEST_NON_RELAYS disabled" )
211212 def test_get_tx_pool_statistics (self ):
212213 daemon = self ._daemon
213214 wallet = self ._wallet
@@ -238,40 +239,40 @@ def test_get_tx_pool_statistics(self):
238239 raise e
239240
240241 # Can get general information
241- @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , "TEST_NON_RELAYS disabled" )
242+ @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , reason = "TEST_NON_RELAYS disabled" )
242243 def test_get_general_information (self ):
243244 info : MoneroDaemonInfo = self ._daemon .get_info ()
244245 Utils .test_info (info )
245246
246247 # Can get sync information
247- @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , "TEST_NON_RELAYS disabled" )
248+ @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , reason = "TEST_NON_RELAYS disabled" )
248249 def test_get_sync_information (self ):
249250 sync_info : MoneroDaemonSyncInfo = self ._daemon .get_sync_info ()
250251 Utils .test_sync_info (sync_info )
251252
252253 # Can get hard fork information
253- @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , "TEST_NON_RELAYS disabled" )
254+ @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , reason = "TEST_NON_RELAYS disabled" )
254255 def test_get_hard_fork_information (self ):
255256 hard_fork_info : MoneroHardForkInfo = self ._daemon .get_hard_fork_info ()
256257 Utils .test_hard_fork_info (hard_fork_info )
257258
258259 # Can get alternative chains
259- @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , "TEST_NON_RELAYS disabled" )
260+ @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , reason = "TEST_NON_RELAYS disabled" )
260261 def test_get_alternative_chains (self ):
261262 alt_chains : list [MoneroAltChain ] = self ._daemon .get_alt_chains ()
262263 for altChain in alt_chains :
263264 Utils .test_alt_chain (altChain )
264265
265266 # Can get alternative block hashes
266- @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , "TEST_NON_RELAYS disabled" )
267+ @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , reason = "TEST_NON_RELAYS disabled" )
267268 def test_get_alternative_block_ids (self ):
268269 alt_block_ids : list [str ] = self ._daemon .get_alt_block_hashes ()
269270 for altBlockId in alt_block_ids :
270271 Utils .assert_not_none (altBlockId )
271272 Utils .assert_equals (64 , len (altBlockId )) # TODO: common validation
272273
273274 # Can get, set, and reset a download bandwidth limit
274- @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , "TEST_NON_RELAYS disabled" )
275+ @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , reason = "TEST_NON_RELAYS disabled" )
275276 def test_set_download_bandwidth (self ):
276277 init_val : int = self ._daemon .get_download_limit ()
277278 Utils .assert_true (init_val > 0 )
@@ -291,7 +292,7 @@ def test_set_download_bandwidth(self):
291292 Utils .assert_equals (self ._daemon .get_download_limit (), init_val )
292293
293294 # Can get, set, and reset an upload bandwidth limit
294- @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , "TEST_NON_RELAYS disabled" )
295+ @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , reason = "TEST_NON_RELAYS disabled" )
295296 def test_set_upload_bandwidth (self ):
296297 init_val : int = self ._daemon .get_upload_limit ()
297298 Utils .assert_true (init_val > 0 )
@@ -311,37 +312,37 @@ def test_set_upload_bandwidth(self):
311312 Utils .assert_equals (init_val , self ._daemon .get_upload_limit ())
312313
313314 # Can get peers with active incoming or outgoing connections
314- @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , "TEST_NON_RELAYS disabled" )
315+ @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , reason = "TEST_NON_RELAYS disabled" )
315316 def test_get_peers (self ):
316317 peers : list [MoneroPeer ] = self ._daemon .get_peers ()
317318 Utils .assert_false (len (peers ) == 0 , "Daemon has no incoming or outgoing peers to test" )
318319 for peer in peers :
319320 Utils .test_peer (peer )
320321
321322 # Can get all known peers which may be online or offline
322- @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , "TEST_NON_RELAYS disabled" )
323+ @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , reason = "TEST_NON_RELAYS disabled" )
323324 def test_get_known_peers (self ):
324325 peers : list [MoneroPeer ] = self ._daemon .get_known_peers ()
325326 Utils .assert_false (len (peers ) == 0 , "Daemon has no known peers to test" )
326327 for peer in peers :
327328 Utils .test_known_peer (peer , False )
328329
329330 # Can limit the number of outgoing peers
330- @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , "TEST_NON_RELAYS disabled" )
331+ @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , reason = "TEST_NON_RELAYS disabled" )
331332 def test_set_outgoing_peer_limit (self ):
332333 self ._daemon .set_outgoing_peer_limit (0 )
333334 self ._daemon .set_outgoing_peer_limit (8 )
334335 self ._daemon .set_outgoing_peer_limit (10 )
335336
336337 # Can limit the number of incoming peers
337- @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , "TEST_NON_RELAYS disabled" )
338+ @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , reason = "TEST_NON_RELAYS disabled" )
338339 def test_set_incoming_peer_limit (self ):
339340 self ._daemon .set_incoming_peer_limit (0 )
340341 self ._daemon .set_incoming_peer_limit (8 )
341342 self ._daemon .set_incoming_peer_limit (10 )
342343
343344 # Can notify listeners when a new block is added to the chain
344- @pytest .mark .skipif (Utils .LITE_MODE is True or Utils .TEST_NOTIFICATIONS is False )
345+ @pytest .mark .skipif (Utils .LITE_MODE is True or Utils .TEST_NOTIFICATIONS is False , reason = "TEST_NOTIFICATIONS disabled" )
345346 def test_block_listener (self ):
346347 try :
347348 # start mining if possible to help push the network along
@@ -372,7 +373,7 @@ def test_block_listener(self):
372373 print (f"[!]: { str (e )} " )
373374
374375 # Can start and stop mining
375- @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , "TEST_NON_RELAYS disabled" )
376+ @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , reason = "TEST_NON_RELAYS disabled" )
376377 def test_mining (self ):
377378 # stop mining at beginning of test
378379 try :
@@ -390,7 +391,7 @@ def test_mining(self):
390391 self ._daemon .stop_mining ()
391392
392393 # Can get mining status
393- @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , "TEST_NON_RELAYS disabled" )
394+ @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , reason = "TEST_NON_RELAYS disabled" )
394395 def test_get_mining_status (self ):
395396 try :
396397 # stop mining at beginning of test
@@ -429,7 +430,7 @@ def test_get_mining_status(self):
429430 print (f"[!]: { str (e )} " )
430431
431432 # Can submit a mined block to the network
432- @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , "TEST_NON_RELAYS disabled" )
433+ @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , reason = "TEST_NON_RELAYS disabled" )
433434 def test_submit_mined_block (self ):
434435 # get template to mine on
435436 template : MoneroBlockTemplate = self ._daemon .get_block_template (Utils .ADDRESS )
@@ -446,7 +447,7 @@ def test_submit_mined_block(self):
446447 Utils .assert_equals ("Block not accepted" , str (e ))
447448
448449 # Can prune the blockchain
449- @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , "TEST_NON_RELAYS disabled" )
450+ @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , reason = "TEST_NON_RELAYS disabled" )
450451 def test_prune_blockchain (self ):
451452 result : MoneroPruneResult = self ._daemon .prune_blockchain (True )
452453
@@ -457,13 +458,13 @@ def test_prune_blockchain(self):
457458 Utils .assert_equals (0 , result .pruning_seed )
458459
459460 # Can check for an update
460- @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , "TEST_NON_RELAYS disabled" )
461+ @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , reason = "TEST_NON_RELAYS disabled" )
461462 def test_check_for_update (self ):
462463 result : MoneroDaemonUpdateCheckResult = self ._daemon .check_for_update ()
463464 Utils .test_update_check_result (result )
464465
465466 # Can download an update
466- @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , "TEST_NON_RELAYS disabled" )
467+ @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , reason = "TEST_NON_RELAYS disabled" )
467468 def test_download_update (self ):
468469 # download to default path
469470 result : MoneroDaemonUpdateDownloadResult = self ._daemon .download_update ()
@@ -484,7 +485,7 @@ def test_download_update(self):
484485 # Utils.assert_equals(500, (int) e.getCode()) # TODO monerod: this causes a 500 in daemon rpc
485486
486487 # Can be stopped
487- @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , "TEST_NON_RELAYS disabled" )
488+ @pytest .mark .skipif (Utils .TEST_NON_RELAYS is False , reason = "TEST_NON_RELAYS disabled" )
488489 @pytest .mark .skip (reason = "test is disabled to not interfere with other tests" )
489490 def test_stop (self ):
490491 # stop the daemon
0 commit comments