From d37943d4fa3cfc12ab040c6958f43176409db7ec Mon Sep 17 00:00:00 2001 From: adairrr <32375605+adairrr@users.noreply.github.com> Date: Wed, 13 Nov 2024 09:46:38 -0500 Subject: [PATCH] Don't allow aggregated aggregated queries --- .changeset/gentle-carpets-double.md | 5 +++++ .../cosmwasm-utils/src/client/MultiqueryCosmWasmClient.ts | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 .changeset/gentle-carpets-double.md diff --git a/.changeset/gentle-carpets-double.md b/.changeset/gentle-carpets-double.md new file mode 100644 index 00000000..4ddf10f0 --- /dev/null +++ b/.changeset/gentle-carpets-double.md @@ -0,0 +1,5 @@ +--- +"@abstract-money/cosmwasm-utils": patch +--- + +Disallow aggregated aggregated queries diff --git a/packages/cosmwasm-utils/src/client/MultiqueryCosmWasmClient.ts b/packages/cosmwasm-utils/src/client/MultiqueryCosmWasmClient.ts index 09000167..f86b9fd0 100644 --- a/packages/cosmwasm-utils/src/client/MultiqueryCosmWasmClient.ts +++ b/packages/cosmwasm-utils/src/client/MultiqueryCosmWasmClient.ts @@ -119,7 +119,10 @@ export class MultiqueryCosmWasmClient extends CosmWasmClient { return new Promise((resolve, reject) => { this.queryQueue.push({ address, queryMsg, resolve, reject }) - if (this.queryQueue.length >= this.batchSizeLimit) { + if ( + this.queryQueue.length >= this.batchSizeLimit || + address === this.multiqueryContractAddress + ) { this.processQueryQueue() } }) @@ -150,6 +153,9 @@ export class MultiqueryCosmWasmClient extends CosmWasmClient { data: jsonToBinary(queryMsg), })) + console.log('calls length', calls.length) + console.log('calls', calls) + const result = (await super.queryContractSmart( this.multiqueryContractAddress, {