Skip to content

fix(platform-wallet): give the voting-key-not-in-wallet error its payment class - #6431

Merged
llbartekll merged 1 commit into
v5.2-devfrom
claude/fix-voting-key-error-payment-class-d9f8a3
Dec 1, 2026
Merged

llbartekll merged 1 commit into
v5.2-devfrom
claude/fix-voting-key-error-payment-class-d9f8a3

Conversation

@llbartekll

@llbartekll llbartekll commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Issue being fixed or feature implemented

v5.2-dev does not compile since #6398 merged on top of #5928. This restores the build.

#5928 made the matches over PlatformWalletError exhaustive, so that every wallet error is given a payment class. #6398 added the variant PlatformWalletError::MasternodeVotingKeyNotInWallet, and its CI ran on a base from before #5928, so the variant is missing from those matches. On the branch head (6ccca91211) "Rust workspace tests" and "Build Rust API docs" fail with four E0004 errors in platform-wallet, and every pull request that merges the base fails the same way (the Kotlin SDK job included, as it builds the wallet).

What was done?

MasternodeVotingKeyNotInWallet is added to the four matches the compiler names, and to the test table that enumerates every variant:

  • PlatformWalletError::payment_delivery: NotSent. PlatformWallet::masternode_voting_key raises the error before anything is signed or sent.
  • PlatformWalletError::is_retryable: false. Running the same call again meets the same refusal; the vote needs the wallet that holds the masternode's voting key. This is the class feat(platform-wallet): report whether a failed payment may have left the wallet #5928 gave the comparable MessageSigningKeyUnavailable.
  • refuses_resume in wallet/asset_lock/orchestration.rs: false, like every error that is not about the tracked lock itself.
  • Tests: the variant gets the next ordinal, VARIANT_COUNT goes from 130 to 131, and the table has a NotSent row for it.

No behaviour changes for any other error. The FFI mapping for this variant was already added by #6398.

How Has This Been Tested?

  • Read the failing CI log of 6ccca91211: the four E0004 errors are exactly the four matches changed here (three in the lib, one in the test module).
  • cargo check -p platform-wallet -p platform-wallet-ffi -p rs-unified-sdk-jni --all-targets passes.
  • cargo test -p platform-wallet --lib -- error:: asset_lock::orchestration masternode_vote: 54 passed, including should_classify_every_variant and should_allow_a_retry_only_where_nothing_left, which read the new row.
  • cargo fmt --all -- --check and cargo clippy --all-targets on the three crates are clean.
  • Not run locally: the full workspace test suite, the Rust API docs build and the Kotlin SDK Gradle build. CI covers them.

Breaking Changes

None.

Checklist:

  • I have performed a self-review of my own code
  • My Rust, FFI, WASM, Swift or Kotlin changes follow the coding conventions
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have added "!" to the title and described breaking changes in the corresponding section if my code contains any
  • I have made corresponding changes to the documentation if needed
  • If I added or changed GroveDB structure, I described it in the area's structure.rs, regenerated grovedb-structure.json, and checked the structure viewer link posted on this pull request
  • If I added or changed a system contract's document schemas, I checked the contract viewer link posted on this pull request

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

🤖 Generated with Claude Code

PR Hygiene · 8162dc1

  • Bots — thepastaclaw ✓
  • Self-review — posted; again after any push
  • Build green
  • Approvals — you own every area touched; none needed

When every merge requirement is met, the PR Hygiene check passes. Reviewer limits do not block merging; other required GitHub checks and protections still apply.

…ment class

v5.2-dev does not compile since #6398 merged on top of #5928: #5928 made
the matches over PlatformWalletError exhaustive so every error gets a
payment class, and #6398 added MasternodeVotingKeyNotInWallet on a base
from before it.

The error is raised by PlatformWallet::masternode_voting_key before
anything is signed or sent, so it is NotSent and not retryable (the vote
needs the wallet that holds the key), like MessageSigningKeyUnavailable.
It does not refuse the resume of a tracked asset lock. The test table
that enumerates every variant gets its row and ordinal.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@coderabbitai

coderabbitai Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 7 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 6ccca91 and 8162dc1.

Files selected for processing: 2

  • packages/rs-platform-wallet/src/error.rs
  • packages/rs-platform-wallet/src/wallet/asset_lock/orchestration.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions github-actions Bot added this to the v5.2.0 milestone Dec 1, 2026
@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post /skip-bots to proceed without them; blocking findings still need addressing.
Full checklist in the description.

@github-actions github-actions Bot added the waiting-bots Waiting for the review bots to report on this head label Dec 1, 2026
@thepastaclaw

thepastaclaw commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Final review complete — no blockers (commit 8162dc1) · triage: low

@llbartekll

Copy link
Copy Markdown
Contributor Author

/self-reviewed

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Final validation — Phase 1 + Phase 2

This patch completes the four exhaustive wallet error matches, classifying a missing masternode voting key as NotSent and non-retryable without making it an asset-lock resume refusal. Rust wallet tests and the Kotlin and Swift SDK checks passed; Rust workspace tests were skipped, and no Rust API docs check was reported for this head. PR Hygiene and the review check are pending.

Review provenance

Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: muse-spark-1.3-contributor (agent: phase1-reviewer, role: rust-quality); reviewer 3: gpt-6.2-sol (agent: phase2-reviewer, role: general); reviewer 4: gpt-6.2-sol (agent: phase2-reviewer, role: architecture-layering); reviewer 5: gpt-6.2-sol (agent: phase2-reviewer, role: rust-quality); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)

  • Triage: low by gpt-6.2-sol (effort low) — This is a small, well-contained Rust exhaustiveness fix that assigns existing error classifications and updates corresponding coverage without changing payment, signing, or storage behavior.
  • Phase 1 reviewers: muse-spark-1.3-contributor — general (completed, effort high); agent phase1-reviewer, muse-spark-1.3-contributor — rust-quality (completed, effort high); agent phase1-reviewer
  • Phase 1 model: muse-spark-1.3-contributor — not quota-gated; passed over gemini-3.8-flash-high (antigravity quota lookup failed), glm-5.3-flash (zai quota lookup failed)
  • Fresh verifier: gpt-6.2-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers: gpt-6.2-sol — general (completed, effort medium); agent phase2-reviewer, gpt-6.2-sol — architecture-layering (completed, effort medium); agent phase2-reviewer, gpt-6.2-sol — rust-quality (completed, effort medium); agent phase2-reviewer

@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Policy satisfied — this can merge.
Full checklist in the description.

@github-actions github-actions Bot removed the waiting-bots Waiting for the review bots to report on this head label Dec 1, 2026
@llbartekll
llbartekll merged commit e10118c into v5.2-dev Dec 1, 2026
27 checks passed
@llbartekll
llbartekll deleted the claude/fix-voting-key-error-payment-class-d9f8a3 branch December 1, 2026 16:55
HashEngineering added a commit that referenced this pull request Dec 1, 2026
…latform-wallet-top-up-someone-elses-identity-fr

Resolves the payment-class test's variant ordinals with #6398/#6431:
MasternodeVotingKeyNotInWallet keeps 130, this PR's five asset-lock
variants move to 131-135, and VARIANT_COUNT is 136.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants