Add filter message.module=bank just in case

This commit is contained in:
Simon Warta
2020-03-02 12:30:52 +01:00
parent dd8d630532
commit df6db45e36
+4 -2
View File
@@ -159,8 +159,10 @@ export class CosmWasmClient {
}
} else if (isSearchBySentFromOrToQuery(query)) {
// We cannot get both in one request (see https://github.com/cosmos/gaia/issues/75)
const sent = await this.txsQuery(withFilters(`message.sender=${query.sentFromOrTo}`));
const received = await this.txsQuery(withFilters(`transfer.recipient=${query.sentFromOrTo}`));
const sentQuery = withFilters(`message.module=bank&message.sender=${query.sentFromOrTo}`);
const receivedQuery = withFilters(`transfer.recipient=${query.sentFromOrTo}`);
const sent = await this.txsQuery(sentQuery);
const received = await this.txsQuery(receivedQuery);
const sentHashes = sent.map(t => t.txhash);
txs = [...sent, ...received.filter(t => !sentHashes.includes(t.txhash))];