Skip to content

fix(sdk-coin-sui): keep token coin type on addr-balance rebuild#9191

Merged
abhishekagrawal080 merged 1 commit into
masterfrom
CSHLD-1146
Jul 7, 2026
Merged

fix(sdk-coin-sui): keep token coin type on addr-balance rebuild#9191
abhishekagrawal080 merged 1 commit into
masterfrom
CSHLD-1146

Conversation

@abhishekagrawal080

Copy link
Copy Markdown
Contributor

TICKET: CSHLD-1146

Token transfers funded from the Sui address balance embed the coin type in the redeem_funds MoveCall type argument and the BalanceWithdrawal input. When such a transaction is deserialized and rebuilt to attach a signature before broadcast, buildSuiTransaction re-derived the coin type from the coin config. If the builder was constructed with the parent chain config (e.g. tsui) rather than the token config (tsui:deep), packageId/module/symbol are undefined and the coin type became "undefined::undefined::undefined". The rebuilt bytes then differed from the signed payload, so the Sui node rejected the transaction with "Invalid user signature: Fail to verify user sig". Recover the coin type from the deserialized BalanceWithdrawal TypeTag in initBuilder and prefer it over the config-derived value, so a rebuild produces
byte-identical output regardless of which config the builder was created with.

@abhishekagrawal080 abhishekagrawal080 requested a review from a team as a code owner July 7, 2026 08:38
@linear-code

linear-code Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

CSHLD-1146

@Ranjna-G Ranjna-G left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

@abhishekagrawal080 abhishekagrawal080 merged commit a7e3278 into master Jul 7, 2026
45 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.

3 participants