Conversation
illuzen
commented
Apr 18, 2026
- new --secret arg for collect-rewards (could be easily extended to other commands)
- it conflicts with both --wallet and --mnemonic
Follow-up review feedback for #92. The original PR tested helpers indirectly (parse_secret_hex_str, compute_wormhole_address) but never exercised the new match arms in collect_rewards, and left the clap mutual-exclusion constraints without a guardrail. - Extract credential resolution into `resolve_credential` so the Mnemonic / Secret branches are directly testable, and call it from `collect_rewards`. - Remove the redundant `compute_wormhole_address` call inside the per-transfer proof loop now that `wormhole_address_bytes` is already produced at the top of the flow. - Replace the 6 indirect tests with 7 direct tests that actually run `resolve_credential`, including a mnemonic -> HD-derived-secret -> `Secret { hex }` equivalence test and the `HD derivation failed` error path. - Add 3 clap parsing tests covering `required_unless_present_any` and the three `conflicts_with_all` pairs (wallet+mnemonic, wallet+secret, mnemonic+secret).
ReviewOverall this is a clean change — the 1. Leftover duplicate
|
|
Can be merged after #94 is merged |
* Cover new credential code paths and drop duplicate address compute Follow-up review feedback for #92. The original PR tested helpers indirectly (parse_secret_hex_str, compute_wormhole_address) but never exercised the new match arms in collect_rewards, and left the clap mutual-exclusion constraints without a guardrail. - Extract credential resolution into `resolve_credential` so the Mnemonic / Secret branches are directly testable, and call it from `collect_rewards`. - Remove the redundant `compute_wormhole_address` call inside the per-transfer proof loop now that `wormhole_address_bytes` is already produced at the top of the flow. - Replace the 6 indirect tests with 7 direct tests that actually run `resolve_credential`, including a mnemonic -> HD-derived-secret -> `Secret { hex }` equivalence test and the `HD derivation failed` error path. - Add 3 clap parsing tests covering `required_unless_present_any` and the three `conflicts_with_all` pairs (wallet+mnemonic, wallet+secret, mnemonic+secret). * Fix wormhole HD path and pin it with a regression test Port the derivation-path fix from main (#93): the wormhole HD path for `collect_rewards` must be `m/44'/CHAIN/0'/0'/index'` — the intermediate segment is 0', not 1'. Also move the `derive` progress call to after resolution so it reports the actual derived SS58 address, matching main's behavior. Add `test_resolve_credential_mnemonic_pinned_derivation_path` which pins the expected (address_bytes, secret_bytes) for the canonical abandon-art test mnemonic at index 0. Any future silent regression of the path segments will fail this test. * format