Skip to content

Commit

Permalink
Updated cosmjs packages to support tendermint 37.
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahSaso committed Nov 9, 2023
1 parent 77ad4f9 commit 144b2b1
Show file tree
Hide file tree
Showing 7 changed files with 185 additions and 154 deletions.
8 changes: 4 additions & 4 deletions apps/dapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
"ts:watch": "ts --watch"
},
"dependencies": {
"@cosmjs/cosmwasm-stargate": "^0.28.1",
"@cosmjs/encoding": "^0.28.1",
"@cosmjs/proto-signing": "^0.28.1",
"@cosmjs/stargate": "^0.28.1",
"@cosmjs/cosmwasm-stargate": "^0.31.3",
"@cosmjs/encoding": "^0.31.3",
"@cosmjs/proto-signing": "^0.31.3",
"@cosmjs/stargate": "^0.31.3",
"@dao-dao/icons": "*",
"@dao-dao/types": "^0.0.8",
"@dao-dao/ui": "*",
Expand Down
6 changes: 3 additions & 3 deletions apps/dapp/selectors/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ export const contractInstantiateTime = selectorFamily<Date | undefined, string>(
return undefined
}

const events = await client.searchTx({
tags: [{ key: 'instantiate._contract_address', value: address }],
})
const events = await client.searchTx([
{ key: 'instantiate._contract_address', value: address },
])
if (events.length == 0) {
// Failed to locate the instantiate transaction. This happens if the
// RPC node doesn't have historical data this far back.
Expand Down
24 changes: 10 additions & 14 deletions apps/dapp/selectors/proposals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,11 @@ export const proposalStartBlockSelector = selectorFamily<
return 0
}

const events = await client.searchTx({
tags: [
{ key: 'wasm._contract_address', value: contractAddress },
{ key: 'wasm.proposal_id', value: proposalId.toString() },
{ key: 'wasm.action', value: 'propose' },
],
})
const events = await client.searchTx([
{ key: 'wasm._contract_address', value: contractAddress },
{ key: 'wasm.proposal_id', value: proposalId.toString() },
{ key: 'wasm.action', value: 'propose' },
])

if (events.length != 1) {
return 0
Expand Down Expand Up @@ -172,13 +170,11 @@ export const proposalExecutionTXHashSelector = selectorFamily<
// No TX Hash if proposal not yet executed.
if (!client || proposal?.status !== 'executed') return null

const events = await client.searchTx({
tags: [
{ key: 'wasm._contract_address', value: contractAddress },
{ key: 'wasm.proposal_id', value: proposalId.toString() },
{ key: 'wasm.action', value: 'execute' },
],
})
const events = await client.searchTx([
{ key: 'wasm._contract_address', value: contractAddress },
{ key: 'wasm.proposal_id', value: proposalId.toString() },
{ key: 'wasm.action', value: 'execute' },
])

if (events.length > 1) {
console.error('More than one execution', events)
Expand Down
6 changes: 3 additions & 3 deletions apps/dapp/selectors/treasury.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ export const transactions = selectorFamily({
(address: string) =>
async ({ get }) => {
const client = get(cosmWasmClientSelector)
const response = (await client.searchTx({
sentFromOrTo: address,
})) as IndexedTx[]
const response = (await client.searchTx(
`message.module='bank' AND (transfer.sender='${address}' OR transfer.recipient='${address}')`
)) as IndexedTx[]
return response
},
})
Expand Down
8 changes: 4 additions & 4 deletions apps/sda/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
"ts:watch": "ts --watch"
},
"dependencies": {
"@cosmjs/cosmwasm-stargate": "^0.28.1",
"@cosmjs/encoding": "^0.28.1",
"@cosmjs/proto-signing": "^0.28.1",
"@cosmjs/stargate": "^0.28.1",
"@cosmjs/cosmwasm-stargate": "^0.31.3",
"@cosmjs/encoding": "^0.31.3",
"@cosmjs/proto-signing": "^0.31.3",
"@cosmjs/stargate": "^0.31.3",
"@dao-dao/icons": "*",
"@dao-dao/state": "*",
"@dao-dao/types": "^0.0.8",
Expand Down
12 changes: 5 additions & 7 deletions packages/state/recoil/selectors/proposal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,11 @@ export const proposalExecutionTXHashSelector = selectorFamily<
// No TX Hash if proposal not yet executed.
if (!client || proposal?.proposal.status !== Status.Executed) return

const events = await client.searchTx({
tags: [
{ key: 'wasm._contract_address', value: contractAddress },
{ key: 'wasm.proposal_id', value: proposalId.toString() },
{ key: 'wasm.action', value: 'execute' },
],
})
const events = await client.searchTx([
{ key: 'wasm._contract_address', value: contractAddress },
{ key: 'wasm.proposal_id', value: proposalId.toString() },
{ key: 'wasm.action', value: 'execute' },
])

if (events.length > 1) {
console.error('More than one execution', events)
Expand Down
Loading

0 comments on commit 144b2b1

Please sign in to comment.