From b222d12f2cf21903b777aeea8b0ce33029a4521e Mon Sep 17 00:00:00 2001 From: politeWall <138504353+politeWall@users.noreply.github.com> Date: Tue, 19 Dec 2023 17:56:12 +0100 Subject: [PATCH] fix: estimation query --- Cargo.lock | 10 +++++----- Cargo.toml | 8 ++++---- front_end_script/README.md | 4 ++-- src/action/query/margin_open_estimation.rs | 2 +- src/action/query/swap_estimation_by_denom.rs | 2 +- src/msg/query_msg.rs | 4 ++-- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9d2f0f7..5e525e0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -371,8 +371,8 @@ dependencies = [ [[package]] name = "elys-bindings" -version = "0.10.1" -source = "git+https://github.com/elys-network/bindings?tag=v0.10.1#5075e89a59890871cae660d545f94480c3d75b8f" +version = "0.0.0" +source = "git+https://github.com/elys-network/bindings?tag=v0.11.0#a88d0d958033460272e5848f59510ddd879a4142" dependencies = [ "cosmwasm-schema", "cosmwasm-std", @@ -381,8 +381,8 @@ dependencies = [ [[package]] name = "elys-bindings-test" -version = "0.10.1" -source = "git+https://github.com/elys-network/bindings?tag=v0.10.1#5075e89a59890871cae660d545f94480c3d75b8f" +version = "0.0.0" +source = "git+https://github.com/elys-network/bindings?tag=v0.11.0#a88d0d958033460272e5848f59510ddd879a4142" dependencies = [ "anyhow", "cosmwasm-schema", @@ -787,7 +787,7 @@ dependencies = [ [[package]] name = "trade_shield_contract" -version = "0.12.1" +version = "0.13.0" dependencies = [ "cosmwasm-schema", "cosmwasm-std", diff --git a/Cargo.toml b/Cargo.toml index f02c3ad..80dc8a6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "trade_shield_contract" -version = "0.12.1" +version = "0.13.0" edition = "2021" [lib] @@ -14,13 +14,13 @@ thiserror = "1" schemars = "0.8.1" cosmwasm-schema = "1.1.4" cw-utils = "0.13" -elys-bindings = { version = "0.10.1", git = "https://github.com/elys-network/bindings", tag = "v0.10.1" } +elys-bindings = { git = "https://github.com/elys-network/bindings", tag = "v0.11.0" } [dev-dependencies] cw-multi-test = "0.13.4" serde_json = "1.0.107" -elys-bindings = { version = "0.10.1", git = "https://github.com/elys-network/bindings", tag = "v0.10.1", features = [ +elys-bindings = { git = "https://github.com/elys-network/bindings", tag = "v0.11.0", features = [ "testing", ] } -elys-bindings-test = { version = "0.10.1", git = "https://github.com/elys-network/bindings", tag = "v0.10.1" } +elys-bindings-test = { git = "https://github.com/elys-network/bindings", tag = "v0.11.0" } diff --git a/front_end_script/README.md b/front_end_script/README.md index 66b2b43..833b21d 100644 --- a/front_end_script/README.md +++ b/front_end_script/README.md @@ -285,7 +285,7 @@ This function retrieves an estimation of the value obtained by swapping one asse - `amount` {Coin} : the amount of the value that you want to send or recive. - `denom_in` (String) : The asset that you will send. - `denom_out` (String) : The asset that you will recive. -- `user_address` (String): user_address to calculate the discount that the user have access +- `user_address` (String or null): user_address to calculate the discount that the user have access #### Usage @@ -343,7 +343,7 @@ this function query an estimation on opening a MarginPosition. - `trading_asset` (String): The trading asset - `collateral` (Coin {`denom`: String, `amount`: String}) The amount that the user would like to send as a collateral - `take_profit_price` (String): the take profit price for the open position -- `user_address` (String): user_address to calculate the discount that the user have access +- `user_address` (String or null): user_address to calculate the discount that the user have access #### Usage diff --git a/src/action/query/margin_open_estimation.rs b/src/action/query/margin_open_estimation.rs index e51e0e7..209b1de 100644 --- a/src/action/query/margin_open_estimation.rs +++ b/src/action/query/margin_open_estimation.rs @@ -9,7 +9,7 @@ pub fn margin_open_estimation( trading_asset: String, collateral: Coin, take_profit_price: Decimal, - _user_address: String, // Parameter unused until account history work + _user_address: Option, // Parameter unused until account history work ) -> StdResult { let querier = ElysQuerier::new(&deps.querier); diff --git a/src/action/query/swap_estimation_by_denom.rs b/src/action/query/swap_estimation_by_denom.rs index 204e679..be6f1cc 100644 --- a/src/action/query/swap_estimation_by_denom.rs +++ b/src/action/query/swap_estimation_by_denom.rs @@ -6,7 +6,7 @@ pub fn swap_estimation_by_denom( amount: Coin, denom_in: String, denom_out: String, - _user_address: String, + _user_address: Option, // Parameter unused until account history work ) -> Result { let querier = ElysQuerier::new(&deps.querier); diff --git a/src/msg/query_msg.rs b/src/msg/query_msg.rs index ff7b4e6..ed0a78b 100644 --- a/src/msg/query_msg.rs +++ b/src/msg/query_msg.rs @@ -37,7 +37,7 @@ pub enum QueryMsg { amount: Coin, denom_in: String, denom_out: String, - user_address: String, + user_address: Option, }, #[returns(MarginMtpResponse)] GetMarginPosition { id: u64, address: String }, @@ -50,6 +50,6 @@ pub enum QueryMsg { trading_asset: String, collateral: Coin, take_profit_price: Decimal, - user_address: String, + user_address: Option, }, }