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. |
…mand Closes Scottcjn/rustchain-bounties#17181. HTTP mocked with respx (no live node); xfail(strict) regression nets for Rustchain#8564/Scottcjn#8565/Scottcjn#8566/Scottcjn#8580/Scottcjn#8618; minimal sdk-python CI workflow.
DSP-AID
force-pushed
the
feat/sdk-cli-tests-17181
branch
from
November 8, 2026 06:19
3989af9 to
baf9892
Compare
Contributor
Author
Owner
|
Thank you - this was the first suite submitted for #17181 and it is careful work. #8661 covers the same ground and is the one that ran green in CI, so I'm closing this as a duplicate. Your first-submission is noted for the maintainer's bounty decision. |
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.
What
Adds
sdk/python/tests/test_cli.py— a pytest +click.testing.CliRunnersuite covering every CLI command and option ofrustchain_sdk/cli.py, with all HTTP mocked in-process (no live node, no sockets). Closes the testing gap described in Scottcjn/rustchain-bounties#17181 — this is the net that keeps the #8564/#8565/#8566/#8580/#8618 fixes fixed; it does not attempt to fix them.respx(the same libraryrustchain_sdk/tests/test_client.pyalready uses), declared insdk/python/requirements-dev.txt. Unmocked routes raiseConnectErrorinside the test, so a live request cannot slip through.Command → test-name mapping
--helpon root,wallet,node,epoch,miners,attest,wallet create/balance/send,miners listtest_help_works_for_every_group_and_command(parametrized ×10),test_root_help_lists_every_documented_command--versiontest_version_flag_reports_the_sdk_versionwallet create(human)test_wallet_create_human_output_shows_address_and_warningwallet create --json(documented export keys)test_wallet_create_json_has_documented_export_keyswallet create --words 24test_wallet_create_words_24_produces_24_word_seedwallet create --words 15(bad option value)test_wallet_create_invalid_word_count_exits_nonzerowallet balance <addr>(human, legacybalance/noncepayload — the #8580 control case)test_wallet_balance_human_output_shows_legacy_payload_figureswallet balance --jsontest_wallet_balance_json_output_matches_node_payloadwallet balance+ bad address (node 400)test_wallet_balance_bad_address_exits_nonzerowallet balancecanonicalamount_rtcpayload (#8580 regression)test_balance_reads_canonical_amount_rtc_field_8580—xfail(strict)wallet send <from> <to> <amt> --fee(human; payload asserts from/to/amount/fee/signature/public-key and thechain_idreplay binding)test_wallet_send_human_output_shows_transfer_figureswallet send --jsontest_wallet_send_json_output_matches_node_resultwallet sendseed/from address mismatch (zero HTTP requests made)test_wallet_send_address_mismatch_stops_before_any_requestwallet send/attestwithout required--seedtest_missing_required_seed_option_exits_nonzero(parametrized)wallet send … abc(bad amount, exit 2)test_wallet_send_non_numeric_amount_exits_nonzerowallet send … -5/… 0test_wallet_send_negative_amount_exits_nonzero,test_wallet_send_zero_amount_exits_nonzerowallet send … 0.5 --fee 0.01(#8564 regression)test_send_accepts_fractional_amount_and_fee_8564—xfail(strict)wallet sendexact decimal serialization of0.1/0.29/10.5/0.01incl. exact µRTC conversion (#8618 regression)test_send_serializes_the_exact_decimal_amount_8618(parametrized ×4) —xfail(strict)node(human),node --json,--node <url>override (custom host:port asserted on the wire)test_node_status_human_output_shows_key_fields,test_node_status_json_output_matches_node_payload,test_node_flag_overrides_the_default_nodenode status …documented grammar (#8565 regression)test_readme_node_status_command_works_8565—xfail(strict)epoch(human),epoch --jsontest_epoch_info_human_output_shows_key_fields,test_epoch_info_json_output_matches_node_payloadepoch info …documented grammar (#8565 regression)test_readme_epoch_info_command_works_8565—xfail(strict)miners list(human),--json, wrapped{"miners": […]}shapetest_miners_list_human_output_lists_every_miner,test_miners_list_json_output_matches_node_payload,test_miners_list_accepts_wrapped_object_payloadattest <addr> --seed …full flow: status→challenge→real Ed25519 signature verified against the wallet pubkey→submittest_attest_requests_challenge_signs_and_submitsattest --jsonparses as JSON (current status shape)test_attest_json_output_parses_as_jsonattest --jsonmust still run challenge+submit (#8566 regression)test_attest_json_runs_challenge_and_submit_8566—xfail(strict)wallet balance/node/epoch/miners list(exit 1, stderr message, no traceback)test_unreachable_node_exits_nonzero_without_traceback(parametrized ×4)test_http_error_status_exits_nonzero_with_message(parametrized ×3)test_non_json_200_exits_nonzero_without_traceback—xfail(strict), see note belowRegression tests / xfail policy
All five issue regressions are written against the expected behaviour from each issue and marked
xfail(strict=True, reason="Rustchain#NNNN …"), per the bounty: they flip to hard failures the day the corresponding fix PR (#8575/#8598/#8610/#8623 for #8564, #8576/#8610 for #8565, #8599/#8610 for #8566, #8596/#8610 for #8580, #8620/#8623 for #8618) is merged — that is the day this net earns its keep. The#8618test asserts the exact decimal token and an exact µRTC (10⁻⁶ RTC) conversion, so it stays honest whichever representation the merged fix chooses.One extra xfail: a non-JSON 200 body is currently echoed as
{"raw_response": …}with exit 0 instead of exiting non-zero (no open PR addresses this specific CLI path; the marker flips when the SDK starts rejecting malformed JSON).Test output (local)
CI
There is no existing workflow for
sdk/python(CI workflows never touch that path). The intended minimal workflow —.github/workflows/sdk-python.yml— cannot be pushed from this fork's PAT because the token lacks theworkflowscope (GitHub rejects any push touching.github/workflows/*, including via the low-level Git Data API, which returns 404). The exact file to add is in this PR's follow-up commit; content:Notes
Decimal(str(...))in the send payload assertions is deliberate:Decimal(float)would reintroduce exactly the binary drift [SECURITY] SDK CLI wallet send uses float for amount/fee — binary floating error on money #8618 reports.Closes #17181
/claim #17181
Wallet: RTC6m7xQJ9Fj8sE2vD1gYp4tN3uW8zK5rB