Skip to content

Commit

Permalink
Fix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
anilcse committed Nov 9, 2024
1 parent 2ce6dfa commit 332dcc1
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
22 changes: 16 additions & 6 deletions src/bin/schema.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
use cosmwasm_schema::write_api;
use std::env::current_dir;
use std::fs::create_dir_all;

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

use cw_otc_dex::msg::{ExecuteMsg, InstantiateMsg, QueryMsg};
use cw_otc_dex::state::{Bid, Config, Deal};

fn main() {
write_api! {
instantiate: InstantiateMsg,
execute: ExecuteMsg,
query: QueryMsg,
}
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);
export_schema(&schema_for!(Config), &out_dir);
export_schema(&schema_for!(Deal), &out_dir);
export_schema(&schema_for!(Bid), &out_dir);
}
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ pub mod helpers;
pub mod msg;
pub mod state;

pub use crate::error::ContractError;
#[cfg(test)]
pub mod tests;
4 changes: 2 additions & 2 deletions src/msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ pub enum ExecuteMsg {
}

/// Messages for querying contract state
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema, QueryResponses)]
#[serde(rename_all = "snake_case")]
#[cw_serde]
#[derive(QueryResponses)]
pub enum QueryMsg {
/// Get a specific deal by ID
#[returns(DealResponse)]
Expand Down

0 comments on commit 332dcc1

Please sign in to comment.