Skip to content

fix: deriveTransactionType defaults to CustomTx for non-transfer transactions#8224

Merged
lcovar merged 1 commit intomasterfrom
BTC-3102-fix-derive-transaction-type-customtx
Mar 3, 2026
Merged

fix: deriveTransactionType defaults to CustomTx for non-transfer transactions#8224
lcovar merged 1 commit intomasterfrom
BTC-3102-fix-derive-transaction-type-customtx

Conversation

@lcovar
Copy link
Contributor

@lcovar lcovar commented Mar 3, 2026

Summary

  • deriveTransactionType() (introduced in feat: port solana explain logic from wasm to sdk-coin-sol #8206) fell through to Send for any transaction that didn't match a known staking or ATA pattern. This misclassified custom transactions (e.g. boilerplate-only Memo+NonceAdvance txs) as Send.
  • Replaced the implicit Send fallback with an explicit check for Transfer/TokenTransfer instructions. Everything else defaults to CustomTx, matching the legacy getTransactionType() behavior.
  • Added unit test covering the boilerplate-only classification case.

Test plan

  • New unit test: boilerplate-only tx (NonceAdvance + Memo) classified as CustomTx
  • Full sdk-coin-sol test suite: 546 passing, 0 regressions

…sactions

deriveTransactionType previously fell through to Send for any transaction
that didn't match a known staking or ATA pattern. This misclassified
custom transactions (e.g. boilerplate-only Memo+NonceAdvance txs) as Send.

Explicitly check for Transfer/TokenTransfer instructions before returning
Send. Everything else falls through to CustomTx, matching the legacy
getTransactionType behavior.

BTC-3102
@lcovar lcovar requested a review from a team as a code owner March 3, 2026 00:00
@lcovar
Copy link
Contributor Author

lcovar commented Mar 3, 2026

existing tests cover sendtx, added a new tests specifically for custom tx via the wasm path

@lcovar lcovar merged commit b13c88f into master Mar 3, 2026
21 checks passed
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