The get_param! and get_optional_param! macros will be reused a lot as more methods are added.
Depends on D17314
Ref T3598
Differential D17347
[chronik] add macros to extract params from a JSONRPC request PiRK on Fri, Dec 13, 14:32. Authored by
Details
The get_param! and get_optional_param! macros will be reused a lot as more methods are added. Depends on D17314 ninja check-functional
Diff Detail
Event Timeline
Comment Actions Build Bitcoin ABC Diffs / Diff Testing (build-chronik) failed.
Failed tests logs: ====== Bitcoin ABC functional tests: chronik_mempool_conflicts.py ====== ------- Stdout: ------- 2024-12-13T14:53:39.082000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-chronik/test/tmp/test_runner_₿₵_🏃_20241213_144949/chronik_mempool_conflicts_208 2024-12-13T14:53:41.592000Z TestFramework (ERROR): Assertion failed Traceback (most recent call last): File "/work/test/functional/test_framework/test_framework.py", line 635, in start_nodes node.wait_for_rpc_connection() File "/work/test/functional/test_framework/test_node.py", line 353, in wait_for_rpc_connection raise FailedToStartError( test_framework.test_node.FailedToStartError: [node 0] bitcoind exited with status 1 during initialization During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/work/test/functional/test_framework/test_framework.py", line 148, in main self.setup() File "/work/test/functional/test_framework/test_framework.py", line 383, in setup self.setup_network() File "/work/test/functional/test_framework/test_framework.py", line 490, in setup_network self.setup_nodes() File "/work/test/functional/test_framework/test_framework.py", line 515, in setup_nodes self.start_nodes() File "/work/test/functional/test_framework/test_framework.py", line 638, in start_nodes self.stop_nodes() File "/work/test/functional/test_framework/test_framework.py", line 653, in stop_nodes node.stop_node(wait=wait, wait_until_stopped=False) File "/work/test/functional/test_framework/test_node.py", line 515, in stop_node self.stop(wait=wait) ^^^^^^^^^ File "/work/test/functional/test_framework/test_node.py", line 283, in __getattr__ assert self.rpc is not None, self._node_msg("Error: RPC not initialized") ^^^^^^^^^^^^^^^^^^^^ AssertionError: [node 0] Error: RPC not initialized 2024-12-13T14:53:41.644000Z TestFramework (INFO): Stopping nodes [node 0] Cleaning up leftover process ------- Stderr: ------- Traceback (most recent call last): File "/work/test/functional/chronik_mempool_conflicts.py", line 103, in <module> ChronikMempoolConflicts().main() File "/work/test/functional/test_framework/test_framework.py", line 172, in main exit_code = self.shutdown() ^^^^^^^^^^^^^^^ File "/work/test/functional/test_framework/test_framework.py", line 398, in shutdown self.stop_nodes() File "/work/test/functional/test_framework/test_framework.py", line 653, in stop_nodes node.stop_node(wait=wait, wait_until_stopped=False) File "/work/test/functional/test_framework/test_node.py", line 515, in stop_node self.stop(wait=wait) ^^^^^^^^^ File "/work/test/functional/test_framework/test_node.py", line 283, in __getattr__ assert self.rpc is not None, self._node_msg("Error: RPC not initialized") ^^^^^^^^^^^^^^^^^^^^ AssertionError: [node 0] Error: RPC not initialized ====== Bitcoin ABC functional tests: chronik_token_slp_nft1.py ====== ------- Stdout: ------- 2024-12-13T14:53:42.915000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-chronik/test/tmp/test_runner_₿₵_🏃_20241213_144949/chronik_token_slp_nft1_221 2024-12-13T14:53:45.425000Z TestFramework (ERROR): Assertion failed Traceback (most recent call last): File "/work/test/functional/test_framework/test_framework.py", line 635, in start_nodes node.wait_for_rpc_connection() File "/work/test/functional/test_framework/test_node.py", line 353, in wait_for_rpc_connection raise FailedToStartError( test_framework.test_node.FailedToStartError: [node 0] bitcoind exited with status 1 during initialization During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/work/test/functional/test_framework/test_framework.py", line 148, in main self.setup() File "/work/test/functional/test_framework/test_framework.py", line 383, in setup self.setup_network() File "/work/test/functional/test_framework/test_framework.py", line 490, in setup_network self.setup_nodes() File "/work/test/functional/test_framework/test_framework.py", line 515, in setup_nodes self.start_nodes() File "/work/test/functional/test_framework/test_framework.py", line 638, in start_nodes self.stop_nodes() File "/work/test/functional/test_framework/test_framework.py", line 653, in stop_nodes node.stop_node(wait=wait, wait_until_stopped=False) File "/work/test/functional/test_framework/test_node.py", line 515, in stop_node self.stop(wait=wait) ^^^^^^^^^ File "/work/test/functional/test_framework/test_node.py", line 283, in __getattr__ assert self.rpc is not None, self._node_msg("Error: RPC not initialized") ^^^^^^^^^^^^^^^^^^^^ AssertionError: [node 0] Error: RPC not initialized 2024-12-13T14:53:45.476000Z TestFramework (INFO): Stopping nodes [node 0] Cleaning up leftover process ------- Stderr: ------- Traceback (most recent call last): File "/work/test/functional/chronik_token_slp_nft1.py", line 261, in <module> ChronikTokenSlpNft1().main() File "/work/test/functional/test_framework/test_framework.py", line 172, in main exit_code = self.shutdown() ^^^^^^^^^^^^^^^ File "/work/test/functional/test_framework/test_framework.py", line 398, in shutdown self.stop_nodes() File "/work/test/functional/test_framework/test_framework.py", line 653, in stop_nodes node.stop_node(wait=wait, wait_until_stopped=False) File "/work/test/functional/test_framework/test_node.py", line 515, in stop_node self.stop(wait=wait) ^^^^^^^^^ File "/work/test/functional/test_framework/test_node.py", line 283, in __getattr__ assert self.rpc is not None, self._node_msg("Error: RPC not initialized") ^^^^^^^^^^^^^^^^^^^^ AssertionError: [node 0] Error: RPC not initialized Each failure log is accessible here: Comment Actions remove the small intermediate macros that only have one callsite. They just make the logic harder to follow. Comment Actions Build Bitcoin ABC Diffs / Diff Testing (build-chronik-plugins) failed.
Failed tests logs: ====== Bitcoin ABC functional tests: chronik_blocks.py ====== ------- Stdout: ------- 2024-12-13T20:49:51.031000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-chronik-plugins/test/tmp/test_runner_₿₵_🏃_20241213_204734/chronik_blocks_204 2024-12-13T20:49:51.786000Z TestFramework (ERROR): Assertion failed Traceback (most recent call last): File "/work/test/functional/test_framework/test_framework.py", line 635, in start_nodes node.wait_for_rpc_connection() File "/work/test/functional/test_framework/test_node.py", line 353, in wait_for_rpc_connection raise FailedToStartError( test_framework.test_node.FailedToStartError: [node 0] bitcoind exited with status 1 during initialization During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/work/test/functional/test_framework/test_framework.py", line 148, in main self.setup() File "/work/test/functional/test_framework/test_framework.py", line 383, in setup self.setup_network() File "/work/test/functional/test_framework/test_framework.py", line 490, in setup_network self.setup_nodes() File "/work/test/functional/test_framework/test_framework.py", line 515, in setup_nodes self.start_nodes() File "/work/test/functional/test_framework/test_framework.py", line 638, in start_nodes self.stop_nodes() File "/work/test/functional/test_framework/test_framework.py", line 653, in stop_nodes node.stop_node(wait=wait, wait_until_stopped=False) File "/work/test/functional/test_framework/test_node.py", line 515, in stop_node self.stop(wait=wait) ^^^^^^^^^ File "/work/test/functional/test_framework/test_node.py", line 283, in __getattr__ assert self.rpc is not None, self._node_msg("Error: RPC not initialized") ^^^^^^^^^^^^^^^^^^^^ AssertionError: [node 0] Error: RPC not initialized 2024-12-13T20:49:51.837000Z TestFramework (INFO): Stopping nodes [node 0] Cleaning up leftover process ------- Stderr: ------- Traceback (most recent call last): File "/work/test/functional/chronik_blocks.py", line 101, in <module> ChronikBlockRangeTest().main() File "/work/test/functional/test_framework/test_framework.py", line 172, in main exit_code = self.shutdown() ^^^^^^^^^^^^^^^ File "/work/test/functional/test_framework/test_framework.py", line 398, in shutdown self.stop_nodes() File "/work/test/functional/test_framework/test_framework.py", line 653, in stop_nodes node.stop_node(wait=wait, wait_until_stopped=False) File "/work/test/functional/test_framework/test_node.py", line 515, in stop_node self.stop(wait=wait) ^^^^^^^^^ File "/work/test/functional/test_framework/test_node.py", line 283, in __getattr__ assert self.rpc is not None, self._node_msg("Error: RPC not initialized") ^^^^^^^^^^^^^^^^^^^^ AssertionError: [node 0] Error: RPC not initialized Each failure log is accessible here: Comment Actions There seems to be some kind if intermittent issue introduced by this diff or it's parent. To be investigated. Comment Actions These issues are likely port collisions 2024-12-13T20:49:51.570827Z [chronik/chronik-lib/src/bridge.rs:181] [<chronik unknown>] Starting Chronik Electrum interface bound to [(127.0.0.1:33252, Tcp)] 2024-12-13T20:49:51.574474Z [chronik/chronik-indexer/src/indexer.rs:1491] [<chronik unknown>] Chronik Electrum failed serving: Address already in use (os error 98) 2024-12-13T20:49:51.574503Z [/work/src/shutdown.cpp:22] [AbortNode] *** ERROR Chronik in ChronikElectrumServer::serve 2024-12-13T20:49:51.574521Z [/work/src/noui.cpp:42] [noui_ThreadSafeMessageBox] Error: Chronik Electrum failed serving: Address already in use (os error 98) Comment Actions I would love to see a test for these error cases, since blockchain.transaction.get has both a mandatory and an optional arg it fits perfectly
Comment Actions Build Bitcoin ABC Diffs / Diff Testing (build-chronik) failed.
Failed tests logs: ====== Bitcoin ABC functional tests: chronik_token_slp_nft1.py ====== ------- Stdout: ------- 2024-12-16T12:55:23.432000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-chronik/test/tmp/test_runner_₿₵_🏃_20241216_125224/chronik_token_slp_nft1_221 2024-12-16T12:55:25.189000Z TestFramework (ERROR): Assertion failed Traceback (most recent call last): File "/work/test/functional/test_framework/test_framework.py", line 635, in start_nodes node.wait_for_rpc_connection() File "/work/test/functional/test_framework/test_node.py", line 353, in wait_for_rpc_connection raise FailedToStartError( test_framework.test_node.FailedToStartError: [node 0] bitcoind exited with status 1 during initialization During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/work/test/functional/test_framework/test_framework.py", line 148, in main self.setup() File "/work/test/functional/test_framework/test_framework.py", line 383, in setup self.setup_network() File "/work/test/functional/test_framework/test_framework.py", line 490, in setup_network self.setup_nodes() File "/work/test/functional/test_framework/test_framework.py", line 515, in setup_nodes self.start_nodes() File "/work/test/functional/test_framework/test_framework.py", line 638, in start_nodes self.stop_nodes() File "/work/test/functional/test_framework/test_framework.py", line 653, in stop_nodes node.stop_node(wait=wait, wait_until_stopped=False) File "/work/test/functional/test_framework/test_node.py", line 515, in stop_node self.stop(wait=wait) ^^^^^^^^^ File "/work/test/functional/test_framework/test_node.py", line 283, in __getattr__ assert self.rpc is not None, self._node_msg("Error: RPC not initialized") ^^^^^^^^^^^^^^^^^^^^ AssertionError: [node 0] Error: RPC not initialized 2024-12-16T12:55:25.241000Z TestFramework (INFO): Stopping nodes [node 0] Cleaning up leftover process ------- Stderr: ------- Traceback (most recent call last): File "/work/test/functional/chronik_token_slp_nft1.py", line 261, in <module> ChronikTokenSlpNft1().main() File "/work/test/functional/test_framework/test_framework.py", line 172, in main exit_code = self.shutdown() ^^^^^^^^^^^^^^^ File "/work/test/functional/test_framework/test_framework.py", line 398, in shutdown self.stop_nodes() File "/work/test/functional/test_framework/test_framework.py", line 653, in stop_nodes node.stop_node(wait=wait, wait_until_stopped=False) File "/work/test/functional/test_framework/test_node.py", line 515, in stop_node self.stop(wait=wait) ^^^^^^^^^ File "/work/test/functional/test_framework/test_node.py", line 283, in __getattr__ assert self.rpc is not None, self._node_msg("Error: RPC not initialized") ^^^^^^^^^^^^^^^^^^^^ AssertionError: [node 0] Error: RPC not initialized Each failure log is accessible here: |