Skip to content

Commit

Permalink
Merge pull request #146 from AbstractSDK/adair/fixSelfQuery
Browse files Browse the repository at this point in the history
Don't allow aggregated aggregated queries
  • Loading branch information
adairrr authored Nov 13, 2024
2 parents ceea356 + d37943d commit 2cc5ecb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/gentle-carpets-double.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@abstract-money/cosmwasm-utils": patch
---

Disallow aggregated aggregated queries
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
})
Expand Down Expand Up @@ -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,
<QueryMsg>{
Expand Down

0 comments on commit 2cc5ecb

Please sign in to comment.