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 <simon@warta.it>
This commit is contained in:
Milan Steiner 2022-03-15 23:17:47 +01:00 committed by GitHub
parent 2539a2da62
commit 8fb1ae25a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 4 deletions

View File

@ -44,8 +44,12 @@ and this project adheres to
dependencies. This should also reduce the bundle size as only the English dependencies. This should also reduce the bundle size as only the English
wordlist is shipped. ([#966]) wordlist is shipped. ([#966])
- @cosmjs/cli: Rename binary `cosmwasm-cli` to `cosmjs-cli` ([#1033]). - @cosmjs/cli: Rename binary `cosmwasm-cli` to `cosmjs-cli` ([#1033]).
- @cosmjs/stargate & @cosmjs/cosmwasm-stargate: Removed default types from AminoTypes. ([#1079]) - @cosmjs/stargate & @cosmjs/cosmwasm-stargate: Removed default types from
- @cosmjs/cosmwasm-stargate: getCodes() automatically loops through all pagination pages now. ([#1077]) 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 [#927]: https://github.com/cosmos/cosmjs/issues/927
[#955]: https://github.com/cosmos/cosmjs/issues/955 [#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 [#1026]: https://github.com/cosmos/cosmjs/issues/1026
[#1033]: https://github.com/cosmos/cosmjs/issues/1033 [#1033]: https://github.com/cosmos/cosmjs/issues/1033
[#1053]: https://github.com/cosmos/cosmjs/issues/1053 [#1053]: https://github.com/cosmos/cosmjs/issues/1053
[#1066]: https://github.com/cosmos/cosmjs/issues/1066
[#1077]: https://github.com/cosmos/cosmjs/issues/1077 [#1077]: https://github.com/cosmos/cosmjs/issues/1077
[#1078]: https://github.com/cosmos/cosmjs/issues/1078 [#1078]: https://github.com/cosmos/cosmjs/issues/1078
[#1079]: https://github.com/cosmos/cosmjs/issues/1079 [#1079]: https://github.com/cosmos/cosmjs/issues/1079

View File

@ -268,7 +268,9 @@ export class CosmWasmClient {
const pollForTx = async (txId: string): Promise<DeliverTxResponse> => { const pollForTx = async (txId: string): Promise<DeliverTxResponse> => {
if (timedOut) { if (timedOut) {
throw new TimeoutError( 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, txId,
); );
} }

View File

@ -350,7 +350,9 @@ export class StargateClient {
const pollForTx = async (txId: string): Promise<DeliverTxResponse> => { const pollForTx = async (txId: string): Promise<DeliverTxResponse> => {
if (timedOut) { if (timedOut) {
throw new TimeoutError( 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, txId,
); );
} }