1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
use cosmwasm_schema::{cw_serde, QueryResponses};
use cosmwasm_std::{Binary, Uint64};

#[cw_serde]
pub struct InstantiateMsg {
    /// Code ID to use for instantiating proxy contracts.
    pub proxy_code_id: Uint64,
    /// The max gas allowed in a single block.
    pub block_max_gas: Uint64,
}

#[cw_serde]
#[derive(cw_orch::ExecuteFns)] // cw-orch automatic
pub enum ExecuteMsg {
    /// Receives and handles an incoming packet.
    Rx {
        /// The local connection id the packet arrived on.
        connection_id: String,
        /// The port of the counterparty module.
        counterparty_port: String,
        /// The packet data.
        data: Binary,
    },
}

#[cw_serde]
#[derive(QueryResponses, cw_orch::QueryFns)] // cw-orch automatic
pub enum QueryMsg {
    /// Queries the configured block max gas. Serialized as
    /// `"block_max_gas"`.
    #[returns(Uint64)]
    BlockMaxGas,
    /// Queries the configured proxy code ID. Serialized as
    /// `"proxy_code_id"`.
    #[returns(Uint64)]
    ProxyCodeId,
}

#[cw_serde]
pub enum MigrateMsg {
    /// Updates the module's configuration.
    WithUpdate {
        /// Code ID to use for instantiating proxy contracts.
        proxy_code_id: Uint64,
        /// The max gas allowed in a single block.
        block_max_gas: Uint64,
    },
}