Fix error message for unimplemented functionality

Closes #529
This commit is contained in:
Simon Warta 2020-11-17 11:42:37 +01:00
parent 705215f39b
commit ede62e4d75

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");
}