Merge pull request #534 from cosmos/search-tx-cases

Fix error message for unimplemented functionality
This commit is contained in:
mergify[bot] 2020-11-17 11:00:44 +00:00 committed by GitHub
commit b8e50ed327
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,6 +5,8 @@ import {
Coin,
isSearchByHeightQuery,
isSearchByIdQuery,
isSearchBySentFromOrToQuery,
isSearchByTagsQuery,
PubKey,
SearchTxFilter,
SearchTxQuery,
@ -209,6 +211,14 @@ export class StargateClient {
query.height >= minHeight && query.height <= maxHeight
? await this.txsQuery(`tx.height=${query.height}`)
: [];
} else if (isSearchBySentFromOrToQuery(query)) {
throw new Error(
"This type of search query is not yet implemented. See https://github.com/cosmos/cosmjs/issues/533.",
);
} else if (isSearchByTagsQuery(query)) {
throw new Error(
"This type of search query is not yet implemented. See https://github.com/cosmos/cosmjs/issues/532.",
);
} else {
throw new Error("Unknown query type");
}