From 073633bceda933b2f1ed8d58fa5b7f73d6ca9df4 Mon Sep 17 00:00:00 2001 From: Kayanski Date: Wed, 8 Jan 2025 16:58:06 +0100 Subject: [PATCH] Make it work --- Cargo.toml | 2 +- packages/cw-orch-mock/src/bech32.rs | 3 ++- packages/cw-orch-mock/src/core.rs | 5 +++-- packages/cw-orch-mock/src/simple.rs | 6 ++++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 806c0312d..474d8d998 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,7 +33,7 @@ cw-storage-plus = { version = "2.0.0" } cw-utils = { version = "2.0.0" } # cw-multi-test = { package = "abstract-cw-multi-test", version = "2.0.2", features = ["cosmwasm_1_2"] } -cw-multi-test = { package = "abstract-cw-multi-test", git = "https://github.com/abstractsdk/cw-multi-test-fork", branch = "token-factory-integration", version = "2.0.2", features = ["cosmwasm_1_2"] } +cw-multi-test = { package = "abstract-cw-multi-test", git = "https://github.com/abstractsdk/cw-multi-test-fork", branch = "token-factory-integration", version = "2.0.2", features = ["cosmwasm_1_2", "tokenfactory"] } cw20 = { version = "2.0.0" } cw20-base = { version = "2.0.0" } diff --git a/packages/cw-orch-mock/src/bech32.rs b/packages/cw-orch-mock/src/bech32.rs index 4759ea0ee..48f9708f3 100644 --- a/packages/cw-orch-mock/src/bech32.rs +++ b/packages/cw-orch-mock/src/bech32.rs @@ -1,7 +1,7 @@ use std::{cell::RefCell, rc::Rc}; use cosmwasm_std::{testing::MockApi, Addr, Coin, Uint128}; -use cw_multi_test::{AppBuilder, MockApiBech32}; +use cw_multi_test::{AppBuilder, MockApiBech32, TokenFactoryStargate}; use cw_orch_core::{ environment::{BankQuerier, BankSetter, DefaultQueriers, StateInterface, TxHandler}, CwEnvError, @@ -74,6 +74,7 @@ impl MockBase { let app = Rc::new(RefCell::new( AppBuilder::new_custom() .with_api(MockApiBech32::new(prefix)) + .with_stargate(TokenFactoryStargate) .build(|_, _, _| {}), )); diff --git a/packages/cw-orch-mock/src/core.rs b/packages/cw-orch-mock/src/core.rs index 9345de531..28c45696c 100644 --- a/packages/cw-orch-mock/src/core.rs +++ b/packages/cw-orch-mock/src/core.rs @@ -6,7 +6,8 @@ use cosmwasm_std::{ }; use cw_multi_test::{ ibc::IbcSimpleModule, App, AppResponse, BankKeeper, Contract, DistributionKeeper, Executor, - FailingModule, GovFailingModule, MockApiBech32, StakeKeeper, StargateFailing, WasmKeeper, + FailingModule, GovFailingModule, MockApiBech32, StakeKeeper, StargateFailing, + TokenFactoryStargate, WasmKeeper, }; use serde::Serialize; @@ -27,7 +28,7 @@ pub type MockApp = App< DistributionKeeper, IbcSimpleModule, GovFailingModule, - StargateFailing, + TokenFactoryStargate, >; /// Wrapper around a cw-multi-test [`App`](cw_multi_test::App) backend. diff --git a/packages/cw-orch-mock/src/simple.rs b/packages/cw-orch-mock/src/simple.rs index fc51f5132..ad8838111 100644 --- a/packages/cw-orch-mock/src/simple.rs +++ b/packages/cw-orch-mock/src/simple.rs @@ -3,7 +3,7 @@ use std::rc::Rc; use cosmwasm_std::testing::MockApi; use cosmwasm_std::{Addr, Coin, Uint128}; -use cw_multi_test::AppBuilder; +use cw_multi_test::{AppBuilder, TokenFactoryStargate}; use cw_orch_core::environment::{BankQuerier, BankSetter, TxHandler}; use cw_orch_core::{ environment::{DefaultQueriers, StateInterface}, @@ -105,7 +105,9 @@ impl Mock { /// The state is customizable by implementing the `StateInterface` trait on a custom struct and providing it on the custom constructor. pub fn new_custom(sender: impl Into, custom_state: S) -> Self { let state = Rc::new(RefCell::new(custom_state)); - let app = AppBuilder::new_custom().build(|_, _, _| {}); + let app = AppBuilder::new_custom() + .with_stargate(TokenFactoryStargate) + .build(|_, _, _| {}); let sender: String = sender.into(); let sender = app.api().addr_make(&sender); let app = Rc::new(RefCell::new(app));