fn init(self) -> Result<Suite> {
        let mut app = mock_app();

        let cw20_id = app.store_code(contract_cw20());
        let pair_id = app.store_code(contract_pair());

        let admin = Addr::unchecked("admin");

        // Initialize actors
        let (lps, lp_balances) = Self::init_actors(&mut app, self.lps)?;
        let (traders, traders_balances) = Self::init_actors(&mut app, self.traders)?;

        let initial_balances = [lp_balances, traders_balances].concat();
        let cash = app
            .instantiate_contract(
                cw20_id,
                admin.clone(),
                &cw20_base::msg::InstantiateMsg {
                    name: "Cash Money".to_owned(),
                    symbol: "cash".to_owned(),
                    decimals: 2,
                    initial_balances,
                    mint: None,
                    marketing: None,
                },
                &[],
                "Cash",
                None,
            )
            .map_err(|err| anyhow!(err))?;

        let instantiate_msg = InstantiateMsg::new(
            [
                AssetInfo::Native("btc".to_owned()),
                AssetInfo::Token(cash.clone()),
            ],
            cw20_id,
        );

        let instantiate_msg = if let Some(commission) = self.commission {
            instantiate_msg.with_commission(commission)
        } else {
            instantiate_msg
        };

        let pair = app
            .instantiate_contract(pair_id, admin.clone(), &instantiate_msg, &[], "Pair", None)
            .map_err(|err| anyhow!(err))?;

        let PairInfo {
            liquidity_token: lt,
            ..
        } = app
            .wrap()
            .query_wasm_smart(pair.clone(), &QueryMsg::Pair {})
            .map_err(|err| anyhow!(err))?;

        Ok(Suite {
            app,
            admin,
            cash,
            pair,
            lt,
            traders,
            lps,
        })
    }
/// Initializes actors and returns proper test suite helper
Initializes actors and returns proper test suite helper
Initializes actors and returns proper test suite helper
fn init(self) -> Result<Suite> {
        let mut app = mock_app();
        let cw20_id = app.store_code(contract_cw20());
        let pair_id = app.store_code(contract_pair());
        let admin = Addr::unchecked("admin");
        // Initialize actors
        let (lps, lp_balances) = Self::init_actors(&mut app, self.lps)?;
        let (traders, traders_balances) = Self::init_actors(&mut app, self.traders)?;
        let initial_balances = [lp_balances, traders_balances].concat();
        let cash = app
            .instantiate_contract(
                cw20_id,
                admin.clone(),
                &cw20_base::msg::InstantiateMsg {
                    name: "Cash Money".to_owned(),
                    symbol: "cash".to_owned(),
                    decimals: 2,
                    initial_balances,
                    mint: None,
                    marketing: None,
                },
                &[],
                "Cash",
                None,
            )
            .map_err(|err| anyhow!(err))?;
        let instantiate_msg = InstantiateMsg::new(
            [
                AssetInfo::Native("btc".to_owned()),
                AssetInfo::Token(cash.clone()),
            ],
            cw20_id,
        );
        let instantiate_msg = if let Some(commission) = self.commission {
            instantiate_msg.with_commission(commission)
        } else {
            instantiate_msg
        };
        let pair = app
            .instantiate_contract(pair_id, admin.clone(), &instantiate_msg, &[], "Pair", None)
            .map_err(|err| anyhow!(err))?;
        let PairInfo {
            liquidity_token: lt,
            ..
        } = app
            .wrap()
            .query_wasm_smart(pair.clone(), &QueryMsg::Pair {})
            .map_err(|err| anyhow!(err))?;
        Ok(Suite {
            app,
            admin,
            cash,
            pair,
            lt,
            traders,
            lps,
        })
    }
fn init ( self ) -> Result < Suite > { let mut app = mock_app ( ) ; let cw20_id = app . store_code ( contract_cw20 ( ) ) ; let pair_id = app . store_code ( contract_pair ( ) ) ; let admin = Addr :: unchecked ( " " ) ; // Initialize actors let ( lps , lp_balances ) = Self :: init_actors ( & mut app , self . lps ) ? ; let ( traders , traders_balances ) = Self :: init_actors ( & mut app , self . traders ) ? ; let initial_balances = [ lp_balances , traders_balances ] . concat ( ) ; let cash = app . instantiate_contract ( cw20_id , admin . clone ( ) , & cw20_base :: msg :: InstantiateMsg { name : " " . to_owned ( ) , symbol : " " . to_owned ( ) , decimals : 2 , initial_balances , mint : None , marketing : None , } , & [ ] , " " , None , ) . map_err ( | err | anyhow ! ( err ) ) ? ; let instantiate_msg = InstantiateMsg :: new ( [ AssetInfo :: Native ( " " . to_owned ( ) ) , AssetInfo :: Token ( cash . clone ( ) ) , ] , cw20_id , ) ; let instantiate_msg = if let Some ( commission ) = self . commission { instantiate_msg . with_commission ( commission ) } else { instantiate_msg } ; let pair = app . instantiate_contract ( pair_id , admin . clone ( ) , & instantiate_msg , & [ ] , " " , None ) . map_err ( | err | anyhow ! ( err ) ) ? ; let PairInfo { liquidity_token : lt , .. } = app . wrap ( ) . query_wasm_smart ( pair . clone ( ) , & QueryMsg :: Pair { } ) . map_err ( | err | anyhow ! ( err ) ) ? ; Ok ( Suite { app , admin , cash , pair , lt , traders , lps , } ) }
Initializes actors and returns proper test suite helper
Initializes actors and returns proper test suite helper
self
self