Skip to content

Commit

Permalink
feat!: support for ICA queries (#118)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
srdtrk authored Jun 18, 2024
1 parent a55d66d commit 8aa8aee
Show file tree
Hide file tree
Showing 32 changed files with 3,429 additions and 663 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ jobs:
- TestWithContractTestSuite/TestSendWasmMsgsProtobufEncoding
- TestWithContractTestSuite/TestMigrateOrderedToUnordered
- TestWithContractTestSuite/TestCloseChannel_Protobuf_Unordered
- TestWithContractTestSuite/TestBankAndStargateQueries
- TestWithContractTestSuite/TestStakingQueries
name: ${{ matrix.test }}
runs-on: ubuntu-latest
steps:
Expand Down
38 changes: 33 additions & 5 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.73.0
toolchain: 1.78.0
target: wasm32-unknown-unknown
override: true

Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.73.0
toolchain: 1.78.0
override: true

- name: Run unit tests
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.73.0
toolchain: 1.78.0
override: true

- name: Run unit tests
Expand Down Expand Up @@ -108,7 +108,7 @@ jobs:
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.73.0
toolchain: 1.78.0
override: true

- name: Run unit tests
Expand All @@ -125,6 +125,34 @@ jobs:
command: build
args: --locked --features=staking

build-with-query:
name: Build with Query Feature
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.78.0
override: true

- name: Run unit tests
uses: actions-rs/cargo@v1
with:
command: unit-test
args: --locked --features=staking
env:
RUST_BACKTRACE: 1

- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --locked --features=query

lints:
name: Lint Contract
runs-on: ubuntu-latest
Expand All @@ -136,7 +164,7 @@ jobs:
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.73.0
toolchain: 1.78.0
override: true
components: rustfmt, clippy

Expand Down
13 changes: 10 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,24 @@

## [Unreleased]

### API Breaking Changes
### Features

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

### API Breaking Changes

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

### State Breaking Changes

- Removed support for CosmWasm (and wasmvm) version `v1.3`. (https://github.com/srdtrk/cw-ica-controller/pull/90)

## v0.5.0 (2024-02-05)

### Features
Expand Down
Loading

0 comments on commit 8aa8aee

Please sign in to comment.