forked from CosmWasm/cw-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
9 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,26 @@ | ||
use schemars::JsonSchema; | ||
use serde::{Deserialize, Serialize}; | ||
use cosmwasm_schema::{cw_serde, QueryResponses}; | ||
|
||
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] | ||
#[cw_serde] | ||
pub struct InstantiateMsg { | ||
pub count: i32, | ||
} | ||
|
||
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] | ||
#[serde(rename_all = "snake_case")] | ||
#[cw_serde] | ||
pub enum ExecuteMsg { | ||
Increment {}, | ||
Reset { count: i32 }, | ||
} | ||
|
||
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] | ||
#[serde(rename_all = "snake_case")] | ||
#[cw_serde] | ||
#[derive(QueryResponses)] | ||
pub enum QueryMsg { | ||
// GetCount returns the current count as a json-encoded number | ||
#[returns(GetCountResponse)] | ||
GetCount {}, | ||
} | ||
|
||
// We define a custom struct for each query response | ||
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] | ||
#[cw_serde] | ||
pub struct GetCountResponse { | ||
pub count: i32, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters