Skip to content

Commit

Permalink
Merge pull request #293 from CosmWasm/expose-contract-errs
Browse files Browse the repository at this point in the history
Expose contract components
  • Loading branch information
ethanfrey authored May 19, 2021
2 parents d6fd4f8 + 082e7ac commit 0daeb17
Show file tree
Hide file tree
Showing 13 changed files with 45 additions and 17 deletions.
2 changes: 2 additions & 0 deletions contracts/cw1-subkeys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ pub mod contract;
mod error;
pub mod msg;
pub mod state;

pub use crate::error::ContractError;
30 changes: 18 additions & 12 deletions contracts/cw1155-base/examples/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,28 @@ use std::fs::create_dir_all;

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

use cw1155::{
ApprovedForAllResponse, BalanceResponse, BatchBalanceResponse, Cw1155BatchReceiveMsg,
Cw1155ExecuteMsg, Cw1155QueryMsg, Cw1155ReceiveMsg, IsApprovedForAllResponse,
TokenInfoResponse, TokensResponse,
};
use cw1155_base::msg::InstantiateMsg;

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!(cw1155_base::InstantiateMsg), &out_dir);

export_schema(&schema_for!(cw1155::Cw1155ExecuteMsg), &out_dir);
export_schema(&schema_for!(cw1155::Cw1155QueryMsg), &out_dir);
export_schema(&schema_for!(cw1155::Cw1155ReceiveMsg), &out_dir);
export_schema(&schema_for!(cw1155::Cw1155BatchReceiveMsg), &out_dir);
export_schema(&schema_for!(cw1155::BalanceResponse), &out_dir);
export_schema(&schema_for!(cw1155::BatchBalanceResponse), &out_dir);
export_schema(&schema_for!(cw1155::ApprovedForAllResponse), &out_dir);
export_schema(&schema_for!(cw1155::IsApprovedForAllResponse), &out_dir);
export_schema(&schema_for!(cw1155::TokenInfoResponse), &out_dir);
export_schema(&schema_for!(cw1155::TokensResponse), &out_dir);
export_schema(&schema_for!(InstantiateMsg), &out_dir);
export_schema(&schema_for!(Cw1155ExecuteMsg), &out_dir);
export_schema(&schema_for!(Cw1155QueryMsg), &out_dir);
export_schema(&schema_for!(Cw1155ReceiveMsg), &out_dir);
export_schema(&schema_for!(Cw1155BatchReceiveMsg), &out_dir);
export_schema(&schema_for!(BalanceResponse), &out_dir);
export_schema(&schema_for!(BatchBalanceResponse), &out_dir);
export_schema(&schema_for!(ApprovedForAllResponse), &out_dir);
export_schema(&schema_for!(IsApprovedForAllResponse), &out_dir);
export_schema(&schema_for!(TokenInfoResponse), &out_dir);
export_schema(&schema_for!(TokensResponse), &out_dir);
}
6 changes: 3 additions & 3 deletions contracts/cw1155-base/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pub mod contract;
mod error;
mod msg;
mod state;
pub mod msg;
pub mod state;

pub use msg::InstantiateMsg;
pub use crate::error::ContractError;
2 changes: 2 additions & 0 deletions contracts/cw20-atomic-swap/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ pub mod contract;
mod error;
pub mod msg;
pub mod state;

pub use crate::error::ContractError;
2 changes: 2 additions & 0 deletions contracts/cw20-bonding/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ pub mod curves;
mod error;
pub mod msg;
pub mod state;

pub use crate::error::ContractError;
2 changes: 2 additions & 0 deletions contracts/cw20-escrow/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ mod error;
mod integration_test;
pub mod msg;
pub mod state;

pub use crate::error::ContractError;
4 changes: 3 additions & 1 deletion contracts/cw20-ics20/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
pub mod amount;
pub mod contract;
pub mod error;
mod error;
pub mod ibc;
pub mod msg;
pub mod state;
mod test_helpers;

pub use crate::error::ContractError;
2 changes: 2 additions & 0 deletions contracts/cw20-staking/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ pub mod contract;
mod error;
pub mod msg;
pub mod state;

pub use crate::error::ContractError;
2 changes: 2 additions & 0 deletions contracts/cw3-fixed-multisig/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ mod error;
mod integration_tests;
pub mod msg;
pub mod state;

pub use crate::error::ContractError;
2 changes: 2 additions & 0 deletions contracts/cw3-flex-multisig/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ pub mod contract;
mod error;
pub mod msg;
pub mod state;

pub use crate::error::ContractError;
2 changes: 2 additions & 0 deletions contracts/cw4-group/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ pub mod error;
pub mod helpers;
pub mod msg;
pub mod state;

pub use crate::error::ContractError;
4 changes: 3 additions & 1 deletion contracts/cw4-stake/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
pub mod contract;
pub mod error;
mod error;
pub mod msg;
pub mod state;

pub use crate::error::ContractError;
2 changes: 2 additions & 0 deletions contracts/cw721-base/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ pub mod contract;
mod error;
pub mod msg;
pub mod state;

pub use crate::error::ContractError;

0 comments on commit 0daeb17

Please sign in to comment.