Skip to content

fix(wasm-solana): reject negative intent amounts - #405

Draft
ralph-bitgo[bot] wants to merge 1 commit into
masterfrom
wcn-1881-reject-negative-solana-amounts
Draft

ralph-bitgo[bot] wants to merge 1 commit into
masterfrom
wcn-1881-reject-negative-solana-amounts

Conversation

@ralph-bitgo

@ralph-bitgo ralph-bitgo Bot commented Sep 24, 2026

Copy link
Copy Markdown

What

  • Reject negative values for all primary Solana intent amounts.
  • Keep negative remainingStakingAmount handling field-specific as an
    ExceedsBalance state, preserving full-deactivation compatibility.
  • Add Rust parsing/build regressions and public builder cases for negative
    BigInt, number, and string amounts; retain zero and positive split coverage.

Why

  • Negative primary values previously became zero, allowing an invalid partial
    unstake to build as full stake deactivation. Rejecting them prevents that
    operation substitution while preserving the supported over-balance response.

Test plan

  • git diff --check (passed)
  • cargo test --manifest-path packages/wasm-solana/Cargo.toml — blocked;
    Cargo is unavailable in this workspace (the prior attempt exited 127).
  • npm run build --prefix packages/wasm-solana and
    npm test --prefix packages/wasm-solana — blocked; Node is unavailable,
    and the integration tests import generated dist/cjs WASM output.

Ticket: WCN-1881

Reject negative values for primary amounts and scope the existing
 over-balance sentinel to remainingStakingAmount. This prevents invalid
 unstake requests from selecting full stake deactivation while preserving
 the supported service response.

Ticket: WCN-1881
Session-Id: 6a8cee27-919e-42f4-9f03-1dc548525829
Task-Id: e5de3751-6895-436b-8c68-65394f7dd294
@ralph-bitgo
ralph-bitgo Bot force-pushed the wcn-1881-reject-negative-solana-amounts branch from 14702f8 to f62024d Compare September 24, 2026 21:52
@linear-code

linear-code Bot commented Sep 24, 2026

Copy link
Copy Markdown

WCN-1881

This branch has not been deployed

No deployments
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.

1 participant