diff --git a/contracts/adapters/swap/astroport/tests/test_execute_astroport_pool_swap.rs b/contracts/adapters/swap/astroport/tests/test_execute_astroport_pool_swap.rs index cd45a183..8ab51e81 100644 --- a/contracts/adapters/swap/astroport/tests/test_execute_astroport_pool_swap.rs +++ b/contracts/adapters/swap/astroport/tests/test_execute_astroport_pool_swap.rs @@ -47,6 +47,7 @@ struct Params { pool: "pool_1".to_string(), denom_in: "os".to_string(), denom_out: "ua".to_string(), + interface: None, }, expected_message: Some(SubMsg { id: 0, @@ -81,6 +82,7 @@ struct Params { pool: "pool_1".to_string(), denom_in: "neutron123".to_string(), denom_out: "ua".to_string(), + interface: None, }, expected_message: Some(SubMsg { id: 0, @@ -112,6 +114,7 @@ struct Params { pool: "pool_1".to_string(), denom_in: "os".to_string(), denom_out: "ua".to_string(), + interface: None, }, expected_message: None, expected_error: Some(ContractError::NoOfferAssetAmount), @@ -125,6 +128,7 @@ struct Params { pool: "pool_1".to_string(), denom_in: "randomcw20".to_string(), denom_out: "ua".to_string(), + interface: None, }, expected_message: None, expected_error: Some(ContractError::NoOfferAssetAmount), @@ -140,6 +144,7 @@ struct Params { pool: "".to_string(), denom_in: "".to_string(), denom_out: "".to_string(), + interface: None, }, expected_message: None, expected_error: Some(ContractError::Unauthorized), diff --git a/contracts/adapters/swap/astroport/tests/test_execute_receive.rs b/contracts/adapters/swap/astroport/tests/test_execute_receive.rs index 3e961006..0962b1ad 100644 --- a/contracts/adapters/swap/astroport/tests/test_execute_receive.rs +++ b/contracts/adapters/swap/astroport/tests/test_execute_receive.rs @@ -54,6 +54,7 @@ struct Params { pool: "pool_1".to_string(), denom_in: "neutron123".to_string(), denom_out: "ua".to_string(), + interface: None, } ], expected_messages: vec![ @@ -66,6 +67,7 @@ struct Params { pool: "pool_1".to_string(), denom_in: "neutron123".to_string(), denom_out: "ua".to_string(), + interface: None, } })?, funds: vec![], @@ -104,6 +106,7 @@ struct Params { pool: "pool_1".to_string(), denom_in: "neutron123".to_string(), denom_out: "neutron987".to_string(), + interface: None, } ], expected_messages: vec![ @@ -116,6 +119,7 @@ struct Params { pool: "pool_1".to_string(), denom_in: "neutron123".to_string(), denom_out: "neutron987".to_string(), + interface: None, } })?, funds: vec![], diff --git a/contracts/adapters/swap/astroport/tests/test_execute_swap.rs b/contracts/adapters/swap/astroport/tests/test_execute_swap.rs index c23d5ead..a4309313 100644 --- a/contracts/adapters/swap/astroport/tests/test_execute_swap.rs +++ b/contracts/adapters/swap/astroport/tests/test_execute_swap.rs @@ -45,6 +45,7 @@ struct Params { pool: "pool_1".to_string(), denom_in: "os".to_string(), denom_out: "ua".to_string(), + interface: None, } ], expected_messages: vec![ @@ -57,6 +58,7 @@ struct Params { pool: "pool_1".to_string(), denom_in: "os".to_string(), denom_out: "ua".to_string(), + interface: None, } })?, funds: vec![], @@ -91,11 +93,13 @@ struct Params { pool: "pool_1".to_string(), denom_in: "os".to_string(), denom_out: "ua".to_string(), + interface: None, }, SwapOperation { pool: "pool_2".to_string(), denom_in: "ua".to_string(), denom_out: "un".to_string(), + interface: None, } ], expected_messages: vec![ @@ -108,6 +112,7 @@ struct Params { pool: "pool_1".to_string(), denom_in: "os".to_string(), denom_out: "ua".to_string(), + interface: None, } })?, funds: vec![], @@ -124,6 +129,7 @@ struct Params { pool: "pool_2".to_string(), denom_in: "ua".to_string(), denom_out: "un".to_string(), + interface: None, } })?, funds: vec![], diff --git a/contracts/adapters/swap/dexter/tests/integration_test.rs b/contracts/adapters/swap/dexter/tests/integration_test.rs index 6aeaf30e..3320135a 100644 --- a/contracts/adapters/swap/dexter/tests/integration_test.rs +++ b/contracts/adapters/swap/dexter/tests/integration_test.rs @@ -203,6 +203,7 @@ pub fn test_swap_simulation() { pool: "1".to_string(), denom_in: "uxprt".to_string(), denom_out: "stk/uxprt".to_string(), + interface: None, }], include_spot_price: true, }; @@ -238,11 +239,13 @@ pub fn test_swap_simulation() { pool: "1".to_string(), denom_in: "uxprt".to_string(), denom_out: "stk/uxprt".to_string(), + interface: None, }, SwapOperation { pool: "2".to_string(), denom_in: "stk/uxprt".to_string(), denom_out: "stk/uatom".to_string(), + interface: None, }, ], include_spot_price: true, @@ -279,11 +282,13 @@ pub fn test_swap_simulation() { pool: "1".to_string(), denom_in: "uxprt".to_string(), denom_out: "stk/uxprt".to_string(), + interface: None, }, SwapOperation { pool: "2".to_string(), denom_in: "stk/uxprt".to_string(), denom_out: "stk/uatom".to_string(), + interface: None, }, ], include_spot_price: true, @@ -320,11 +325,13 @@ pub fn test_swap_simulation() { pool: "1".to_string(), denom_in: "uxprt".to_string(), denom_out: "stk/uxprt".to_string(), + interface: None, }, SwapOperation { pool: "2".to_string(), denom_in: "stk/uxprt".to_string(), denom_out: "uatom".to_string(), + interface: None, }, ], include_spot_price: true, @@ -348,16 +355,19 @@ pub fn test_swap_simulation() { pool: "1".to_string(), denom_in: "uxprt".to_string(), denom_out: "stk/uxprt".to_string(), + interface: None, }, SwapOperation { pool: "2".to_string(), denom_in: "stk/uxprt".to_string(), denom_out: "stk/uatom".to_string(), + interface: None, }, SwapOperation { pool: "3".to_string(), denom_in: "stk/uatom".to_string(), denom_out: "uatom".to_string(), + interface: None, }, ], include_spot_price: true, @@ -385,6 +395,7 @@ pub fn test_swap() { pool: "1".to_string(), denom_in: "uxprt".to_string(), denom_out: "stk/uxprt".to_string(), + interface: None, }], }; @@ -433,11 +444,13 @@ pub fn test_swap() { pool: "1".to_string(), denom_in: "uxprt".to_string(), denom_out: "stk/uxprt".to_string(), + interface: None, }, SwapOperation { pool: "2".to_string(), denom_in: "stk/uxprt".to_string(), denom_out: "stk/uatom".to_string(), + interface: None, }, ], }; diff --git a/contracts/adapters/swap/dexter/tests/test_execute_swap.rs b/contracts/adapters/swap/dexter/tests/test_execute_swap.rs index becfe19e..ebc943b2 100644 --- a/contracts/adapters/swap/dexter/tests/test_execute_swap.rs +++ b/contracts/adapters/swap/dexter/tests/test_execute_swap.rs @@ -50,6 +50,7 @@ struct Params { pool: "1".to_string(), denom_in: "uxprt".to_string(), denom_out: "stk/uxprt".to_string(), + interface: None, } ], expected_messages: vec![ @@ -108,11 +109,13 @@ struct Params { pool: "1".to_string(), denom_in: "os".to_string(), denom_out: "uatom".to_string(), + interface: None, }, SwapOperation { pool: "2".to_string(), denom_in: "uatom".to_string(), denom_out: "untrn".to_string(), + interface: None, } ], expected_messages: vec![ @@ -218,6 +221,7 @@ struct Params { pool: "1".to_string(), denom_in: "os".to_string(), denom_out: "uatom".to_string(), + interface: None, } ], expected_messages: vec![], @@ -236,6 +240,7 @@ struct Params { pool: "1".to_string(), denom_in: "os".to_string(), denom_out: "uatom".to_string(), + interface: None, } ], expected_messages: vec![], @@ -251,6 +256,7 @@ struct Params { pool: "pool_1".to_string(), denom_in: "os".to_string(), denom_out: "uatom".to_string(), + interface: None, } ], expected_messages: vec![], @@ -269,6 +275,7 @@ struct Params { pool: "1".to_string(), denom_in: "uxprt".to_string(), denom_out: "stk/uxprt".to_string(), + interface: None, } ], expected_messages: vec![], diff --git a/contracts/adapters/swap/osmosis-poolmanager/tests/test_execute_swap.rs b/contracts/adapters/swap/osmosis-poolmanager/tests/test_execute_swap.rs index 17a9f972..eb18ab1a 100644 --- a/contracts/adapters/swap/osmosis-poolmanager/tests/test_execute_swap.rs +++ b/contracts/adapters/swap/osmosis-poolmanager/tests/test_execute_swap.rs @@ -47,6 +47,7 @@ struct Params { pool: "1".to_string(), denom_in: "os".to_string(), denom_out: "uatom".to_string(), + interface: None, } ], expected_messages: vec![ @@ -99,11 +100,13 @@ struct Params { pool: "1".to_string(), denom_in: "os".to_string(), denom_out: "uatom".to_string(), + interface: None, }, SwapOperation { pool: "2".to_string(), denom_in: "uatom".to_string(), denom_out: "untrn".to_string(), + interface: None, } ], expected_messages: vec![ @@ -201,6 +204,7 @@ struct Params { pool: "pool_1".to_string(), denom_in: "os".to_string(), denom_out: "uatom".to_string(), + interface: None, } ], expected_messages: vec![], @@ -219,6 +223,7 @@ struct Params { pool: "pool_1".to_string(), denom_in: "os".to_string(), denom_out: "uatom".to_string(), + interface: None, } ], expected_messages: vec![], @@ -234,6 +239,7 @@ struct Params { pool: "pool_1".to_string(), denom_in: "os".to_string(), denom_out: "uatom".to_string(), + interface: None, } ], expected_messages: vec![], diff --git a/contracts/adapters/swap/white-whale/tests/test_execute_receive.rs b/contracts/adapters/swap/white-whale/tests/test_execute_receive.rs index 82b1396f..7c8d6ccf 100644 --- a/contracts/adapters/swap/white-whale/tests/test_execute_receive.rs +++ b/contracts/adapters/swap/white-whale/tests/test_execute_receive.rs @@ -54,6 +54,7 @@ struct Params { pool: "pool_1".to_string(), denom_in: "neutron123".to_string(), denom_out: "ua".to_string(), + interface: None, } ], expected_messages: vec![ @@ -66,6 +67,7 @@ struct Params { pool: "pool_1".to_string(), denom_in: "neutron123".to_string(), denom_out: "ua".to_string(), + interface: None, } })?, funds: vec![], @@ -104,6 +106,7 @@ struct Params { pool: "pool_1".to_string(), denom_in: "neutron123".to_string(), denom_out: "neutron987".to_string(), + interface: None, } ], expected_messages: vec![ @@ -116,6 +119,7 @@ struct Params { pool: "pool_1".to_string(), denom_in: "neutron123".to_string(), denom_out: "neutron987".to_string(), + interface: None, } })?, funds: vec![], diff --git a/contracts/adapters/swap/white-whale/tests/test_execute_swap.rs b/contracts/adapters/swap/white-whale/tests/test_execute_swap.rs index ff0a6451..a617fabb 100644 --- a/contracts/adapters/swap/white-whale/tests/test_execute_swap.rs +++ b/contracts/adapters/swap/white-whale/tests/test_execute_swap.rs @@ -45,6 +45,7 @@ struct Params { pool: "pool_1".to_string(), denom_in: "os".to_string(), denom_out: "ua".to_string(), + interface: None, } ], expected_messages: vec![ @@ -57,6 +58,7 @@ struct Params { pool: "pool_1".to_string(), denom_in: "os".to_string(), denom_out: "ua".to_string(), + interface: None, } })?, funds: vec![], @@ -91,11 +93,13 @@ struct Params { pool: "pool_1".to_string(), denom_in: "os".to_string(), denom_out: "ua".to_string(), + interface: None, }, SwapOperation { pool: "pool_2".to_string(), denom_in: "ua".to_string(), denom_out: "un".to_string(), + interface: None, } ], expected_messages: vec![ @@ -108,6 +112,7 @@ struct Params { pool: "pool_1".to_string(), denom_in: "os".to_string(), denom_out: "ua".to_string(), + interface: None, } })?, funds: vec![], @@ -124,6 +129,7 @@ struct Params { pool: "pool_2".to_string(), denom_in: "ua".to_string(), denom_out: "un".to_string(), + interface: None, } })?, funds: vec![], diff --git a/contracts/adapters/swap/white-whale/tests/test_execute_white_whale_pool_swap.rs b/contracts/adapters/swap/white-whale/tests/test_execute_white_whale_pool_swap.rs index 9c40ab59..bfbebf27 100644 --- a/contracts/adapters/swap/white-whale/tests/test_execute_white_whale_pool_swap.rs +++ b/contracts/adapters/swap/white-whale/tests/test_execute_white_whale_pool_swap.rs @@ -47,6 +47,7 @@ struct Params { pool: "pool_1".to_string(), denom_in: "os".to_string(), denom_out: "ua".to_string(), + interface: None, }, expected_message: Some(SubMsg { id: 0, @@ -80,6 +81,7 @@ struct Params { pool: "pool_1".to_string(), denom_in: "neutron123".to_string(), denom_out: "ua".to_string(), + interface: None, }, expected_message: Some(SubMsg { id: 0, @@ -110,6 +112,7 @@ struct Params { pool: "pool_1".to_string(), denom_in: "os".to_string(), denom_out: "ua".to_string(), + interface: None, }, expected_message: None, expected_error: Some(ContractError::NoOfferAssetAmount), @@ -123,6 +126,7 @@ struct Params { pool: "pool_1".to_string(), denom_in: "randomcw20".to_string(), denom_out: "ua".to_string(), + interface: None, }, expected_message: None, expected_error: Some(ContractError::NoOfferAssetAmount), @@ -138,6 +142,7 @@ struct Params { pool: "".to_string(), denom_in: "".to_string(), denom_out: "".to_string(), + interface: None, }, expected_message: None, expected_error: Some(ContractError::Unauthorized), diff --git a/contracts/entry-point/tests/test_execute_receive.rs b/contracts/entry-point/tests/test_execute_receive.rs index 06f8113b..62d5a456 100644 --- a/contracts/entry-point/tests/test_execute_receive.rs +++ b/contracts/entry-point/tests/test_execute_receive.rs @@ -52,6 +52,7 @@ struct Params { pool: "pool".to_string(), denom_in: "neutron123".to_string(), denom_out: "osmo".to_string(), + interface: None, } ], } @@ -77,6 +78,7 @@ struct Params { pool: "pool".to_string(), denom_in: "neutron123".to_string(), denom_out: "osmo".to_string(), + interface: None, } ], } @@ -125,6 +127,7 @@ struct Params { pool: "pool".to_string(), denom_in: "neutron123".to_string(), denom_out: "osmo".to_string(), + interface: None, } ], } @@ -151,6 +154,7 @@ struct Params { pool: "pool".to_string(), denom_in: "neutron123".to_string(), denom_out: "osmo".to_string(), + interface: None, } ], } diff --git a/contracts/entry-point/tests/test_execute_swap_and_action.rs b/contracts/entry-point/tests/test_execute_swap_and_action.rs index 6c698979..a06ad1de 100644 --- a/contracts/entry-point/tests/test_execute_swap_and_action.rs +++ b/contracts/entry-point/tests/test_execute_swap_and_action.rs @@ -103,6 +103,7 @@ struct Params { pool: "pool".to_string(), denom_in: "untrn".to_string(), denom_out: "osmo".to_string(), + interface: None, } ], } @@ -127,6 +128,7 @@ struct Params { pool: "pool".to_string(), denom_in: "untrn".to_string(), denom_out: "osmo".to_string(), + interface: None, } ], } @@ -177,6 +179,7 @@ struct Params { pool: "pool".to_string(), denom_in: "untrn".to_string(), denom_out: "osmo".to_string(), + interface: None, } ], refund_address: Some("refund_address".to_string()), @@ -202,6 +205,7 @@ struct Params { pool: "pool".to_string(), denom_in: "untrn".to_string(), denom_out: "osmo".to_string(), + interface: None, } ], refund_address: Some("refund_address".to_string()), @@ -253,6 +257,7 @@ struct Params { pool: "pool".to_string(), denom_in: "untrn".to_string(), denom_out: "osmo".to_string(), + interface: None, } ], }, @@ -299,6 +304,7 @@ struct Params { pool: "pool".to_string(), denom_in: "untrn".to_string(), denom_out: "osmo".to_string(), + interface: None, } ], } @@ -361,6 +367,7 @@ struct Params { pool: "pool".to_string(), denom_in: "untrn".to_string(), denom_out: "osmo".to_string(), + interface: None, } ], }, @@ -393,6 +400,7 @@ struct Params { pool: "pool".to_string(), denom_in: "untrn".to_string(), denom_out: "osmo".to_string(), + interface: None, } ], } @@ -451,6 +459,7 @@ struct Params { pool: "pool_2".to_string(), denom_in: "osmo".to_string(), denom_out: "uatom".to_string(), + interface: None, } ], }, @@ -478,6 +487,7 @@ struct Params { pool: "pool".to_string(), denom_in: "osmo".to_string(), denom_out: "untrn".to_string(), + interface: None, } ], refund_address: None, @@ -496,6 +506,7 @@ struct Params { pool: "pool".to_string(), denom_in: "osmo".to_string(), denom_out: "untrn".to_string(), + interface: None, } ], }).unwrap(), @@ -528,6 +539,7 @@ struct Params { pool: "pool_2".to_string(), denom_in: "osmo".to_string(), denom_out: "uatom".to_string(), + interface: None, } ], } @@ -570,6 +582,7 @@ struct Params { pool: "pool".to_string(), denom_in: "osmo".to_string(), denom_out: "untrn".to_string(), + interface: None, } ], refund_address: None, @@ -602,6 +615,7 @@ struct Params { pool: "pool".to_string(), denom_in: "untrn".to_string(), denom_out: "osmo".to_string(), + interface: None, } ], } @@ -626,6 +640,7 @@ struct Params { pool: "pool".to_string(), denom_in: "untrn".to_string(), denom_out: "osmo".to_string(), + interface: None, } ], } @@ -677,6 +692,7 @@ struct Params { pool: "pool".to_string(), denom_in: "neutron123".to_string(), denom_out: "osmo".to_string(), + interface: None, } ], } @@ -701,6 +717,7 @@ struct Params { pool: "pool".to_string(), denom_in: "neutron123".to_string(), denom_out: "osmo".to_string(), + interface: None, } ], } @@ -755,6 +772,7 @@ struct Params { pool: "pool_2".to_string(), denom_in: "neutron123".to_string(), denom_out: "uatom".to_string(), + interface: None, } ], }, @@ -782,6 +800,7 @@ struct Params { pool: "pool".to_string(), denom_in: "neutron123".to_string(), denom_out: "untrn".to_string(), + interface: None, } ], refund_address: None, @@ -803,6 +822,7 @@ struct Params { pool: "pool".to_string(), denom_in: "neutron123".to_string(), denom_out: "untrn".to_string(), + interface: None, } ], }).unwrap(), @@ -836,6 +856,7 @@ struct Params { pool: "pool_2".to_string(), denom_in: "neutron123".to_string(), denom_out: "uatom".to_string(), + interface: None, } ], } @@ -881,6 +902,7 @@ struct Params { pool: "pool".to_string(), denom_in: "neutron123".to_string(), denom_out: "untrn".to_string(), + interface: None, } ], refund_address: None, @@ -913,6 +935,7 @@ struct Params { pool: "pool".to_string(), denom_in: "untrn".to_string(), denom_out: "osmo".to_string(), + interface: None, } ], } @@ -940,6 +963,7 @@ struct Params { pool: "pool".to_string(), denom_in: "untrn".to_string(), denom_out: "osmo".to_string(), + interface: None, } ], } @@ -996,6 +1020,7 @@ struct Params { pool: "pool_2".to_string(), denom_in: "osmo".to_string(), denom_out: "uatom".to_string(), + interface: None, } ], }, @@ -1023,6 +1048,7 @@ struct Params { pool: "pool".to_string(), denom_in: "osmo".to_string(), denom_out: "untrn".to_string(), + interface: None, } ], refund_address: None, @@ -1052,6 +1078,7 @@ struct Params { pool: "pool_2".to_string(), denom_in: "osmo".to_string(), denom_out: "uatom".to_string(), + interface: None, } ], }, @@ -1079,6 +1106,7 @@ struct Params { pool: "pool".to_string(), denom_in: "uatom".to_string(), denom_out: "untrn".to_string(), + interface: None, } ], refund_address: None, @@ -1104,6 +1132,7 @@ struct Params { pool: "pool_2".to_string(), denom_in: "osmo".to_string(), denom_out: "uatom".to_string(), + interface: None, } ], }, @@ -1131,6 +1160,7 @@ struct Params { pool: "pool".to_string(), denom_in: "uatom".to_string(), denom_out: "untrn".to_string(), + interface: None, } ], refund_address: None, @@ -1156,6 +1186,7 @@ struct Params { pool: "pool_2".to_string(), denom_in: "osmo".to_string(), denom_out: "uatom".to_string(), + interface: None, } ], }, @@ -1183,6 +1214,7 @@ struct Params { pool: "pool".to_string(), denom_in: "osmo".to_string(), denom_out: "osmo".to_string(), + interface: None, } ], refund_address: None, @@ -1208,6 +1240,7 @@ struct Params { pool: "pool".to_string(), denom_in: "untrn".to_string(), denom_out: "osmo".to_string(), + interface: None, } ], }, @@ -1248,6 +1281,7 @@ struct Params { pool: "pool_2".to_string(), denom_in: "osmo".to_string(), denom_out: "atom".to_string(), + interface: None, } ], }, @@ -1271,6 +1305,7 @@ struct Params { pool: "pool".to_string(), denom_in: "osmo".to_string(), denom_out: "untrn".to_string(), + interface: None, } ], refund_address: None, @@ -1296,6 +1331,7 @@ struct Params { pool: "pool_2".to_string(), denom_in: "osmo".to_string(), denom_out: "atom".to_string(), + interface: None, } ], }, @@ -1323,6 +1359,7 @@ struct Params { pool: "pool".to_string(), denom_in: "osmo".to_string(), denom_out: "untrn".to_string(), + interface: None, } ], refund_address: None, @@ -1348,6 +1385,7 @@ struct Params { pool: "pool_2".to_string(), denom_in: "osmo".to_string(), denom_out: "atom".to_string(), + interface: None, } ], }, @@ -1375,6 +1413,7 @@ struct Params { pool: "pool".to_string(), denom_in: "osmo".to_string(), denom_out: "untrn".to_string(), + interface: None, } ], refund_address: None, @@ -1400,6 +1439,7 @@ struct Params { pool: "pool_2".to_string(), denom_in: "osmo".to_string(), denom_out: "atom".to_string(), + interface: None, } ], }, @@ -1427,6 +1467,7 @@ struct Params { pool: "pool".to_string(), denom_in: "osmo".to_string(), denom_out: "untrn".to_string(), + interface: None, } ], refund_address: None, @@ -1450,6 +1491,7 @@ struct Params { pool: "pool".to_string(), denom_in: "untrn".to_string(), denom_out: "osmo".to_string(), + interface: None, } ], }, @@ -1479,6 +1521,7 @@ struct Params { pool: "pool".to_string(), denom_in: "untrn".to_string(), denom_out: "osmo".to_string(), + interface: None, } ], }, @@ -1508,6 +1551,7 @@ struct Params { pool: "pool".to_string(), denom_in: "untrn".to_string(), denom_out: "osmo".to_string(), + interface: None, } ], }, @@ -1537,6 +1581,7 @@ struct Params { pool: "pool".to_string(), denom_in: "untrn".to_string(), denom_out: "osmo".to_string(), + interface: None, } ], }, @@ -1565,6 +1610,7 @@ struct Params { pool: "pool_2".to_string(), denom_in: "osmo".to_string(), denom_out: "uatom".to_string(), + interface: None, } ], }, @@ -1631,6 +1677,7 @@ struct Params { pool: "pool".to_string(), denom_in: "untrn".to_string(), denom_out: "osmo".to_string(), + interface: None, } ], } @@ -1658,6 +1705,7 @@ struct Params { pool: "pool".to_string(), denom_in: "untrn".to_string(), denom_out: "osmo".to_string(), + interface: None, }], }, Route { @@ -1667,11 +1715,13 @@ struct Params { pool: "pool_2".to_string(), denom_in: "untrn".to_string(), denom_out: "neutron123".to_string(), + interface: None, }, SwapOperation { pool: "pool_3".to_string(), denom_in: "neutron123".to_string(), denom_out: "osmo".to_string(), + interface: None, }, ], }, @@ -1719,6 +1769,7 @@ struct Params { pool: "pool".to_string(), denom_in: "untrn".to_string(), denom_out: "osmo".to_string(), + interface: None, }], }, Route { @@ -1728,11 +1779,13 @@ struct Params { pool: "pool_2".to_string(), denom_in: "untrn".to_string(), denom_out: "neutron123".to_string(), + interface: None, }, SwapOperation { pool: "pool_3".to_string(), denom_in: "neutron123".to_string(), denom_out: "osmo".to_string(), + interface: None, }, ], }, diff --git a/contracts/entry-point/tests/test_execute_swap_and_action_with_recover.rs b/contracts/entry-point/tests/test_execute_swap_and_action_with_recover.rs index 329c5232..afa1b6f3 100644 --- a/contracts/entry-point/tests/test_execute_swap_and_action_with_recover.rs +++ b/contracts/entry-point/tests/test_execute_swap_and_action_with_recover.rs @@ -53,6 +53,7 @@ struct Params { pool: "pool".to_string(), denom_in: "untrn".to_string(), denom_out: "osmo".to_string(), + interface: None, }], }), min_asset: Asset::Native(Coin::new(1_000_000, "osmo")), @@ -74,6 +75,7 @@ struct Params { pool: "pool".to_string(), denom_in: "untrn".to_string(), denom_out: "osmo".to_string(), + interface: None, }], }), min_asset: Asset::Native(Coin::new(1_000_000, "osmo")), @@ -102,6 +104,7 @@ struct Params { pool: "pool".to_string(), denom_in: "untrn".to_string(), denom_out: "osmo".to_string(), + interface: None, }], }), min_asset: Asset::Native(Coin::new(1_000_000, "osmo")), @@ -123,6 +126,7 @@ struct Params { pool: "pool".to_string(), denom_in: "untrn".to_string(), denom_out: "osmo".to_string(), + interface: None, }], }), min_asset: Asset::Native(Coin::new(1_000_000, "osmo")), @@ -154,6 +158,7 @@ struct Params { pool: "pool".to_string(), denom_in: "neutron123".to_string(), denom_out: "osmo".to_string(), + interface: None, }], }), min_asset: Asset::Native(Coin::new(1_000_000, "osmo")), @@ -181,6 +186,7 @@ struct Params { pool: "pool".to_string(), denom_in: "neutron123".to_string(), denom_out: "osmo".to_string(), + interface: None, }], }), min_asset: Asset::Native(Coin::new(1_000_000, "osmo")), @@ -209,6 +215,7 @@ struct Params { pool: "pool".to_string(), denom_in: "untrn".to_string(), denom_out: "osmo".to_string(), + interface: None, }], }), min_asset: Asset::Native(Coin::new(1_000_000, "osmo")), @@ -230,6 +237,7 @@ struct Params { pool: "pool".to_string(), denom_in: "untrn".to_string(), denom_out: "osmo".to_string(), + interface: None, }], }), min_asset: Asset::Native(Coin::new(1_000_000, "osmo")), @@ -258,6 +266,7 @@ struct Params { pool: "pool".to_string(), denom_in: "untrn".to_string(), denom_out: "osmo".to_string(), + interface: None, }], }), min_asset: Asset::Native(Coin::new(1_000_000, "osmo")), @@ -279,6 +288,7 @@ struct Params { pool: "pool".to_string(), denom_in: "untrn".to_string(), denom_out: "osmo".to_string(), + interface: None, }], }), min_asset: Asset::Native(Coin::new(1_000_000, "osmo")), @@ -310,6 +320,7 @@ struct Params { pool: "pool".to_string(), denom_in: "untrn".to_string(), denom_out: "osmo".to_string(), + interface: None, }], }), min_asset: Asset::Native(Coin::new(1_000_000, "osmo")), @@ -337,6 +348,7 @@ struct Params { pool: "pool".to_string(), denom_in: "untrn".to_string(), denom_out: "osmo".to_string(), + interface: None, }], }), min_asset: Asset::Native(Coin::new(1_000_000, "osmo")), diff --git a/contracts/entry-point/tests/test_user_swap.rs b/contracts/entry-point/tests/test_user_swap.rs index 5ffbc89f..4ebdb6f0 100644 --- a/contracts/entry-point/tests/test_user_swap.rs +++ b/contracts/entry-point/tests/test_user_swap.rs @@ -83,6 +83,7 @@ struct Params { pool: "pool".to_string(), denom_in: "un".to_string(), denom_out: "os".to_string(), + interface: None, } ], } @@ -101,6 +102,7 @@ struct Params { pool: "pool".to_string(), denom_in: "un".to_string(), denom_out: "os".to_string(), + interface: None, } ], }).unwrap(), @@ -125,6 +127,7 @@ struct Params { pool: "pool".to_string(), denom_in: "un".to_string(), denom_out: "os".to_string(), + interface: None, } ], } @@ -146,6 +149,7 @@ struct Params { pool: "pool".to_string(), denom_in: "un".to_string(), denom_out: "os".to_string(), + interface: None, } ], }).unwrap(), @@ -180,6 +184,7 @@ struct Params { pool: "pool".to_string(), denom_in: "neutron123".to_string(), denom_out: "os".to_string(), + interface: None, } ], } @@ -207,6 +212,7 @@ struct Params { pool: "pool".to_string(), denom_in: "neutron123".to_string(), denom_out: "os".to_string(), + interface: None, } ], }).unwrap(), @@ -242,6 +248,7 @@ struct Params { pool: "pool".to_string(), denom_in: "un".to_string(), denom_out: "os".to_string(), + interface: None, } ], } @@ -269,6 +276,7 @@ struct Params { pool: "pool".to_string(), denom_in: "un".to_string(), denom_out: "os".to_string(), + interface: None, } ], }).unwrap(), @@ -313,6 +321,7 @@ struct Params { pool: "pool".to_string(), denom_in: "un".to_string(), denom_out: "os".to_string(), + interface: None, } ], } @@ -334,6 +343,7 @@ struct Params { pool: "pool".to_string(), denom_in: "un".to_string(), denom_out: "os".to_string(), + interface: None, } ], }).unwrap(), @@ -358,6 +368,7 @@ struct Params { pool: "pool".to_string(), denom_in: "un".to_string(), denom_out: "os".to_string(), + interface: None, } ], refund_address: Some("refund_address".to_string()), @@ -387,6 +398,7 @@ struct Params { pool: "pool".to_string(), denom_in: "un".to_string(), denom_out: "os".to_string(), + interface: None, } ], }).unwrap(), @@ -411,6 +423,7 @@ struct Params { pool: "pool".to_string(), denom_in: "un".to_string(), denom_out: "os".to_string(), + interface: None, } ], refund_address: Some("refund_address".to_string()), @@ -445,6 +458,7 @@ struct Params { pool: "pool".to_string(), denom_in: "un".to_string(), denom_out: "os".to_string(), + interface: None, } ], }).unwrap(), @@ -479,6 +493,7 @@ struct Params { pool: "pool".to_string(), denom_in: "neutron123".to_string(), denom_out: "neutron987".to_string(), + interface: None, } ], refund_address: Some("refund_address".to_string()), @@ -524,6 +539,7 @@ struct Params { pool: "pool".to_string(), denom_in: "neutron123".to_string(), denom_out: "neutron987".to_string(), + interface: None, } ], }).unwrap(), @@ -563,6 +579,7 @@ struct Params { pool: "pool".to_string(), denom_in: "un".to_string(), denom_out: "os".to_string(), + interface: None, } ], refund_address: Some("refund_address".to_string()), @@ -601,6 +618,7 @@ struct Params { pool: "pool".to_string(), denom_in: "un".to_string(), denom_out: "os".to_string(), + interface: None, } ], }).unwrap(), @@ -645,6 +663,7 @@ struct Params { pool: "pool".to_string(), denom_in: "un".to_string(), denom_out: "os".to_string(), + interface: None, } ], refund_address: Some("refund_address".to_string()), @@ -679,6 +698,7 @@ struct Params { pool: "pool".to_string(), denom_in: "un".to_string(), denom_out: "os".to_string(), + interface: None, } ], }).unwrap(), @@ -703,6 +723,7 @@ struct Params { pool: "pool".to_string(), denom_in: "un".to_string(), denom_out: "os".to_string(), + interface: None, } ], refund_address: Some("refund_address".to_string()), @@ -722,6 +743,7 @@ struct Params { pool: "pool".to_string(), denom_in: "un".to_string(), denom_out: "os".to_string(), + interface: None, } ], }).unwrap(), @@ -746,6 +768,7 @@ struct Params { pool: "pool_2".to_string(), denom_in: "un".to_string(), denom_out: "ua".to_string(), + interface: None, } ], }, @@ -768,6 +791,7 @@ struct Params { pool: "pool_2".to_string(), denom_in: "uo".to_string(), denom_out: "os".to_string(), + interface: None, } ], }, @@ -806,6 +830,7 @@ struct Params { pool: "pool_2".to_string(), denom_in: "un".to_string(), denom_out: "ua".to_string(), + interface: None, } ], refund_address: Some("refund_address".to_string()), @@ -829,6 +854,7 @@ struct Params { pool: "pool_2".to_string(), denom_in: "os".to_string(), denom_out: "os".to_string(), + interface: None, } ], refund_address: Some("refund_address".to_string()), @@ -869,6 +895,7 @@ struct Params { pool: "pool".to_string(), denom_in: "un".to_string(), denom_out: "os".to_string(), + interface: None, } ], refund_address: None, @@ -892,6 +919,7 @@ struct Params { pool: "pool".to_string(), denom_in: "ua".to_string(), denom_out: "os".to_string(), + interface: None, } ], refund_address: Some("refund_address".to_string()), @@ -915,6 +943,7 @@ struct Params { pool: "pool".to_string(), denom_in: "un".to_string(), denom_out: "os".to_string(), + interface: None, } ], refund_address: Some("refund_address".to_string()), @@ -942,6 +971,7 @@ struct Params { pool: "pool".to_string(), denom_in: "neutron123".to_string(), denom_out: "os".to_string(), + interface: None, } ], refund_address: Some("refund_address".to_string()), @@ -988,6 +1018,7 @@ struct Params { pool: "pool".to_string(), denom_in: "un".to_string(), denom_out: "os".to_string(), + interface: None, }], }, Route { @@ -997,11 +1028,13 @@ struct Params { pool: "pool_2".to_string(), denom_in: "un".to_string(), denom_out: "neutron123".to_string(), + interface: None, }, SwapOperation { pool: "pool_3".to_string(), denom_in: "neutron123".to_string(), denom_out: "os".to_string(), + interface: None, }, ], }, @@ -1020,6 +1053,7 @@ struct Params { pool: "pool".to_string(), denom_in: "un".to_string(), denom_out: "os".to_string(), + interface: None, }], }) .unwrap(), @@ -1039,11 +1073,13 @@ struct Params { pool: "pool_2".to_string(), denom_in: "un".to_string(), denom_out: "neutron123".to_string(), + interface: None, }, SwapOperation { pool: "pool_3".to_string(), denom_in: "neutron123".to_string(), denom_out: "os".to_string(), + interface: None, }, ], }) @@ -1068,6 +1104,7 @@ struct Params { pool: "pool".to_string(), denom_in: "un".to_string(), denom_out: "os".to_string(), + interface: None, }], }, Route { @@ -1077,11 +1114,13 @@ struct Params { pool: "pool_2".to_string(), denom_in: "neutron123".to_string(), denom_out: "un".to_string(), + interface: None, }, SwapOperation { pool: "pool_3".to_string(), denom_in: "neutron123".to_string(), denom_out: "os".to_string(), + interface: None, }, ], }, @@ -1104,6 +1143,7 @@ struct Params { pool: "pool".to_string(), denom_in: "un".to_string(), denom_out: "os".to_string(), + interface: None, }], }, Route { @@ -1113,11 +1153,13 @@ struct Params { pool: "pool_2".to_string(), denom_in: "un".to_string(), denom_out: "neutron123".to_string(), + interface: None, }, SwapOperation { pool: "pool_3".to_string(), denom_in: "neutron123".to_string(), denom_out: "oa".to_string(), + interface: None, }, ], }, diff --git a/packages/skip/src/swap.rs b/packages/skip/src/swap.rs index 94f9d284..bf204e74 100644 --- a/packages/skip/src/swap.rs +++ b/packages/skip/src/swap.rs @@ -5,7 +5,7 @@ use std::{convert::TryFrom, num::ParseIntError}; use astroport::{asset::AssetInfo, router::SwapOperation as AstroportSwapOperation}; use cosmwasm_schema::{cw_serde, QueryResponses}; use cosmwasm_std::{ - Addr, Api, BankMsg, CosmosMsg, Decimal, DepsMut, Env, MessageInfo, Response, Uint128, + Addr, Api, BankMsg, Binary, CosmosMsg, Decimal, DepsMut, Env, MessageInfo, Response, Uint128, }; use cw20::Cw20Contract; use cw20::Cw20ReceiveMsg; @@ -144,6 +144,7 @@ pub struct SwapOperation { pub pool: String, pub denom_in: String, pub denom_out: String, + pub interface: Option, } // ASTROPORT CONVERSION @@ -353,6 +354,7 @@ mod tests { pool: "1".to_string(), denom_in: "ua".to_string(), denom_out: "uo".to_string(), + interface: None, }; let deps = mock_dependencies(); @@ -377,6 +379,7 @@ mod tests { pool: "1".to_string(), denom_in: "cwabc".to_string(), denom_out: "cw123".to_string(), + interface: None, }; let deps = mock_dependencies(); @@ -404,6 +407,7 @@ mod tests { pool: "1".to_string(), denom_in: "uatom".to_string(), denom_out: "uosmo".to_string(), + interface: None, }; let osmosis_swap_amount_in_route: OsmosisSwapAmountInRoute = @@ -422,6 +426,7 @@ mod tests { pool: "invalid".to_string(), denom_in: "uatom".to_string(), denom_out: "uosmo".to_string(), + interface: None, }; let result: Result = swap_operation.try_into(); @@ -440,6 +445,7 @@ mod tests { pool: "1".to_string(), denom_in: "uatom".to_string(), denom_out: "uosmo".to_string(), + interface: None, }; let osmosis_swap_amount_out_route: OsmosisSwapAmountOutRoute = @@ -458,6 +464,7 @@ mod tests { pool: "invalid".to_string(), denom_in: "uatom".to_string(), denom_out: "uosmo".to_string(), + interface: None, }; let result: Result = swap_operation.try_into(); @@ -477,11 +484,13 @@ mod tests { pool: "1".to_string(), denom_in: "uatom".to_string(), denom_out: "uosmo".to_string(), + interface: None, }, SwapOperation { pool: "2".to_string(), denom_in: "uosmo".to_string(), denom_out: "untrn".to_string(), + interface: None, }, ]; @@ -527,11 +536,13 @@ mod tests { pool: "invalid".to_string(), denom_in: "uatom".to_string(), denom_out: "uosmo".to_string(), + interface: None, }, SwapOperation { pool: "2".to_string(), denom_in: "uosmo".to_string(), denom_out: "untrn".to_string(), + interface: None, }, ]; @@ -562,11 +573,13 @@ mod tests { pool: "1".to_string(), denom_in: "uatom".to_string(), denom_out: "uosmo".to_string(), + interface: None, }, SwapOperation { pool: "2".to_string(), denom_in: "uosmo".to_string(), denom_out: "untrn".to_string(), + interface: None, }, ]; @@ -594,11 +607,13 @@ mod tests { pool: "1".to_string(), denom_in: "uosmo".to_string(), denom_out: "uatom".to_string(), + interface: None, }, SwapOperation { pool: "2".to_string(), denom_in: "uatom".to_string(), denom_out: "untrn".to_string(), + interface: None, }, ]; @@ -619,11 +634,13 @@ mod tests { pool: "1".to_string(), denom_in: "uatom".to_string(), denom_out: "uosmo".to_string(), + interface: None, }, SwapOperation { pool: "2".to_string(), denom_in: "uosmo".to_string(), denom_out: "uatom".to_string(), + interface: None, }, ]; diff --git a/schema/raw/execute.json b/schema/raw/execute.json index 2c93ff9e..ac2deb06 100644 --- a/schema/raw/execute.json +++ b/schema/raw/execute.json @@ -582,6 +582,16 @@ "denom_out": { "type": "string" }, + "interface": { + "anyOf": [ + { + "$ref": "#/definitions/Binary" + }, + { + "type": "null" + } + ] + }, "pool": { "type": "string" } diff --git a/schema/skip-api-entry-point.json b/schema/skip-api-entry-point.json index 7100d15a..45b26885 100644 --- a/schema/skip-api-entry-point.json +++ b/schema/skip-api-entry-point.json @@ -627,6 +627,16 @@ "denom_out": { "type": "string" }, + "interface": { + "anyOf": [ + { + "$ref": "#/definitions/Binary" + }, + { + "type": "null" + } + ] + }, "pool": { "type": "string" }