|
| 1 | +// Copyright 2022 Neutron |
| 2 | +// |
| 3 | +// Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +// you may not use this file except in compliance with the License. |
| 5 | +// You may obtain a copy of the License at |
| 6 | +// |
| 7 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +// |
| 9 | +// Unless required by applicable law or agreed to in writing, software |
| 10 | +// distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +// See the License for the specific language governing permissions and |
| 13 | +// limitations under the License. |
| 14 | + |
| 15 | +use coinfactory::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg}; |
| 16 | +use cosmwasm_schema::{export_schema, remove_schemas, schema_for}; |
| 17 | +use std::{env::current_dir, fs::create_dir_all}; |
| 18 | + |
| 19 | +fn main() { |
| 20 | + let mut out_dir = current_dir().unwrap(); |
| 21 | + out_dir.push("schema"); |
| 22 | + create_dir_all(&out_dir).unwrap(); |
| 23 | + remove_schemas(&out_dir).unwrap(); |
| 24 | + |
| 25 | + export_schema(&schema_for!(InstantiateMsg), &out_dir); |
| 26 | + export_schema(&schema_for!(ExecuteMsg), &out_dir); |
| 27 | + export_schema(&schema_for!(QueryMsg), &out_dir); |
| 28 | + export_schema(&schema_for!(MigrateMsg), &out_dir); |
| 29 | +} |
0 commit comments