diff --git a/contracts/plus/swapmap/src/bin/schema.rs b/contracts/plus/swapmap/src/bin/schema.rs new file mode 100644 index 0000000..163e751 --- /dev/null +++ b/contracts/plus/swapmap/src/bin/schema.rs @@ -0,0 +1,12 @@ +use cosmwasm_schema::write_api; + +use swapmap::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg}; + +fn main() { + write_api! { + instantiate: InstantiateMsg, + execute: ExecuteMsg, + query: QueryMsg, + migrate: MigrateMsg + } +} diff --git a/contracts/plus/swapmap/src/msg.rs b/contracts/plus/swapmap/src/msg.rs index 5b64c01..5e08645 100755 --- a/contracts/plus/swapmap/src/msg.rs +++ b/contracts/plus/swapmap/src/msg.rs @@ -1,23 +1,22 @@ -use cosmwasm_std::{Binary, Addr}; -use schemars::JsonSchema; -use serde::{Deserialize, Serialize}; +use cosmwasm_schema::{cw_serde, QueryResponses}; +use cosmwasm_std::{Addr, Binary}; -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] +#[cw_serde] pub struct InstantiateMsg {} -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] +#[cw_serde] pub struct MigrateMsg {} -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] -#[serde(rename_all = "snake_case")] +#[cw_serde] pub enum ExecuteMsg { ChangeOwner { owner: Addr }, AddTx { hash: Binary, value: Binary }, Ping {}, } -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] -#[serde(rename_all = "snake_case")] +#[cw_serde] +#[derive(QueryResponses)] pub enum QueryMsg { + #[returns(Binary)] GetTx { hash: Binary }, }