-
Notifications
You must be signed in to change notification settings - Fork 369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new entrypoint for IBCv2 Timeout #2435
base: main
Are you sure you want to change the base?
Conversation
Fixes CosmWasm#2422 Add new entry point for IBCv2 Timeout in `contracts/ibc2/src/contract.rs`. * **State Struct** - Add `ibc2_timeout_counter` field to `State` struct. * **QueryMsg Enum** - Add `QueryTimeoutCounter` message to retrieve the timeout counter. * **Query Function** - Update `query` function to handle `QueryTimeoutCounter` message. * **ibc2_timeout Function** - Add `ibc2_timeout` entry point function to handle IBCv2 timeouts. - Increment `ibc2_timeout_counter` in `State` struct within `ibc2_timeout`. * **Tests** - Add test for `ibc2_timeout` entry point function. - Verify `ibc2_timeout_counter` increments correctly. - Add test for `QueryTimeoutCounter` message. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/CosmWasm/cosmwasm/issues/2422?shareId=XXXX-XXXX-XXXX-XXXX).
* Verify `ibc2_timeout_counter` increments correctly * Add test for `QueryTimeoutCounter` message
* Add `do_ibc2_timeout` to imports in `contracts/ibc2/src/contract.rs` * Add `Empty` to imports in `contracts/ibc2/tests/integration.rs`
* Increment `ibc2_timeout_counter` in `State` struct within `ibc2_timeout` * Update `State` struct to include `ibc2_timeout_counter` field * Add `QueryTimeoutCounter` message to retrieve the timeout counter * Update `query` function to handle `QueryTimeoutCounter` message * Import `do_ibc2_timeout` function from `cosmwasm_std`
* Add `ibc2_timeout` entry point function to handle IBCv2 timeouts in `contracts/ibc2/src/contract.rs` * Add tests for `ibc2_timeout` entry point in `contracts/ibc2/tests/integration.rs` - Verify `ibc2_timeout_counter` increments correctly * Add `QueryTimeoutCounter` message to retrieve timeout counter in `contracts/ibc2/schema/raw/query.json`
…ct.rs` * Add `ibc2_timeout` entry point function to handle IBCv2 timeouts * Update imports to include necessary dependencies for `ibc2_timeout` function
* Import `do_ibc2_timeout` function from `cosmwasm_std` to handle IBCv2 timeouts
* Replace `do_ibc2_timeout` with `ibc2_timeout` in the import list * Update import list to include `ibc2_timeout` instead of `do_ibc2_timeout`
* Add `ibc2_timeout` entry point function to handle IBCv2 timeouts * Increment `ibc2_timeout_counter` in the `State` struct * Update `State` struct to include `ibc2_timeout_counter` * Fix error in `from_json` function call * Update import statements to include necessary dependencies
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice start, but you are missing the actual implementation of the entrypoint in the VM
pub fn ibc2_timeout( | ||
deps: DepsMut, | ||
_env: Env, | ||
_msg: Ibc2PacketReceiveMsg, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs its own type.
#[returns(u32)] | ||
QueryTimeoutCounter {}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There isn't really a need for this query, since the QueryState
already contains the timeout counter.
Fixes #2422
Add new entry point for IBCv2 Timeout in
contracts/ibc2/src/contract.rs
.ibc2_timeout_counter
field toState
struct.QueryTimeoutCounter
message to retrieve the timeout counter.query
function to handleQueryTimeoutCounter
message.ibc2_timeout
entry point function to handle IBCv2 timeouts.ibc2_timeout_counter
inState
struct withinibc2_timeout
.ibc2_timeout
entry point function.ibc2_timeout_counter
increments correctly.QueryTimeoutCounter
message.For more details, open the Copilot Workspace session.