mirror of
https://github.com/cosmos/cosmjs.git
synced 2025-03-10 21:49:15 +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 height = await client.getHeight();
|
||||||
const signed = await client.sign(alice.address0, [msgAny], fee, memo, undefined, BigInt(height - 1));
|
const signed = await client.sign(alice.address0, [msgAny], fee, memo, undefined, BigInt(height - 1));
|
||||||
|
|
||||||
try {
|
await expectAsync(
|
||||||
await client.broadcastTx(Uint8Array.from(TxRaw.encode(signed).finish()));
|
client.broadcastTx(Uint8Array.from(TxRaw.encode(signed).finish())),
|
||||||
} catch (e: any) {
|
).toBeRejectedWith(
|
||||||
assert(e.code === 30);
|
jasmine.objectContaining({
|
||||||
return;
|
code: 30,
|
||||||
} finally {
|
}),
|
||||||
client.disconnect();
|
);
|
||||||
}
|
|
||||||
|
|
||||||
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 height = await client.getHeight();
|
||||||
const signed = await client.sign(alice.address0, [msgAny], fee, memo, undefined, BigInt(height - 1));
|
const signed = await client.sign(alice.address0, [msgAny], fee, memo, undefined, BigInt(height - 1));
|
||||||
|
|
||||||
try {
|
await expectAsync(
|
||||||
await client.broadcastTx(Uint8Array.from(TxRaw.encode(signed).finish()));
|
client.broadcastTx(Uint8Array.from(TxRaw.encode(signed).finish())),
|
||||||
} catch (e: any) {
|
).toBeRejectedWith(
|
||||||
assert(e.code === 30);
|
jasmine.objectContaining({
|
||||||
return;
|
code: 30,
|
||||||
} finally {
|
}),
|
||||||
client.disconnect();
|
);
|
||||||
}
|
|
||||||
|
|
||||||
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 height = await client.getHeight();
|
||||||
const signed = await client.sign(faucet.address0, [msgAny], fee, memo, undefined, BigInt(height - 1));
|
const signed = await client.sign(faucet.address0, [msgAny], fee, memo, undefined, BigInt(height - 1));
|
||||||
|
|
||||||
try {
|
await expectAsync(
|
||||||
await client.broadcastTx(Uint8Array.from(TxRaw.encode(signed).finish()));
|
client.broadcastTx(Uint8Array.from(TxRaw.encode(signed).finish())),
|
||||||
} catch (e: any) {
|
).toBeRejectedWith(
|
||||||
assert(e.code === 30);
|
jasmine.objectContaining({
|
||||||
return;
|
code: 30,
|
||||||
} finally {
|
}),
|
||||||
client.disconnect();
|
);
|
||||||
}
|
|
||||||
|
|
||||||
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 height = await client.getHeight();
|
||||||
const signed = await client.sign(faucet.address0, [msgAny], fee, memo, undefined, BigInt(height - 1));
|
const signed = await client.sign(faucet.address0, [msgAny], fee, memo, undefined, BigInt(height - 1));
|
||||||
|
|
||||||
try {
|
await expectAsync(
|
||||||
await client.broadcastTx(Uint8Array.from(TxRaw.encode(signed).finish()));
|
client.broadcastTx(Uint8Array.from(TxRaw.encode(signed).finish())),
|
||||||
} catch (e: any) {
|
).toBeRejectedWith(
|
||||||
assert(e.code === 30);
|
jasmine.objectContaining({
|
||||||
return;
|
code: 30,
|
||||||
} finally {
|
}),
|
||||||
client.disconnect();
|
);
|
||||||
}
|
|
||||||
|
|
||||||
throw new Error("tx should have failed because of past timeoutHeight");
|
client.disconnect();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user