Skip to content

Commit 3ad1b47

Browse files
committed
feat(sdk-core): skip type check for STX
the staking tx type will always be contract call type but the one in the staking params is staking lock so the checks will fail need to skip this part SC-3403 TICKET: SC-3403
1 parent fa707e6 commit 3ad1b47

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

modules/sdk-core/src/bitgo/staking/stakingWallet.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,11 @@ export class StakingWallet implements IStakingWallet {
184184
);
185185
}
186186

187-
private isTrxStaking(transaction: StakingTransaction) {
187+
private isStx() {
188+
return this.wallet.baseCoin.getFamily() === 'stx';
189+
}
190+
191+
private isTrxStaking() {
188192
return this.wallet.baseCoin.getFamily() === 'trx';
189193
}
190194

@@ -288,7 +292,7 @@ export class StakingWallet implements IStakingWallet {
288292
const skipVerification =
289293
(signOptions.transactionVerificationOptions?.skipTransactionVerification ||
290294
this.isBtcUndelegate(transaction) ||
291-
this.isTrxStaking(transaction)) ??
295+
this.isTrxStaking()) ??
292296
false;
293297
if (!isStakingTxRequestPrebuildResult(builtTx.result) && !skipVerification) {
294298
await this.validateBuiltStakingTransaction(builtTx.transaction, builtTx);
@@ -446,6 +450,7 @@ export class StakingWallet implements IStakingWallet {
446450
}
447451

448452
if (
453+
!this.isStx() && // should skip the type check for STX because it is always ContractCall type
449454
buildParams?.type &&
450455
(explainedTransaction as any).type !== undefined &&
451456
TransactionType[buildParams.type] !== (explainedTransaction as any).type

0 commit comments

Comments
 (0)