From 007b4dd3621e52dc4894657d70269f14e28410f6 Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Wed, 12 Feb 2020 12:07:27 +0100 Subject: [PATCH] Add comment on multi request implementation --- packages/sdk/src/cosmwasmclient.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/sdk/src/cosmwasmclient.ts b/packages/sdk/src/cosmwasmclient.ts index 450c090d..130f8949 100644 --- a/packages/sdk/src/cosmwasmclient.ts +++ b/packages/sdk/src/cosmwasmclient.ts @@ -168,9 +168,10 @@ export class CosmWasmClient { } else if (isSearchByHeightQuery(query)) { return (await this.restClient.txs(`tx.height=${query.height}`)).txs; } else if (isSearchBySentFromOrToQuery(query)) { + // We cannot get both in one request (see https://github.com/cosmos/gaia/issues/75) const sent = (await this.restClient.txs(limited(`message.sender=${query.sentFromOrTo}`))).txs; - const sentHashes = sent.map(t => t.txhash); const received = (await this.restClient.txs(limited(`transfer.recipient=${query.sentFromOrTo}`))).txs; + const sentHashes = sent.map(t => t.txhash); return [...sent, ...received.filter(t => !sentHashes.includes(t.txhash))]; } else { throw new Error("Unknown query type");