Skip to content

Commit 6ef464e

Browse files
committed
stargate: check error.message string
1 parent 0e98fdc commit 6ef464e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/stargate/src/stargateclient.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,13 +465,13 @@ describe("StargateClient", () => {
465465
await client.broadcastTx(txRawBytes);
466466
assert(false, "Expected broadcastTx to throw");
467467
} catch (error: any) {
468-
expect(error).toMatch(
468+
assert(error instanceof BroadcastTxError);
469+
expect(error.message).toMatch(
469470
simapp47Enabled
470471
? /Broadcasting transaction failed with code 7/i
471472
: // New error code for SDK 0.50+
472473
/Broadcasting transaction failed with code 4/i,
473474
);
474-
assert(error instanceof BroadcastTxError);
475475
if (simapp50Enabled) {
476476
// New error code for SDK 0.50+
477477
expect(error.code).toEqual(4);

0 commit comments

Comments
 (0)