mirror of
https://github.com/bitcoin/bitcoin
synced 2026-12-04 12:17:38 +00:00
test: replace hard-coded RPC error codes #36990
No reviewers
Labels
No labels
Android
Backport
Block storage
Brainstorming
Bug
Build system
CI failed
Consensus
Data corruption
Descriptors
Docs
DrahtBot Guix build requested
Feature
Fuzzing
GUI
Good First Review
IPC
Insufficient Review
Kernel
Linux/Unix
Mempool
Mining
Needs Backport (31.x)
Needs Backport (32.x)
Needs Benchmark
Needs Conceptual Review
Needs backport (30.x)
Needs rebase
Needs release note
Net
P2P
PSBT
Privacy
Private Broadcast
Questions and Help
RPC/REST/ZMQ
Refactoring
Resource usage
Review club
Scripts and tools
Settings
TX fees and policy
Tests
Tracking Issue
UTXO Db and Indexes
Up for grabs
Upstream
Utils/log/libs
Validation
Waiting for author
Wallet
Windows
good first issue
interfaces
macOS
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin/bitcoin!36990
Loading…
Reference in a new issue
No description provided.
Delete branch "l0rinc/test-rpc-error-codes"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem: When a test expects an RPC error by number, readers have to look up the code to tell which failure it covers.
Fix: Use the
RPCErrorCodenames in the C++ RPC tests and mirror the enum in the Python test framework.Give the test client’s errors their own constants so
AuthServiceProxyandTestNodeCLIcan share the HTTP error code.I split this out while reviewing #36976.
Compare the original numeric error codes
Run this diff to inline the constants back to validate that the values haven't changed.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
External sites
Reviews
See the guideline and AI policy for information on the review process.
A summary of reviews will appear here.
Conflicts
Reviewers, this pull request conflicts with the following ones:
getorphantxsverbosity help and type checking by l0rinc)loadtxoutsetRPC with a startup arg by l0rinc)wallet_importdescriptorsto separaterun_test()contents into specific functions by nebula-21)m_blocks_unlinked, fix anothernSequenceIdissue by mzumsande)-addnodestartup values by w0xlt)If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
LLM Linter (✨ experimental)
Possible places where named args for integral literals may be used (e.g.
func(x, /*named_arg=*/0)in C++, andfunc(x, named_arg=0)in Python):test/functional/p2p_disconnect_ban.py:self.nodes[1].setban, "127.27.0.1", "add", 123, Truetest/functional/mempool_ephemeral_dust.py:self.nodes[0].prioritisetransaction, dusty_tx["txid"], 0, 1test/functional/mining_prioritisetransaction.py:self.nodes[0].prioritisetransaction, txid, 1, 0test/functional/rpc_rawtransaction.py:self.nodes[0].createrawtransaction, [], {}, 0, False, TX_MIN_STANDARD_VERSION - 1test/functional/wallet_send.py:w0.send, {w1.getnewaddress(): 1}, 6, "conservative", 1, {"feeRate": 0.01}2026-12-03 14:20:16
Earlier concerns neither republished nor resolved: 1 suggestion. See the Run archive linked from the Review report for their assessments.
🔵 Suggestion · The Python RPC-code mirror has no consistency check
The new
rpc_error_codes.pytable matchesRPCErrorCodetoday, but its completeness and unused alias relationships are not checked automatically.Location:
test/functional/test_framework/rpc_error_codes.py:5(head).Review coverage was incomplete.
Reviewed:
ec534b0f8034· Review report · Previous reportspermalink
🐙 This pull request conflicts with the target branch and needs rebase.