Skip to content

Commit

Permalink
chore: applied macros (#325)
Browse files Browse the repository at this point in the history
* fix: adopt macros

- #[cw_serde]
- #[derive(QueryResponses)]
- write_api!

* fix: adopt macros and as with the queue contract,
several structures were moved to msg.rs
  • Loading branch information
da1suk8 authored Aug 3, 2023
1 parent a7a9154 commit 124e376
Show file tree
Hide file tree
Showing 58 changed files with 1,363 additions and 1,193 deletions.
2 changes: 1 addition & 1 deletion contracts/call-number/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ overflow-checks = true
backtraces = ["cosmwasm-std/backtraces"]

[dependencies]
cosmwasm-schema = { path = "../../packages/schema" }
cosmwasm-std = { path = "../../packages/std", features = ["iterator"] }
cosmwasm-storage = { path = "../../packages/storage", features = ["iterator"] }
schemars = "0.8.1"
serde = { version = "1.0.125", default-features = false, features = ["derive"] }
thiserror = "1.0.24"

[dev-dependencies]
cosmwasm-schema = { path = "../../packages/schema" }
cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = ["iterator"] }
wasmer = { version = "2.3", default-features = false, features = ["cranelift", "universal", "singlepass"] }
18 changes: 6 additions & 12 deletions contracts/call-number/examples/schema.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
use std::env::current_dir;
use std::fs::create_dir_all;

use cosmwasm_schema::{export_schema, remove_schemas, schema_for};
use cosmwasm_schema::write_api;

use call_number::msg::{ExecuteMsg, InstantiateMsg, QueryMsg};

fn main() {
let mut out_dir = current_dir().unwrap();
out_dir.push("schema");
create_dir_all(&out_dir).unwrap();
remove_schemas(&out_dir).unwrap();

export_schema(&schema_for!(InstantiateMsg), &out_dir);
export_schema(&schema_for!(ExecuteMsg), &out_dir);
export_schema(&schema_for!(QueryMsg), &out_dir);
write_api! {
execute: ExecuteMsg,
instantiate: InstantiateMsg,
query: QueryMsg,
}
}
Loading

0 comments on commit 124e376

Please sign in to comment.