Skip to content

fix(binance): Remove token order types and associated tests#4746

Open
sergei-boiko-trustwallet wants to merge 3 commits intomasterfrom
fix/bnb-beacon-tx-type-confusion
Open

fix(binance): Remove token order types and associated tests#4746
sergei-boiko-trustwallet wants to merge 3 commits intomasterfrom
fix/bnb-beacon-tx-type-confusion

Conversation

@sergei-boiko-trustwallet
Copy link
Copy Markdown
Contributor

This pull request removes support for Binance token management orders (freeze, unfreeze, issue, mint, and burn) from the codebase. The changes clean up both the implementation and the related tests and protocol definitions, ensuring that these token order types are no longer handled anywhere in the project.

Breaking Changes

Removed TokenFreezeOrder, TokenUnfreezeOrder, TokenMintOrder, TokenBurnOrder BNB Beacon chain transaction types.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR removes Binance Beacon Chain token-management order support (freeze/unfreeze/issue/mint/burn) by deleting the Rust transaction message implementations and removing the associated Rust signing tests, and by dropping these order variants from the Binance SigningInput oneof.

Changes:

  • Removed token-management order variants from Binance.proto SigningInput.order_oneof.
  • Deleted the Rust token_order message module and removed corresponding enum variants/mapping.
  • Removed Rust tests that exercised signing of these token-management orders.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/proto/Binance.proto Removes token order variants from SigningInput.order_oneof to prevent these orders from being constructed via the main signing input.
rust/tw_tests/tests/chains/binance/binance_sign.rs Deletes signing tests for the removed token-management orders.
rust/chains/tw_binance/src/transaction/message/token_order.rs Removes the Rust message implementations for token freeze/unfreeze/issue/mint/burn.
rust/chains/tw_binance/src/transaction/message/mod.rs Removes the token_order module and enum conversions/variants for the deleted token orders.
Comments suppressed due to low confidence (1)

src/proto/Binance.proto:377

  • The removed order_oneof variants (field numbers 11, 12, 17, 18, 19 and their names) are now free to be reused unintentionally in future changes. In protobuf, it’s safer to explicitly reserved the removed field numbers/names in SigningInput to prevent accidental wire-compatibility issues if those tags are reused later.
    // Payload message
    oneof order_oneof {
        TradeOrder trade_order = 8;
        CancelTradeOrder cancel_trade_order = 9;
        SendOrder send_order = 10;
        HTLTOrder htlt_order = 13;
        DepositHTLTOrder depositHTLT_order = 14;
        ClaimHTLOrder claimHTLT_order = 15;
        RefundHTLTOrder refundHTLT_order = 16;
        TransferOut transfer_out_order = 20;
        SideChainDelegate side_delegate_order = 21;
        SideChainRedelegate side_redelegate_order = 22;
        SideChainUndelegate side_undelegate_order = 23;
        TimeLockOrder time_lock_order = 24;
        TimeRelockOrder time_relock_order = 25;
        TimeUnlockOrder time_unlock_order = 26;
        SideChainStakeMigration side_stake_migration_order = 27;

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/proto/Binance.proto
Comment thread src/proto/Binance.proto
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 24, 2026

Binary size comparison

➡️ aarch64-apple-ios:

- 14.36 MB
+ 14.30 MB 	 -70 KB

➡️ aarch64-apple-ios-sim:

- 14.37 MB
+ 14.30 MB 	 -70 KB

➡️ aarch64-linux-android:

- 18.81 MB
+ 18.71 MB 	 -103 KB

➡️ armv7-linux-androideabi:

- 16.23 MB
+ 16.15 MB 	 -85 KB

➡️ wasm32-unknown-emscripten:

- 13.72 MB
+ 13.64 MB 	 -82 KB

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