Merge pull request #1277 from cosmos/address-in-error

Add address to "Account does not exist on chain." error message
This commit is contained in:
Simon Warta 2022-10-02 00:32:49 +02:00 committed by GitHub
commit d28302cf12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 4 deletions

View File

@ -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

View File

@ -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,
);
});
});

View File

@ -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 {

View File

@ -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();

View File

@ -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 {