diff --git a/CHANGELOG.md b/CHANGELOG.md index 98db48b1ae..aaea2c9980 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ and this project adheres to ## [Unreleased] +### Changed + +- @cosmjs/stargate, @cosmjs/cosmwasm-stargate: Add address to "Account does not + exist on chain." error message. + ## [0.29.0] - 2022-09-15 ### Added diff --git a/packages/cosmwasm-stargate/src/cosmwasmclient.spec.ts b/packages/cosmwasm-stargate/src/cosmwasmclient.spec.ts index 25fec47931..a01b9bd7ab 100644 --- a/packages/cosmwasm-stargate/src/cosmwasmclient.spec.ts +++ b/packages/cosmwasm-stargate/src/cosmwasmclient.spec.ts @@ -120,7 +120,7 @@ describe("CosmWasmClient", () => { const client = await CosmWasmClient.connect(wasmd.endpoint); const missing = makeRandomAddress(); await expectAsync(client.getSequence(missing)).toBeRejectedWithError( - /account does not exist on chain/i, + /account '([a-z0-9]{10,90})' does not exist on chain/i, ); }); }); diff --git a/packages/cosmwasm-stargate/src/cosmwasmclient.ts b/packages/cosmwasm-stargate/src/cosmwasmclient.ts index 41dd31fb00..113218b50f 100644 --- a/packages/cosmwasm-stargate/src/cosmwasmclient.ts +++ b/packages/cosmwasm-stargate/src/cosmwasmclient.ts @@ -166,7 +166,7 @@ export class CosmWasmClient { const account = await this.getAccount(address); if (!account) { throw new Error( - "Account does not exist on chain. Send some tokens there before trying to query sequence.", + `Account '${address}' does not exist on chain. Send some tokens there before trying to query sequence.`, ); } return { diff --git a/packages/stargate/src/stargateclient.spec.ts b/packages/stargate/src/stargateclient.spec.ts index 641a31e854..408539dc52 100644 --- a/packages/stargate/src/stargateclient.spec.ts +++ b/packages/stargate/src/stargateclient.spec.ts @@ -182,7 +182,7 @@ describe("StargateClient", () => { const client = await StargateClient.connect(simapp.tendermintUrl); await expectAsync(client.getSequence(nonExistentAddress)).toBeRejectedWithError( - /account does not exist on chain/i, + /account '([a-z0-9]{10,90})' does not exist on chain/i, ); client.disconnect(); diff --git a/packages/stargate/src/stargateclient.ts b/packages/stargate/src/stargateclient.ts index b41f5650bf..a4b05c0b9b 100644 --- a/packages/stargate/src/stargateclient.ts +++ b/packages/stargate/src/stargateclient.ts @@ -254,7 +254,7 @@ export class StargateClient { const account = await this.getAccount(address); if (!account) { throw new Error( - "Account does not exist on chain. Send some tokens there before trying to query sequence.", + `Account '${address}' does not exist on chain. Send some tokens there before trying to query sequence.`, ); } return {