From df6db45e36a8c40dafc2d5edb23a32bbdcfd01ac Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Mon, 2 Mar 2020 09:43:08 +0100 Subject: [PATCH] Add filter message.module=bank just in case --- packages/sdk/src/cosmwasmclient.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/sdk/src/cosmwasmclient.ts b/packages/sdk/src/cosmwasmclient.ts index 0ea8ef77..4bb27361 100644 --- a/packages/sdk/src/cosmwasmclient.ts +++ b/packages/sdk/src/cosmwasmclient.ts @@ -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))];