boot_cw_plus/
cw1.rs

1use boot_core::{boot_contract, BootEnvironment, Contract};
2use cosmwasm_std::Empty;
3use cw1_whitelist::msg::{ExecuteMsg, InstantiateMsg, QueryMsg};
4use cw_multi_test::ContractWrapper;
5
6#[boot_contract(InstantiateMsg, ExecuteMsg, QueryMsg, Empty)]
7pub struct Cw1;
8
9// implement chain-generic functions
10impl<Chain: BootEnvironment + Clone> Cw1<Chain> {
11    pub fn new(id: &str, chain: Chain) -> Self {
12        let crate_path = env!("CARGO_MANIFEST_DIR");
13        let file_path = &format!("{}{}", crate_path, "/cw-artifacts/cw1_whitelist.wasm");
14        Self(
15            Contract::new(id, chain)
16                .with_mock(Box::new(ContractWrapper::new_with_empty(
17                    cw20_base::contract::execute,
18                    cw20_base::contract::instantiate,
19                    cw20_base::contract::query,
20                )))
21                .with_wasm_path(file_path),
22        )
23    }
24    pub fn set_variant(self, filename: &str) -> Self {
25        let crate_path = env!("CARGO_MANIFEST_DIR");
26        let file_path = &format!("{}{}{}", crate_path, "/cw-artifacts/", filename);
27        Self(self.0.with_wasm_path(file_path))
28    }
29}