-
Notifications
You must be signed in to change notification settings - Fork 372
/
Copy pathschema.rs
35 lines (31 loc) · 1.06 KB
/
schema.rs
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
use std::env::current_dir;
use std::fs::create_dir_all;
use cosmwasm_schema::{export_schema, export_schema_with_title, remove_schemas, schema_for};
use ibc_reflect::msg::{
AcknowledgementMsg, BalancesResponse, DispatchResponse, InstantiateMsg, PacketMsg, QueryMsg,
WhoAmIResponse,
};
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!(QueryMsg), &out_dir);
export_schema(&schema_for!(PacketMsg), &out_dir);
export_schema_with_title(
&schema_for!(AcknowledgementMsg<BalancesResponse>),
&out_dir,
"AcknowledgementMsgBalances",
);
export_schema_with_title(
&schema_for!(AcknowledgementMsg<DispatchResponse>),
&out_dir,
"AcknowledgementMsgDispatch",
);
export_schema_with_title(
&schema_for!(AcknowledgementMsg<WhoAmIResponse>),
&out_dir,
"AcknowledgementMsgWhoAmI",
);
}