Crates.io | cw-ica-controller-derive |
lib.rs | cw-ica-controller-derive |
version | 0.4.2 |
source | src |
created_at | 2024-01-27 12:31:26.23058 |
updated_at | 2024-01-28 11:22:09.426821 |
description | This crate contains macros for deriving cw-ica-controller interfaces. |
homepage | |
repository | https://github.com/srdtrk/cw-ica-controller |
max_upload_size | |
id | 1116698 |
size | 17,331 |
cw-ica-controller-derive
- ICA Controller DeriveThis crate provides a derive macro for contracts receiving ICA controller callback messages.
This crate's macros are not intended to be used directly, but rather as a dependency of the
cw-ica-controller
crate where it is re-exported under the cw_ica_controller::helpers
.
This allows the users of the cw-ica-controller
crate to easily merge the required callback
message enum variant into their ExecuteMsg
enum.
I will show the usage of this crate (from the cw-ica-controller
crate) in
testing/contracts/callback-counter/src/msg.rs
.
use cosmwasm_schema::{cw_serde, QueryResponses};
use cw_ica_controller::helpers::ica_callback_execute;
#[cw_serde]
pub struct InstantiateMsg {}
#[ica_callback_execute]
#[cw_serde]
pub enum ExecuteMsg {}
#[cw_serde]
#[derive(QueryResponses)]
pub enum QueryMsg {
/// GetCallbackCounter returns the callback counter.
#[returns(crate::state::CallbackCounter)]
GetCallbackCounter {},
}