mirror of
https://github.com/cosmos/cosmjs.git
synced 2025-03-10 13:47:12 +00:00
feat(timeout-height): expectAsync fail test
This commit is contained in:
parent
5bdd1215f5
commit
af78d546ec
@ -1247,16 +1247,15 @@ describe("SigningCosmWasmClient", () => {
|
||||
const height = await client.getHeight();
|
||||
const signed = await client.sign(alice.address0, [msgAny], fee, memo, undefined, BigInt(height - 1));
|
||||
|
||||
try {
|
||||
await client.broadcastTx(Uint8Array.from(TxRaw.encode(signed).finish()));
|
||||
} catch (e: any) {
|
||||
assert(e.code === 30);
|
||||
return;
|
||||
} finally {
|
||||
client.disconnect();
|
||||
}
|
||||
await expectAsync(
|
||||
client.broadcastTx(Uint8Array.from(TxRaw.encode(signed).finish())),
|
||||
).toBeRejectedWith(
|
||||
jasmine.objectContaining({
|
||||
code: 30,
|
||||
}),
|
||||
);
|
||||
|
||||
throw new Error("tx should have failed because of past timeoutHeight");
|
||||
client.disconnect();
|
||||
});
|
||||
});
|
||||
|
||||
@ -1530,16 +1529,15 @@ describe("SigningCosmWasmClient", () => {
|
||||
const height = await client.getHeight();
|
||||
const signed = await client.sign(alice.address0, [msgAny], fee, memo, undefined, BigInt(height - 1));
|
||||
|
||||
try {
|
||||
await client.broadcastTx(Uint8Array.from(TxRaw.encode(signed).finish()));
|
||||
} catch (e: any) {
|
||||
assert(e.code === 30);
|
||||
return;
|
||||
} finally {
|
||||
client.disconnect();
|
||||
}
|
||||
await expectAsync(
|
||||
client.broadcastTx(Uint8Array.from(TxRaw.encode(signed).finish())),
|
||||
).toBeRejectedWith(
|
||||
jasmine.objectContaining({
|
||||
code: 30,
|
||||
}),
|
||||
);
|
||||
|
||||
throw new Error("tx should have failed because of past timeoutHeight");
|
||||
client.disconnect();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -969,16 +969,15 @@ describe("SigningStargateClient", () => {
|
||||
const height = await client.getHeight();
|
||||
const signed = await client.sign(faucet.address0, [msgAny], fee, memo, undefined, BigInt(height - 1));
|
||||
|
||||
try {
|
||||
await client.broadcastTx(Uint8Array.from(TxRaw.encode(signed).finish()));
|
||||
} catch (e: any) {
|
||||
assert(e.code === 30);
|
||||
return;
|
||||
} finally {
|
||||
client.disconnect();
|
||||
}
|
||||
await expectAsync(
|
||||
client.broadcastTx(Uint8Array.from(TxRaw.encode(signed).finish())),
|
||||
).toBeRejectedWith(
|
||||
jasmine.objectContaining({
|
||||
code: 30,
|
||||
}),
|
||||
);
|
||||
|
||||
throw new Error("tx should have failed because of past timeoutHeight");
|
||||
client.disconnect();
|
||||
});
|
||||
});
|
||||
|
||||
@ -1248,16 +1247,15 @@ describe("SigningStargateClient", () => {
|
||||
const height = await client.getHeight();
|
||||
const signed = await client.sign(faucet.address0, [msgAny], fee, memo, undefined, BigInt(height - 1));
|
||||
|
||||
try {
|
||||
await client.broadcastTx(Uint8Array.from(TxRaw.encode(signed).finish()));
|
||||
} catch (e: any) {
|
||||
assert(e.code === 30);
|
||||
return;
|
||||
} finally {
|
||||
client.disconnect();
|
||||
}
|
||||
await expectAsync(
|
||||
client.broadcastTx(Uint8Array.from(TxRaw.encode(signed).finish())),
|
||||
).toBeRejectedWith(
|
||||
jasmine.objectContaining({
|
||||
code: 30,
|
||||
}),
|
||||
);
|
||||
|
||||
throw new Error("tx should have failed because of past timeoutHeight");
|
||||
client.disconnect();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user