Skip to content

fix: preserve explicit transaction inputs in HTTP helpers - #6

Open
Astreo666 wants to merge 1 commit into
Bulk-trade:mainfrom
Astreo666:fix/preserve-explicit-transaction-inputs
Open

fix: preserve explicit transaction inputs in HTTP helpers#6
Astreo666 wants to merge 1 commit into
Bulk-trade:mainfrom
Astreo666:fix/preserve-explicit-transaction-inputs

Conversation

@Astreo666

Copy link
Copy Markdown

Preserve explicit transaction inputs in HTTP convenience methods

Summary

HTTP convenience methods now preserve their resolved account and nonce when delegating to place_tx.

Problem

Each convenience method resolved the caller-supplied account and nonce and placed them in ActionMeta, but then called place_tx(..., None, None). place_tx consequently selected the signer's account and generated another nonce for the outer signed transaction.

This made the wire transaction differ from the explicit values accepted by the convenience API.

Changes

Forward the resolved account and nonce into place_tx from all affected methods:

  • limit order
  • market order
  • cancel order
  • cancel all
  • update leverage
  • manage agent wallet
  • approve builder code
  • revoke builder code
  • whitelist faucet
  • request faucet

Add loopback HTTP regression tests that capture the serialized request body and assert the actual wire-level account and nonce for all ten convenience paths.

Compatibility

No public signatures change. Calls that pass None retain the existing defaulting behavior because each method first resolves the signer account and generated nonce. Calls that provide explicit values now observe those same values in the final signed transaction.

Validation

  • Loopback regression suite: 3 grouped tests covering all 10 methods, 3 passed, 0 failed.
  • Core package tests: 28 passed, 0 failed.
  • cargo test -p bulk-client --all-targets: pass.
  • cargo test --workspace --all-targets: pass.
  • Targeted rustfmt --check for both changed files: pass.
  • git diff --check: pass.
  • Worktree cleanliness assertion: pass.
  • clippy -D warnings is blocked by 15 pre-existing warnings at the pinned base commit; a detached baseline check reproduced the same 15 failures. No unrelated lint cleanup is included in this PR.

Test isolation

The regression tests bind an ephemeral loopback port and make no production or testnet requests.

Scope

SDK correctness fix. No security impact is claimed.

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