Skip to content

Commit 6bcfcb9

Browse files
authored
Merge pull request #7808 from BitGo/fguo/SC-4697
fix(sdk-coin-ton): set withdraw amount for ton whales unstake
2 parents 9984f25 + ad76de1 commit 6bcfcb9

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

modules/sdk-coin-ton/src/lib/tonWhalesWithdrawalBuilder.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export class TonWhalesWithdrawalBuilder extends TransactionBuilder {
2424
setWithdrawalMessage(unstakeAmount: string, queryId?: string): TonWhalesWithdrawalBuilder {
2525
const qId = queryId || '0000000000000000';
2626

27+
this.transaction.withdrawAmount = unstakeAmount;
2728
this.transaction.message = TON_WHALES_WITHDRAW_OPCODE + qId + unstakeAmount;
2829
return this;
2930
}

modules/sdk-coin-ton/test/unit/tonWhalesWithdrawalBuilder.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ describe('Ton Whales Withdrawal Builder', () => {
9999

100100
// Build Signed Transaction
101101
const signedBuiltTx = await builder.build();
102+
const jsonTx = signedBuiltTx.toJson();
103+
104+
// Verify that the builder correctly set the withdrawal amount on the transaction object
105+
should.equal(jsonTx.withdrawAmount, fixture.withdrawAmount);
102106

103107
// Byte-for-byte equality with the Sandbox output
104108
should.equal(signedBuiltTx.toBroadcastFormat(), fixture.tx);

0 commit comments

Comments
 (0)