From 8fb1ae25a89511370f51ef62f3be4c7320c59fe2 Mon Sep 17 00:00:00 2001 From: Milan Steiner <69144826+msteiner96@users.noreply.github.com> Date: Tue, 15 Mar 2022 23:17:47 +0100 Subject: [PATCH] Add waiting time to timeout error message (#1087) * Add waiting time to timeout error message * Update cosmwasmclient.ts * Update stargateclient.ts Co-authored-by: Simon Warta --- CHANGELOG.md | 9 +++++++-- packages/cosmwasm-stargate/src/cosmwasmclient.ts | 4 +++- packages/stargate/src/stargateclient.ts | 4 +++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c50f4c09ba..ba8167b2bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,8 +44,12 @@ and this project adheres to dependencies. This should also reduce the bundle size as only the English wordlist is shipped. ([#966]) - @cosmjs/cli: Rename binary `cosmwasm-cli` to `cosmjs-cli` ([#1033]). -- @cosmjs/stargate & @cosmjs/cosmwasm-stargate: Removed default types from AminoTypes. ([#1079]) -- @cosmjs/cosmwasm-stargate: getCodes() automatically loops through all pagination pages now. ([#1077]) +- @cosmjs/stargate & @cosmjs/cosmwasm-stargate: Removed default types from + AminoTypes. ([#1079]) +- @cosmjs/cosmwasm-stargate: getCodes() automatically loops through all + pagination pages now. ([#1077]) +- @cosmjs/stargate & @cosmjs/cosmwasm-stargate: Timeout Errors shows more + relevant information about the timeout. ([#1066]) [#927]: https://github.com/cosmos/cosmjs/issues/927 [#955]: https://github.com/cosmos/cosmjs/issues/955 @@ -57,6 +61,7 @@ and this project adheres to [#1026]: https://github.com/cosmos/cosmjs/issues/1026 [#1033]: https://github.com/cosmos/cosmjs/issues/1033 [#1053]: https://github.com/cosmos/cosmjs/issues/1053 +[#1066]: https://github.com/cosmos/cosmjs/issues/1066 [#1077]: https://github.com/cosmos/cosmjs/issues/1077 [#1078]: https://github.com/cosmos/cosmjs/issues/1078 [#1079]: https://github.com/cosmos/cosmjs/issues/1079 diff --git a/packages/cosmwasm-stargate/src/cosmwasmclient.ts b/packages/cosmwasm-stargate/src/cosmwasmclient.ts index 4ef0bd34ab..e09c76e7fa 100644 --- a/packages/cosmwasm-stargate/src/cosmwasmclient.ts +++ b/packages/cosmwasm-stargate/src/cosmwasmclient.ts @@ -268,7 +268,9 @@ export class CosmWasmClient { const pollForTx = async (txId: string): Promise => { if (timedOut) { throw new TimeoutError( - `Transaction with ID ${txId} was submitted but was not yet found on the chain. You might want to check later.`, + `Transaction with ID ${txId} was submitted but was not yet found on the chain. You might want to check later. There was a wait of ${ + timeoutMs / 10000 + } seconds.`, txId, ); } diff --git a/packages/stargate/src/stargateclient.ts b/packages/stargate/src/stargateclient.ts index 07c465a4a5..997b0328a9 100644 --- a/packages/stargate/src/stargateclient.ts +++ b/packages/stargate/src/stargateclient.ts @@ -350,7 +350,9 @@ export class StargateClient { const pollForTx = async (txId: string): Promise => { if (timedOut) { throw new TimeoutError( - `Transaction with ID ${txId} was submitted but was not yet found on the chain. You might want to check later.`, + `Transaction with ID ${txId} was submitted but was not yet found on the chain. You might want to check later. There was a wait of ${ + timeoutMs / 10000 + } seconds.`, txId, ); }