Skip to content

Commit 8aa8aee

Browse files
authored
feat!: support for ICA queries (#118)
* feat: added 'ExecuteMsg::SendQueryMsgs' type * imp: scaffolded new module * deps: ran 'cargo update' * deps: bumped 'cosmos-sdk-proto' to 0.21 * refactor!: simplified code * deps: added prost * imp: added query message types * deps: added the query feature * imp: added 'query' feature-gating * imp: implemented bank and stargate queries * imp: added staking queries * style: ran 'cargo fmt' * imp: added distribution queries * imp: DistributionQueries updated to cosmwasm v1.4 * imp: added more boilerplate * refactor: imp organization * imp: added query response types * imp: updated proto type * imp: remove distribution queries * imp: made some enums non-exhaustive * imp: remove Dist Query response * imp: added bank response type * imp: staking query responses added * imp: started adding extra types for queries * added state entry for queries * imp: steps in the right direction * imp: reorganized query api * style: fixed clippy errors * style: fix clippy * imp: implemented from_cosmos_msg partially * imp: pushing more implementation forward * deps: export feature now uses query and staking * imp: added boilerplate for handling reply * deps: ran 'cargo add anybuf' * deps: made anybuf optional * deps: revert anybuf being optional * imp: added reply logic * deps: ran 'cargo update' * style: improved * imp: simplified feature gating * imp: improving relay.rs * imp: added helper methods to AcknowledgementData * imp: improved state * refactor: looks better * imp: added boilerplate code for response callback * imp: implemented results from response * deps: ran 'cargo update' * deps: ran 'cargo update' * imp: the callback counter now records the entire callback messages * deps: ran 'cargo update' * imp: the callback counter now records the entire callback messages * fix: clippy complaint * imp: ran go-codegen * fix: the new types * imp: ran go-codegen * imp: regenerated types using 'go-codegen' * fix: changes * imp: queries are ignored if they are empty * imp: started writing the test case * imp: regerated type with go-codegen * imp: removed the option wrapper around the queries * deps: ran 'cargo update' * imp: regenerated cwicacontroller types with go-codegen * deps: ran cargo update * fix: clippy complaint * imp: generated testing contracts' types * imp: added helpers to callbackcounter * imp: regenerated types with go-codegen * deps: ran cargo update * imp: regenerated types and allowed unknown fields * feat: test working * imp: improved test * imp: changed the name of the test * imp * docs: godocs * deps: ran 'cargo update' * lint: fixed linter complaints * imp(e2e): seq subtests * feat(e2e): bank icq test pass * refactor(e2e): created new icaicq_test.go file * imp(testing/contracts): allow staking queries * imp: regenerated messages * feat(e2e): started staking test * feat(e2e): staking tests done * feat(e2e): all query tests are added * ci: added build with query feature * style: lint * ci: bumped rust version * imp: added default serde tag to queries * deps: ran 'cargo add serde_with' * imp: allow messages and queries to be null * deps(testing/contracts): ran 'cargo update' * fix(e2e): switch equals to contains * docs: updated CHANGELOG.md * imp: added default serde to queries field * test(e2e): testing when messages field is null
1 parent a55d66d commit 8aa8aee

File tree

32 files changed

+3429
-663
lines changed

32 files changed

+3429
-663
lines changed

.github/workflows/e2e.yml

+2
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ jobs:
4848
- TestWithContractTestSuite/TestSendWasmMsgsProtobufEncoding
4949
- TestWithContractTestSuite/TestMigrateOrderedToUnordered
5050
- TestWithContractTestSuite/TestCloseChannel_Protobuf_Unordered
51+
- TestWithContractTestSuite/TestBankAndStargateQueries
52+
- TestWithContractTestSuite/TestStakingQueries
5153
name: ${{ matrix.test }}
5254
runs-on: ubuntu-latest
5355
steps:

.github/workflows/rust.yml

+33-5
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
uses: actions-rs/toolchain@v1
2222
with:
2323
profile: minimal
24-
toolchain: 1.73.0
24+
toolchain: 1.78.0
2525
target: wasm32-unknown-unknown
2626
override: true
2727

@@ -52,7 +52,7 @@ jobs:
5252
uses: actions-rs/toolchain@v1
5353
with:
5454
profile: minimal
55-
toolchain: 1.73.0
55+
toolchain: 1.78.0
5656
override: true
5757

5858
- name: Run unit tests
@@ -80,7 +80,7 @@ jobs:
8080
uses: actions-rs/toolchain@v1
8181
with:
8282
profile: minimal
83-
toolchain: 1.73.0
83+
toolchain: 1.78.0
8484
override: true
8585

8686
- name: Run unit tests
@@ -108,7 +108,7 @@ jobs:
108108
uses: actions-rs/toolchain@v1
109109
with:
110110
profile: minimal
111-
toolchain: 1.73.0
111+
toolchain: 1.78.0
112112
override: true
113113

114114
- name: Run unit tests
@@ -125,6 +125,34 @@ jobs:
125125
command: build
126126
args: --locked --features=staking
127127

128+
build-with-query:
129+
name: Build with Query Feature
130+
runs-on: ubuntu-latest
131+
steps:
132+
- name: Checkout sources
133+
uses: actions/checkout@v2
134+
135+
- name: Install stable toolchain
136+
uses: actions-rs/toolchain@v1
137+
with:
138+
profile: minimal
139+
toolchain: 1.78.0
140+
override: true
141+
142+
- name: Run unit tests
143+
uses: actions-rs/cargo@v1
144+
with:
145+
command: unit-test
146+
args: --locked --features=staking
147+
env:
148+
RUST_BACKTRACE: 1
149+
150+
- name: Build
151+
uses: actions-rs/cargo@v1
152+
with:
153+
command: build
154+
args: --locked --features=query
155+
128156
lints:
129157
name: Lint Contract
130158
runs-on: ubuntu-latest
@@ -136,7 +164,7 @@ jobs:
136164
uses: actions-rs/toolchain@v1
137165
with:
138166
profile: minimal
139-
toolchain: 1.73.0
167+
toolchain: 1.78.0
140168
override: true
141169
components: rustfmt, clippy
142170

CHANGELOG.md

+10-3
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,24 @@
22

33
## [Unreleased]
44

5-
### API Breaking Changes
5+
### Features
66

7-
- Improved the query helpers. (https://github.com/srdtrk/cw-ica-controller/pull/114)
8-
- Changed `call` to `execute` in `helpers.rs`. (https://github.com/srdtrk/cw-ica-controller/pull/114)
7+
- Added support for ICA queries. (https://github.com/srdtrk/cw-ica-controller/issues/88)
98

109
### API Breaking Changes
1110

11+
- Added a `query_result` field to `IcaControllerCallbackMsg`. (https://github.com/srdtrk/cw-ica-controller/pull/118)
12+
- Added a `queries` field to `ExecuteMsg::SendCosmosMsgs`. (https://github.com/srdtrk/cw-ica-controller/pull/118)
13+
- Improved the query helpers. (https://github.com/srdtrk/cw-ica-controller/pull/114)
14+
- Changed `call` to `execute` in `helpers.rs`. (https://github.com/srdtrk/cw-ica-controller/pull/114)
1215
- Removed support for `proto3json` encoding. (https://github.com/srdtrk/cw-ica-controller/pull/92)
1316
- Removed `tx_encoding` field from `ChannelOpenInitOptions`. (https://github.com/srdtrk/cw-ica-controller/pull/92)
1417
- Removed `ExecuteMsg::SendCustomIcaMessages`. (https://github.com/srdtrk/cw-ica-controller/pull/92)
1518

19+
### State Breaking Changes
20+
21+
- Removed support for CosmWasm (and wasmvm) version `v1.3`. (https://github.com/srdtrk/cw-ica-controller/pull/90)
22+
1623
## v0.5.0 (2024-02-05)
1724

1825
### Features

0 commit comments

Comments
 (0)