Skip to content

fix(sdk-coin-sui): handle epoch round trip#8498

Merged
abhishekagrawal080 merged 1 commit intomasterfrom
CSHLD-601
Apr 14, 2026
Merged

fix(sdk-coin-sui): handle epoch round trip#8498
abhishekagrawal080 merged 1 commit intomasterfrom
CSHLD-601

Conversation

@abhishekagrawal080
Copy link
Copy Markdown
Contributor

TICKET: CSHLD-601

TransactionExpiration with an Epoch value could not round-trip through BCS serialization/deserialization.

When txBuilder.expiration({ Epoch: 324 }) was used and the transaction was built, the BCS bytes were correct. But factory.from(rawTx) (via TransactionDataBlock.fromBytes()) threw a StructError because the deserialized value was { Epoch: 324n } and validation expected object({ Epoch: integer() }).

Root cause:

sui-bcs.ts registers TransactionExpiration.Epoch as BCS.U64

@mysten/bcs deserializes U64 as BigInt at runtime

TransactionDataBlock.ts validated the deserialized value with object({ Epoch: integer() })

superstruct's integer() accepts JavaScript number but rejects BigInt

@abhishekagrawal080 abhishekagrawal080 requested a review from a team as a code owner April 13, 2026 22:16
@linear
Copy link
Copy Markdown

linear bot commented Apr 13, 2026

@abhishekagrawal080 abhishekagrawal080 merged commit 3a2e55b into master Apr 14, 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