Add address to "Account does not exist on chain." error message

This commit is contained in:
Simon Warta 2022-10-01 23:26:58 +02:00
parent 720d3b211e
commit 7fb06c808e
5 changed files with 9 additions and 4 deletions

View File

@ -6,6 +6,11 @@ and this project adheres to
## [Unreleased] ## [Unreleased]
### Changed
- @cosmjs/stargate, @cosmjs/cosmwasm-stargate: Add address to "Account does not
exist on chain." error message.
## [0.29.0] - 2022-09-15 ## [0.29.0] - 2022-09-15
### Added ### Added

View File

@ -120,7 +120,7 @@ describe("CosmWasmClient", () => {
const client = await CosmWasmClient.connect(wasmd.endpoint); const client = await CosmWasmClient.connect(wasmd.endpoint);
const missing = makeRandomAddress(); const missing = makeRandomAddress();
await expectAsync(client.getSequence(missing)).toBeRejectedWithError( 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,
); );
}); });
}); });

View File

@ -166,7 +166,7 @@ export class CosmWasmClient {
const account = await this.getAccount(address); const account = await this.getAccount(address);
if (!account) { if (!account) {
throw new Error( 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 { return {

View File

@ -182,7 +182,7 @@ describe("StargateClient", () => {
const client = await StargateClient.connect(simapp.tendermintUrl); const client = await StargateClient.connect(simapp.tendermintUrl);
await expectAsync(client.getSequence(nonExistentAddress)).toBeRejectedWithError( 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(); client.disconnect();

View File

@ -254,7 +254,7 @@ export class StargateClient {
const account = await this.getAccount(address); const account = await this.getAccount(address);
if (!account) { if (!account) {
throw new Error( 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 { return {