Skip to content

Commit 85dd4d0

Browse files
committed
feat(sdk-core): add missing types for staking validation
used during hot wallet signing TICKET: SC-3303
1 parent 30dbf98 commit 85dd4d0

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

modules/bitgo/test/v2/unit/staking/stakingWalletNonTSS.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ describe('non-TSS Staking Wallet', function () {
117117
spendableBalance: 0,
118118
spendableBalanceString: '',
119119
id: 'tavaxpStakingWalletId',
120-
coin: 'topeth:wct',
120+
coin: 'tavaxp',
121121
enterprise: enterprise.id,
122122
};
123123

modules/sdk-core/src/account-lib/baseCoin/enum.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,24 @@ export enum TransactionType {
8787
FlushERC721,
8888
// Flush ERC1155 tokens from a forwarder address to base address
8989
FlushERC1155,
90+
91+
// trx
92+
FREEZE,
93+
VOTE,
94+
UNFREEZE,
95+
WITHDRAW_EXPIRE_UNFREEZE,
96+
CLAIM_REWARDS,
97+
98+
// cspr and stx
99+
stakingLock,
100+
// stx
101+
'self-stack',
102+
103+
// btc,
104+
staking,
105+
106+
// cspr
107+
stakingUnlock,
90108
}
91109

92110
/**

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,11 @@ export class StakingWallet implements IStakingWallet {
443443
);
444444
}
445445

446-
if (buildParams?.type && TransactionType[buildParams.type] !== (explainedTransaction as any).type) {
446+
if (
447+
buildParams?.type &&
448+
(explainedTransaction as any).type !== undefined &&
449+
TransactionType[buildParams.type] !== (explainedTransaction as any).type
450+
) {
447451
mismatchErrors.push(
448452
`Transaction type mismatch. Expected: '${buildParams.type}', Got: '${(explainedTransaction as any).type}'`
449453
);

0 commit comments

Comments
 (0)