Skip to content

Commit cc74214

Browse files
Merge pull request #5094 from BitGo/WIN-3772
fix: check if recipients is defined in verifyTransaction
2 parents b6b4b24 + 6022a62 commit cc74214

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

modules/sdk-coin-celo/src/celo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export class Celo extends AbstractEthLikeCoin {
3131

3232
async verifyTransaction(params: VerifyTransactionOptions): Promise<boolean> {
3333
const { txParams } = params;
34-
if (txParams?.recipients?.length !== 1) {
34+
if (Array.isArray(txParams.recipients) && txParams.recipients.length > 1) {
3535
throw new Error(`txParams should only have 1 recipient but ${txParams?.recipients?.length} found`);
3636
}
3737
return true;

modules/sdk-coin-dot/src/dot.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ export class Dot extends BaseCoin {
640640

641641
async verifyTransaction(params: VerifyTransactionOptions): Promise<boolean> {
642642
const { txParams } = params;
643-
if (txParams?.recipients?.length !== 1) {
643+
if (Array.isArray(txParams.recipients) && txParams.recipients.length > 1) {
644644
throw new Error(`txParams should only have 1 recipient but ${txParams?.recipients?.length} found`);
645645
}
646646
return true;

modules/sdk-coin-stx/src/stx.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export class Stx extends BaseCoin {
4747

4848
async verifyTransaction(params: VerifyTransactionOptions): Promise<boolean> {
4949
const { txParams } = params;
50-
if (txParams?.recipients?.length !== 1) {
50+
if (Array.isArray(txParams.recipients) && txParams.recipients.length > 1) {
5151
throw new Error(`txParams should only have 1 recipient but ${txParams?.recipients?.length} found`);
5252
}
5353
return true;

modules/sdk-coin-xtz/src/xtz.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export class Xtz extends BaseCoin {
105105

106106
async verifyTransaction(params: VerifyTransactionOptions): Promise<boolean> {
107107
const { txParams } = params;
108-
if (txParams?.recipients?.length !== 1) {
108+
if (Array.isArray(txParams.recipients) && txParams.recipients.length > 1) {
109109
throw new Error(`txParams should only have 1 recipient but ${txParams?.recipients?.length} found`);
110110
}
111111
return true;

0 commit comments

Comments
 (0)