Skip to content

Commit 9919b93

Browse files
authored
Merge pull request #7182 from BitGo/SC-3403
feat(sdk-core): skip type check for STX
2 parents c20fac1 + ea7bca6 commit 9919b93

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,10 @@ export class StakingWallet implements IStakingWallet {
184184
);
185185
}
186186

187+
private isStx() {
188+
return this.wallet.baseCoin.getFamily() === 'stx';
189+
}
190+
187191
private isTrxStaking(transaction: StakingTransaction) {
188192
return this.wallet.baseCoin.getFamily() === 'trx';
189193
}
@@ -448,7 +452,8 @@ export class StakingWallet implements IStakingWallet {
448452
if (
449453
buildParams?.type &&
450454
(explainedTransaction as any).type !== undefined &&
451-
TransactionType[buildParams.type] !== (explainedTransaction as any).type
455+
((this.isStx() && TransactionType.ContractCall !== (explainedTransaction as any).type) || // for STX the tx type should always ContractCall
456+
(!this.isStx() && TransactionType[buildParams.type] !== (explainedTransaction as any).type))
452457
) {
453458
mismatchErrors.push(
454459
`Transaction type mismatch. Expected: '${buildParams.type}', Got: '${(explainedTransaction as any).type}'`

0 commit comments

Comments
 (0)