Repository navigation
Conversation
Contributor
|
Welcome to RustChain! Thanks for your first pull request. Before we review, please make sure:
Bounty tiers: Micro (1-10 RTC) | Standard (20-50) | Major (75-100) | Critical (100-150) A maintainer will review your PR soon. Thanks for contributing! |
Contributor
|
This PR is quite large (XL). Consider splitting into smaller, focused PRs for faster review. Large PRs take longer to review and have higher risk of issues. |
This was referenced Nov 12, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
sdk/python/tests/test_cli.py— an offline Click CliRunner suite covering every documented command and option of the Python SDK CLI — plussdk/python/requirements-dev.txt(declares pytest/respx/httpx/click/cryptography) and a minimal.github/workflows/sdk-python.yml(3.9/3.11/3.13; no existing workflow coverssdk/python). No SDK source changes.Linking Scottcjn/rustchain-bounties#17181.
pytest output (local, fully offline, all HTTP mocked with respx):
xfail(strict=True, reason="Rustchain#NNNN")) encode the not-yet-merged fixes plus two tagged"no tracked issue yet"and one spec-orphan: Python SDK CLI rejects fractional RTC amount and fee before sending #8564 (fractional amount/fee —type=int), Python SDK README node status and epoch info commands fail in Click parser #8565 (node status/epoch infogrammar), Python SDK attest --json returns status without running advertised attestation flow #8566 (attest --jsonprints status and returns before the challenge/sign/submit flow), SDK CLI prints 0 RTC for canonical /wallet/balance responses #8580 (balance reads legacybalance/nonceand ignores canonicalamount_rtc), [SECURITY] SDK CLI wallet send uses float for amount/fee — binary floating error on money #8618 (money precision — see notes), non-JSON 200 paths and the spec-requiredamount '0'rejection. They flip to a hard failure the day a fix lands, per the bounty; the marks should then be removed in the fix PR.abc/ negative /0), missing required options.Command → test-name mapping (
cargo test-style; all viainvoke()with--node https://node.test)rustchain --help/--versiontest_help_and_version[--help],[--version]wallet --help…attest --help(all groups/leaves)test_help_and_version[<cmd>](11 parametrized)wallet create(default /--words 24/--json/--words 13rejected)test_wallet_create_default_human,test_wallet_create_words_24_human,test_wallet_create_json_parses_and_has_keys,test_wallet_create_json_24_words,test_wallet_create_invalid_words_rejectedwallet balance <addr>(--node,--json, human; 400/500/unreachable; canonical xfail #8580)test_balance_human,test_balance_json,test_balance_unreachable_node,test_balance_http_500_exits_nonzero_with_stderr,test_balance_http_400_exits_nonzero_with_message,test_balance_canonical_amount_rtc_fieldwallet send <from> <to> <amount>(--fee,--seed,--node,--json)test_send_success_human,test_send_success_json,test_send_payload_fields_include_chain_and_signature,test_send_address_mismatch_exits_nonzero,test_send_amount_abc_rejected,test_send_amount_negative_rejected,test_send_amount_zero_rejected(xfail),test_send_unreachable_node,test_send_transfer_http_400_exits_nonzero,test_send_missing_seed_exits_nonzero,test_send_fractional_amount_reaches_transfer(xfail #8564),test_send_fractional_fee_reaches_transfer(xfail #8564),test_send_amount_and_fee_are_exact_decimals(xfail #8618),test_send_excess_precision_rejectednode(--node,--json; unreachable/500/non-JSON-200 xfail; #8565 xfail)test_node_human,test_node_json,test_node_unreachable,test_node_http_500_exits_nonzero,test_node_non_json_200_is_an_error(xfail),test_node_status_documented_invocation(xfail #8565)epoch(same shape)test_epoch_human,test_epoch_json,test_epoch_unreachable,test_epoch_http_500_exits_nonzero,test_epoch_non_json_200_is_an_error(xfail),test_epoch_info_documented_invocation(xfail #8565)miners list(--json, wrapped-envelope normalization, unreachable/500)test_miners_list_human,test_miners_list_json,test_miners_list_accepts_wrapped_payload,test_miners_list_unreachable,test_miners_list_http_500_exits_nonzeroattest <addr>(--seed,--node,--json; mismatch/unreachable/missing-seed/submit-400; full flow; #8566 xfail)test_attest_human_full_flow,test_attest_address_mismatch_exits_nonzero,test_attest_unreachable_node,test_attest_missing_seed_exits_nonzero,test_attest_submit_http_400_exits_nonzero,test_attest_json_output_is_parseable_json,test_attest_json_runs_full_flow(xfail #8566)Notes on #8618 (representation)
The issue specifies exact-decimal serialization but not the wire representation; tests here therefore (a) keep the parser-gate xfail, (b) assert the amount binds byte-for-byte as the
0.1literal in the raw request body, and (c) addtest_send_excess_precision_rejected(0.1234567must exit non-zero — today only via the #8564 parser gate; a float-parsing band-aid would turn it red; a max-decimals guard per #8618's suggestion keeps it green). Coordinating the exact representation is explicitly left to the #8618 fix.How to verify
python -m pip install -e sdk/python -r sdk/python/requirements-dev.txt python -m pytest sdk/python/tests/test_cli.py -v # optional, flips the strict xfails to failures: python -m pytest sdk/python/tests/test_cli.py --runxfailNo file outside
sdk/python/tests/,sdk/python/requirements-dev.txt, and.github/workflows/sdk-python.ymlis modified.