Skip to content

Commit e0c4bcc

Browse files
refactor(wp): send many uniform error messages changes
Ticket: COIN-1957
1 parent 05244ac commit e0c4bcc

File tree

10 files changed

+10
-10
lines changed

10 files changed

+10
-10
lines changed

modules/abstract-eth/src/abstractEthLikeNewCoins.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2281,7 +2281,7 @@ export abstract class AbstractEthLikeNewCoins extends AbstractEthLikeCoin {
22812281
throw new Error(`tx cannot be both a batch and hop transaction`);
22822282
}
22832283
if (txPrebuild.recipients.length !== 1) {
2284-
throw new Error(`txPrebuild should only have 1 recipient but ${txPrebuild.recipients.length} found`);
2284+
throw new Error(`Cannot send to more than 1 destination address`);
22852285
}
22862286
if (txParams.hop && txPrebuild.hopTransaction) {
22872287
// Check recipient amount for hop transaction

modules/abstract-eth/test/unit/coin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ export function runTransactionVerificationTests(coinName: string, bitgo: TestBit
348348

349349
await basecoin
350350
.verifyTransaction({ txParams, txPrebuild, wallet, verification })
351-
.should.be.rejectedWith('txPrebuild should only have 1 recipient but 2 found');
351+
.should.be.rejectedWith('Cannot send to more than 1 destination address');
352352
});
353353

354354
it('should reject a hop txPrebuild that does not send to its hop address', async () => {

modules/sdk-coin-arbeth/test/unit/arbeth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ describe('Arbitrum', function () {
402402

403403
await basecoin
404404
.verifyTransaction({ txParams, txPrebuild, wallet, verification })
405-
.should.be.rejectedWith('txPrebuild should only have 1 recipient but 2 found');
405+
.should.be.rejectedWith('Cannot send to more than 1 destination address');
406406
});
407407

408408
it('should reject a hop txPrebuild that does not send to its hop address', async function () {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ export class AvaxC extends AbstractEthLikeNewCoins {
171171
throw new Error(`tx cannot be both a batch and hop transaction`);
172172
}
173173
if (txPrebuild.recipients.length !== 1) {
174-
throw new Error(`txPrebuild should only have 1 recipient but ${txPrebuild.recipients.length} found`);
174+
throw new Error(`Cannot send to more than 1 destination address`);
175175
}
176176
if (txParams.hop && txPrebuild.hopTransaction) {
177177
// Check recipient amount for hop transaction

modules/sdk-coin-avaxc/test/unit/avaxc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ describe('Avalanche C-Chain', function () {
610610

611611
await tavaxCoin
612612
.verifyTransaction({ txParams, txPrebuild, wallet, verification })
613-
.should.be.rejectedWith('txPrebuild should only have 1 recipient but 2 found');
613+
.should.be.rejectedWith('Cannot send to more than 1 destination address');
614614
});
615615

616616
it('should reject a hop txPrebuild that does not send to its hop address', async function () {

modules/sdk-coin-bera/test/unit/bera.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ describe('Bera', function () {
302302

303303
await basecoin
304304
.verifyTransaction({ txParams, txPrebuild, wallet, verification })
305-
.should.be.rejectedWith('txPrebuild should only have 1 recipient but 2 found');
305+
.should.be.rejectedWith('Cannot send to more than 1 destination address');
306306
});
307307

308308
it('should reject a normal txPrebuild from the bitgo server with the wrong amount', async function () {

modules/sdk-coin-eth/test/unit/eth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ describe('ETH:', function () {
411411

412412
await coin
413413
.verifyTransaction({ txParams, txPrebuild: txPrebuild as any, wallet, verification })
414-
.should.be.rejectedWith('txPrebuild should only have 1 recipient but 2 found');
414+
.should.be.rejectedWith('Cannot send to more than 1 destination address');
415415
});
416416

417417
it('should reject a hop txPrebuild that does not send to its hop address', async function () {

modules/sdk-coin-opeth/test/unit/opeth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ describe('Optimism', function () {
398398

399399
await basecoin
400400
.verifyTransaction({ txParams, txPrebuild, wallet, verification })
401-
.should.be.rejectedWith('txPrebuild should only have 1 recipient but 2 found');
401+
.should.be.rejectedWith('Cannot send to more than 1 destination address');
402402
});
403403

404404
it('should reject a hop txPrebuild that does not send to its hop address', async function () {

modules/sdk-coin-polygon/test/unit/polygon.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ describe('Polygon', function () {
387387

388388
await basecoin
389389
.verifyTransaction({ txParams, txPrebuild, wallet, verification })
390-
.should.be.rejectedWith('txPrebuild should only have 1 recipient but 2 found');
390+
.should.be.rejectedWith('Cannot send to more than 1 destination address');
391391
});
392392

393393
it('should reject a hop txPrebuild that does not send to its hop address', async function () {

modules/sdk-coin-zketh/test/unit/zketh.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ describe('zkSync', function () {
400400

401401
await basecoin
402402
.verifyTransaction({ txParams, txPrebuild, wallet, verification })
403-
.should.be.rejectedWith('txPrebuild should only have 1 recipient but 2 found');
403+
.should.be.rejectedWith('Cannot send to more than 1 destination address');
404404
});
405405

406406
it('should reject a hop txPrebuild that does not send to its hop address', async function () {

0 commit comments

Comments
 (0)