diff --git a/contracts/sei-tester/Cargo.toml b/contracts/sei-tester/Cargo.toml index 1b901f9..35ef23b 100644 --- a/contracts/sei-tester/Cargo.toml +++ b/contracts/sei-tester/Cargo.toml @@ -40,11 +40,11 @@ optimize = """docker run --rm -v "$(pwd)":/code \ [dependencies] sei-cosmwasm = { path = "../../packages/sei-cosmwasm" } -cosmwasm-std = "1.0.0" -cosmwasm-storage = "1.0.0" -cw-storage-plus = "0.13.2" -cw2 = "0.13.2" -schemars = "0.8.8" +cosmwasm-std = "1.3" +cosmwasm-storage = "1.3" +cw-storage-plus = "1.1" +cw2 = "1.1" +schemars = "0.8" serde = { version = "1.0.137", default-features = false, features = ["derive"] } serde_json = { version = "1.0", default-features = false, features = ["alloc"] } base64 = { version = "0.13.0" } @@ -52,6 +52,6 @@ thiserror = { version = "1.0.31" } protobuf = { version = "3.2.0", features = ["with-bytes"] } [dev-dependencies] -cosmwasm-schema = "1.0.0" +cosmwasm-schema = "1.3" cw-multi-test = "0.16.0" sei-integration-tests = { path = "../../packages/sei-integration-tests" } diff --git a/contracts/sei-tester/tests/sei_tester_integration_tests.rs b/contracts/sei-tester/tests/sei_tester_integration_tests.rs index deaa95e..072568d 100644 --- a/contracts/sei-tester/tests/sei_tester_integration_tests.rs +++ b/contracts/sei-tester/tests/sei_tester_integration_tests.rs @@ -1,3 +1,5 @@ +use std::vec; + use cosmwasm_std::{ coin, from_binary, testing::{MockApi, MockStorage}, @@ -27,18 +29,12 @@ use sei_tester::{ const ADMIN: &str = "admin"; const NATIVE_DENOM: &str = "usei"; +pub type SeiRouter = Router, StakeKeeper, DistributionKeeper, FailingModule, FailingModule>; +pub type SeiApp = App, StakeKeeper, DistributionKeeper, FailingModule, FailingModule>; /// Init balances via bank fn init_default_balances( - router: &mut Router< - BankKeeper, - SeiModule, - WasmKeeper, - StakeKeeper, - DistributionKeeper, - FailingModule, - FailingModule, - >, + router: &mut SeiRouter, _api: &dyn Api, storage: &mut dyn Storage, ) { @@ -88,20 +84,11 @@ fn init_default_balances( .unwrap(); } + /// Helper for setting up test fn setup_test( - app: &mut App< - BankKeeper, - MockApi, - MockStorage, - SeiModule, - WasmKeeper, - StakeKeeper, - DistributionKeeper, - FailingModule, - FailingModule, - >, + app: &mut SeiApp, ) -> Addr { let sei_tester_code = app.store_code(Box::new( ContractWrapper::new(execute, instantiate, query) @@ -109,7 +96,7 @@ fn setup_test( .with_sudo(sei_tester::contract::sudo), )); //:: - let sei_tester_addr = app + app .instantiate_contract( sei_tester_code, Addr::unchecked(ADMIN), @@ -118,9 +105,8 @@ fn setup_test( "sei_tester", Some(ADMIN.to_string()), ) - .unwrap(); + .unwrap() - sei_tester_addr } /// Basic msg examples @@ -260,14 +246,14 @@ fn test_dex_module_integration_orders() { let status_description = "order1".to_string(); let order1: Order = Order { - price: price, - quantity: quantity, + price, + quantity, price_denom: price_denom.clone(), asset_denom: asset_denom.clone(), - order_type: order_type, - position_direction: position_direction, - data: data, // serialized order data, defined by the specific target contract - status_description: status_description, + order_type, + position_direction, + data, // serialized order data, defined by the specific target contract + status_description, nominal: Decimal::zero(), }; orders.push(order1); @@ -305,8 +291,8 @@ fn test_dex_module_integration_orders() { .execute_multi( Addr::unchecked(ADMIN), vec![CosmosMsg::Custom(SeiMsg::PlaceOrders { - orders: orders, - funds: funds, + orders, + funds, contract_address: Addr::unchecked(&contract_addr), })], ) @@ -419,8 +405,7 @@ fn test_dex_module_integration_orders() { assert!(error.is_some()); // CancelOrders for a contract address that doesn't exist - let mut nonexistent_order_ids: Vec = Vec::new(); - nonexistent_order_ids.push(3); + let nonexistent_order_ids: Vec = vec![0]; let res = app.execute_multi( Addr::unchecked(ADMIN), vec![CosmosMsg::Custom(SeiMsg::CancelOrders { @@ -432,8 +417,7 @@ fn test_dex_module_integration_orders() { assert!(error.is_some()); // CancelOrders for order id 1 - let mut cancel_order_ids: Vec = Vec::new(); - cancel_order_ids.push(0); + let cancel_order_ids: Vec = vec![0]; let arr = app .execute_multi( Addr::unchecked(ADMIN), @@ -504,14 +488,14 @@ fn test_dex_module_query_order_simulation() { let status_description = "order1".to_string(); let order1: Order = Order { - price: price, - quantity: quantity, + price, + quantity, price_denom: price_denom.clone(), asset_denom: asset_denom.clone(), - order_type: order_type, - position_direction: position_direction, - data: data, // serialized order data, defined by the specific target contract - status_description: status_description, + order_type, + position_direction, + data, // serialized order data, defined by the specific target contract + status_description, nominal: Decimal::zero(), }; orders.push(order1); @@ -547,9 +531,9 @@ fn test_dex_module_query_order_simulation() { app.execute_multi( Addr::unchecked(ADMIN), vec![CosmosMsg::Custom(SeiMsg::PlaceOrders { - orders: orders, - funds: funds, - contract_address: Addr::unchecked(&sei_tester_addr.to_string()), + orders, + funds, + contract_address: Addr::unchecked(sei_tester_addr.to_string()), })], ) .unwrap(); @@ -801,14 +785,14 @@ fn test_dex_module_query_dex_twap() { let status_description = "order1".to_string(); let order1: Order = Order { - price: price, - quantity: quantity, + price, + quantity, price_denom: price_denom.clone(), asset_denom: asset_denom.clone(), - order_type: order_type, - position_direction: position_direction, - data: data, // serialized order data, defined by the specific target contract - status_description: status_description, + order_type, + position_direction, + data, // serialized order data, defined by the specific target contract + status_description, nominal: Decimal::zero(), }; orders.push(order1); @@ -816,12 +800,12 @@ fn test_dex_module_query_dex_twap() { app.execute_multi( Addr::unchecked(ADMIN), vec![CosmosMsg::Custom(SeiMsg::PlaceOrders { - orders: orders, + orders, funds: vec![Coin { denom: "usei".to_string(), amount: Uint128::new(10), }], - contract_address: Addr::unchecked(&sei_tester_addr.to_string()), + contract_address: Addr::unchecked(sei_tester_addr.to_string()), })], ) .unwrap(); @@ -860,12 +844,12 @@ fn test_dex_module_query_dex_twap() { app.execute_multi( Addr::unchecked(ADMIN), vec![CosmosMsg::Custom(SeiMsg::PlaceOrders { - orders: orders, + orders, funds: vec![Coin { denom: "usei".to_string(), amount: Uint128::new(10), }], - contract_address: Addr::unchecked(&sei_tester_addr.to_string()), + contract_address: Addr::unchecked(sei_tester_addr.to_string()), })], ) .unwrap(); @@ -881,7 +865,7 @@ fn test_dex_module_query_dex_twap() { .query(&QueryRequest::Custom(SeiQueryWrapper { route: SeiRoute::Dex, query_data: SeiQuery::DexTwaps { - contract_address: Addr::unchecked(&sei_tester_addr.to_string()), + contract_address: Addr::unchecked(sei_tester_addr.to_string()), lookback_seconds: 6, }, })) diff --git a/packages/sei-cosmwasm/Cargo.toml b/packages/sei-cosmwasm/Cargo.toml index 2fef512..8c14afe 100644 --- a/packages/sei-cosmwasm/Cargo.toml +++ b/packages/sei-cosmwasm/Cargo.toml @@ -10,11 +10,11 @@ readme = "README.md" backtraces = ["cosmwasm-std/backtraces"] [dependencies] -cosmwasm-std = "1.1" -schemars = "0.8.3" -serde = { version = "1.0.127", default-features = false, features = ["derive"] } +cosmwasm-std = "1.3" +schemars = "0.8" +serde = { version = "1.0", default-features = false, features = ["derive"] } serde_repr = "0.1.8" protobuf = { version = "=3.2.0", features = ["with-bytes"] } [dev-dependencies] -cosmwasm-schema = "1.0.0" +cosmwasm-schema = "1.3" diff --git a/packages/sei-integration-tests/Cargo.toml b/packages/sei-integration-tests/Cargo.toml index 4d782b8..de84656 100644 --- a/packages/sei-integration-tests/Cargo.toml +++ b/packages/sei-integration-tests/Cargo.toml @@ -10,8 +10,8 @@ readme = "README.md" cw-multi-test = "0.16" anyhow = "1" sei-cosmwasm = { path = "../sei-cosmwasm", version = "0.4.10" } -cosmwasm-std = "1.0.0" -cw20-base = "0.13.4" -schemars = "0.8.8" -serde = { version = "1.0.137", default-features = false, features = ["derive"] } +cosmwasm-std = "1.3" +cw20-base = "1.1" +schemars = "0.8" +serde = { version = "1.0", default-features = false, features = ["derive"] } serde_json = { version = "1.0", default-features = false, features = ["alloc"] } \ No newline at end of file