From 33a9cfc1bd1e9d505766fbdc4072076405b0aa39 Mon Sep 17 00:00:00 2001 From: Aleksandr Pismenskiy Date: Thu, 20 Jun 2024 14:47:46 +0300 Subject: [PATCH 1/3] remove creator and receiver fields from estimateXX dex query messages --- Cargo.lock | 10 ++- Cargo.toml | 2 +- contracts/balance-tracker/Cargo.toml | 2 +- contracts/dex/schema/dex_query.json | 16 ---- .../dex_stargate/schema/execute_msg.json | 6 +- contracts/dex_stargate/schema/query_msg.json | 16 ---- contracts/dex_stargate/src/contract.rs | 8 -- contracts/dex_stargate/src/msg.rs | 4 - .../marketmap/schema/market_map_query.json | 80 +++++++++++++++++++ .../marketmap/schema/marketmap_query.json | 43 ---------- contracts/oracle/schema/oracle_query.json | 17 ++-- contracts/reflect/schema/execute_msg.json | 8 +- 12 files changed, 107 insertions(+), 105 deletions(-) create mode 100644 contracts/marketmap/schema/market_map_query.json delete mode 100644 contracts/marketmap/schema/marketmap_query.json diff --git a/Cargo.lock b/Cargo.lock index 4e941ac..dc4b728 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -21,10 +21,11 @@ checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "astroport" -version = "4.0.3" -source = "git+https://github.com/astroport-fi/astroport-core#a0a71af801be3f72c64b81f798e1b0805cf0f594" +version = "5.0.0" +source = "git+https://github.com/astroport-fi/astroport-core#4b3bff8626d33ef5cc3ce40f68939cb84b50fda1" dependencies = [ "astroport-circular-buffer", + "cosmos-sdk-proto 0.19.0", "cosmwasm-schema", "cosmwasm-std", "cw-asset", @@ -32,13 +33,14 @@ dependencies = [ "cw-utils", "cw20", "itertools 0.12.1", + "prost 0.11.9", "uint", ] [[package]] name = "astroport-circular-buffer" version = "0.2.0" -source = "git+https://github.com/astroport-fi/astroport-core#a0a71af801be3f72c64b81f798e1b0805cf0f594" +source = "git+https://github.com/astroport-fi/astroport-core#4b3bff8626d33ef5cc3ce40f68939cb84b50fda1" dependencies = [ "cosmwasm-schema", "cosmwasm-std", @@ -723,7 +725,7 @@ dependencies = [ [[package]] name = "neutron-sdk" version = "0.10.0" -source = "git+https://github.com/neutron-org/neutron-sdk?branch=main#f45c35de07f102397447d168420c49fbcb19971d" +source = "git+https://github.com/neutron-org/neutron-sdk?rev=2a68d5ea8d472a02998006a13b66e08a615b5afa#2a68d5ea8d472a02998006a13b66e08a615b5afa" dependencies = [ "bech32", "cosmos-sdk-proto 0.20.0", diff --git a/Cargo.toml b/Cargo.toml index a1fd77c..a6238d7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ incremental = false overflow-checks = true [workspace.dependencies] -neutron-sdk = { package = "neutron-sdk", git = "https://github.com/neutron-org/neutron-sdk", branch = "main" } +neutron-sdk = { package = "neutron-sdk", git = "https://github.com/neutron-org/neutron-sdk", rev = "2a68d5ea8d472a02998006a13b66e08a615b5afa" } prost = "0.12.4" prost-types = "0.12.4" cosmos-sdk-proto = { version = "0.20.0", default-features = false } diff --git a/contracts/balance-tracker/Cargo.toml b/contracts/balance-tracker/Cargo.toml index 1297d80..10287d4 100644 --- a/contracts/balance-tracker/Cargo.toml +++ b/contracts/balance-tracker/Cargo.toml @@ -27,4 +27,4 @@ cosmwasm-std = "1.5" cw-storage-plus = "1.2" cosmwasm-schema = "1.5" thiserror = "1" -astroport = { git = "https://github.com/astroport-fi/astroport-core", version = "4" } +astroport = { git = "https://github.com/astroport-fi/astroport-core", version = "5" } diff --git a/contracts/dex/schema/dex_query.json b/contracts/dex/schema/dex_query.json index 61bd90c..3a1e1df 100644 --- a/contracts/dex/schema/dex_query.json +++ b/contracts/dex/schema/dex_query.json @@ -376,28 +376,20 @@ "type": "object", "required": [ "amount_in", - "creator", "exit_limit_price", "pick_best_route", - "receiver", "routes" ], "properties": { "amount_in": { "$ref": "#/definitions/Int128" }, - "creator": { - "type": "string" - }, "exit_limit_price": { "$ref": "#/definitions/PrecDec" }, "pick_best_route": { "type": "boolean" }, - "receiver": { - "type": "string" - }, "routes": { "type": "array", "items": { @@ -420,9 +412,7 @@ "type": "object", "required": [ "amount_in", - "creator", "order_type", - "receiver", "tick_index_in_to_out", "token_in", "token_out" @@ -431,9 +421,6 @@ "amount_in": { "$ref": "#/definitions/Int128" }, - "creator": { - "type": "string" - }, "expiration_time": { "type": [ "integer", @@ -455,9 +442,6 @@ "order_type": { "$ref": "#/definitions/LimitOrderType" }, - "receiver": { - "type": "string" - }, "tick_index_in_to_out": { "type": "integer", "format": "int64" diff --git a/contracts/dex_stargate/schema/execute_msg.json b/contracts/dex_stargate/schema/execute_msg.json index 4fb2dd9..885ef9d 100644 --- a/contracts/dex_stargate/schema/execute_msg.json +++ b/contracts/dex_stargate/schema/execute_msg.json @@ -266,12 +266,16 @@ "DepositOptions": { "type": "object", "required": [ - "disable_autoswap" + "disable_autoswap", + "fail_tx_on_bel" ], "properties": { "disable_autoswap": { "description": "Autoswap provides a mechanism for users to deposit the entirety of their specified deposit amounts by paying a small fee. By default the `autoswap` option is enabled.", "type": "boolean" + }, + "fail_tx_on_bel": { + "type": "boolean" } } } diff --git a/contracts/dex_stargate/schema/query_msg.json b/contracts/dex_stargate/schema/query_msg.json index 80e2940..167cff4 100644 --- a/contracts/dex_stargate/schema/query_msg.json +++ b/contracts/dex_stargate/schema/query_msg.json @@ -367,28 +367,20 @@ "type": "object", "required": [ "amount_in", - "creator", "exit_limit_price", "pick_best_route", - "receiver", "routes" ], "properties": { "amount_in": { "type": "string" }, - "creator": { - "type": "string" - }, "exit_limit_price": { "type": "string" }, "pick_best_route": { "type": "boolean" }, - "receiver": { - "type": "string" - }, "routes": { "type": "array", "items": { @@ -413,9 +405,7 @@ "type": "object", "required": [ "amount_in", - "creator", "order_type", - "receiver", "tick_index_in_to_out", "token_in", "token_out" @@ -424,9 +414,6 @@ "amount_in": { "type": "string" }, - "creator": { - "type": "string" - }, "expiration_time": { "type": [ "integer", @@ -444,9 +431,6 @@ "type": "integer", "format": "int32" }, - "receiver": { - "type": "string" - }, "tick_index_in_to_out": { "type": "integer", "format": "int64" diff --git a/contracts/dex_stargate/src/contract.rs b/contracts/dex_stargate/src/contract.rs index 7a8e314..156be88 100644 --- a/contracts/dex_stargate/src/contract.rs +++ b/contracts/dex_stargate/src/contract.rs @@ -299,8 +299,6 @@ pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult { )?)?), QueryMsg::EstimateMultiHopSwap { - creator, - receiver, routes, amount_in, exit_limit_price, @@ -308,8 +306,6 @@ pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult { } => Ok(to_json_binary(&get_estimate_multi_hop_swap( deps, EstimateMultiHopSwapRequest { - creator, - receiver, routes, amount_in, exit_limit_price, @@ -318,8 +314,6 @@ pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult { )?)?), QueryMsg::EstimatePlaceLimitOrder { - creator, - receiver, token_in, token_out, tick_index_in_to_out, @@ -330,8 +324,6 @@ pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult { } => Ok(to_json_binary(&get_estimate_place_limit_order( deps, EstimatePlaceLimitOrderRequest { - creator, - receiver, token_in, token_out, tick_index_in_to_out, diff --git a/contracts/dex_stargate/src/msg.rs b/contracts/dex_stargate/src/msg.rs index b6c06fc..1030fca 100644 --- a/contracts/dex_stargate/src/msg.rs +++ b/contracts/dex_stargate/src/msg.rs @@ -111,16 +111,12 @@ pub enum QueryMsg { fee: u64, }, EstimateMultiHopSwap { - creator: String, - receiver: String, routes: Vec>, amount_in: String, exit_limit_price: String, pick_best_route: bool, }, EstimatePlaceLimitOrder { - creator: String, - receiver: String, token_in: String, token_out: String, tick_index_in_to_out: i64, diff --git a/contracts/marketmap/schema/market_map_query.json b/contracts/marketmap/schema/market_map_query.json new file mode 100644 index 0000000..7165aeb --- /dev/null +++ b/contracts/marketmap/schema/market_map_query.json @@ -0,0 +1,80 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "MarketMapQuery", + "oneOf": [ + { + "description": "Parameters queries the parameters of the module.", + "type": "object", + "required": [ + "params" + ], + "properties": { + "params": { + "type": "object" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "last_updated" + ], + "properties": { + "last_updated": { + "type": "object" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "market_map" + ], + "properties": { + "market_map": { + "type": "object" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "market" + ], + "properties": { + "market": { + "type": "object", + "required": [ + "currency_pair" + ], + "properties": { + "currency_pair": { + "$ref": "#/definitions/CurrencyPair" + } + } + } + }, + "additionalProperties": false + } + ], + "definitions": { + "CurrencyPair": { + "type": "object", + "required": [ + "Base", + "Quote" + ], + "properties": { + "Base": { + "type": "string" + }, + "Quote": { + "type": "string" + } + } + } + } +} diff --git a/contracts/marketmap/schema/marketmap_query.json b/contracts/marketmap/schema/marketmap_query.json deleted file mode 100644 index 2c57a0b..0000000 --- a/contracts/marketmap/schema/marketmap_query.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "MarketmapQuery", - "oneOf": [ - { - "description": "Parameters queries the parameters of the module.", - "type": "object", - "required": [ - "params" - ], - "properties": { - "params": { - "type": "object" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "get_last_updated_request" - ], - "properties": { - "get_last_updated_request": { - "type": "object" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "get_market_map_request" - ], - "properties": { - "get_market_map_request": { - "type": "object" - } - }, - "additionalProperties": false - } - ] -} diff --git a/contracts/oracle/schema/oracle_query.json b/contracts/oracle/schema/oracle_query.json index 5bbc3bc..fd1d550 100644 --- a/contracts/oracle/schema/oracle_query.json +++ b/contracts/oracle/schema/oracle_query.json @@ -3,7 +3,6 @@ "title": "OracleQuery", "oneOf": [ { - "description": "Parameters queries the parameters of the module.", "type": "object", "required": [ "get_all_currency_pairs" @@ -18,10 +17,10 @@ { "type": "object", "required": [ - "get_price_request" + "get_price" ], "properties": { - "get_price_request": { + "get_price": { "type": "object", "required": [ "currency_pair" @@ -38,10 +37,10 @@ { "type": "object", "required": [ - "get_prices_request" + "get_prices" ], "properties": { - "get_prices_request": { + "get_prices": { "type": "object", "required": [ "currency_pair_ids" @@ -63,14 +62,14 @@ "CurrencyPair": { "type": "object", "required": [ - "base", - "quote" + "Base", + "Quote" ], "properties": { - "base": { + "Base": { "type": "string" }, - "quote": { + "Quote": { "type": "string" } } diff --git a/contracts/reflect/schema/execute_msg.json b/contracts/reflect/schema/execute_msg.json index 547a526..3ef3fa3 100644 --- a/contracts/reflect/schema/execute_msg.json +++ b/contracts/reflect/schema/execute_msg.json @@ -70,7 +70,8 @@ "additionalProperties": false }, { - "description": "Proposal to upgrade IBC client", + "description": "Depreacteed Proposal to upgrade IBC client", + "deprecated": true, "type": "object", "required": [ "upgrade_proposal" @@ -83,7 +84,8 @@ "additionalProperties": false }, { - "description": "Proposal to update IBC client", + "description": "Deprecated. Proposal to update IBC client", + "deprecated": true, "type": "object", "required": [ "client_update_proposal" @@ -314,6 +316,7 @@ }, "ClientUpdateProposal": { "description": "ClientUpdateProposal defines the struct for client update proposal.", + "deprecated": true, "type": "object", "required": [ "description", @@ -2220,6 +2223,7 @@ }, "UpgradeProposal": { "description": "UpgradeProposal defines the struct for IBC upgrade proposal.", + "deprecated": true, "type": "object", "required": [ "description", From 6acdb96ad12a56d8304c3875d1a94a272b471830 Mon Sep 17 00:00:00 2001 From: Julian Compagni Portis Date: Thu, 25 Jul 2024 15:47:49 -0400 Subject: [PATCH 2/3] fix neutron-sdk dep --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 41b9f5e..743cb14 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -823,8 +823,8 @@ dependencies = [ [[package]] name = "neutron-sdk" -version = "0.10.0" -source = "git+https://github.com/neutron-org/neutron-sdk?branch=feat/fix_estimateXX#76c4b858b26775bb8c655fa5945922db81375369" +version = "0.11.0" +source = "git+https://github.com/neutron-org/neutron-sdk?rev=76c4b858b26775bb8c655fa5945922db81375369#76c4b858b26775bb8c655fa5945922db81375369" dependencies = [ "bech32", "cosmos-sdk-proto 0.20.0", diff --git a/Cargo.toml b/Cargo.toml index bb45629..3e6dd8c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ incremental = false overflow-checks = true [workspace.dependencies] -neutron-sdk = { package = "neutron-sdk", git = "https://github.com/neutron-org/neutron-sdk", rev = "2a68d5ea8d472a02998006a13b66e08a615b5afa" } +neutron-sdk = { package = "neutron-sdk", git = "https://github.com/neutron-org/neutron-sdk", rev = "76c4b858b26775bb8c655fa5945922db81375369" } prost = "0.12.4" prost-types = "0.12.4" cosmos-sdk-proto = { version = "0.20.0", default-features = false } From b55e63ac59fe8734d541718499752686da95ce51 Mon Sep 17 00:00:00 2001 From: Julian Compagni Portis Date: Thu, 25 Jul 2024 16:05:39 -0400 Subject: [PATCH 3/3] pin cosmwasm-check version in makefile --- Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 5458820..018c241 100644 --- a/Makefile +++ b/Makefile @@ -13,13 +13,13 @@ fmt: compile: @docker run --rm -v "$(CURDIR)":/code \ - --mount type=volume,source="$(notdir $(CURDIR))_cache",target=/target \ - --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ - --platform linux/amd64 \ - cosmwasm/workspace-optimizer:0.15.0 + --mount type=volume,source="$(notdir $(CURDIR))_cache",target=/target \ + --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ + --platform linux/amd64 \ + cosmwasm/workspace-optimizer:0.15.0 check_contracts: - @cargo install cosmwasm-check --locked + @cargo install cosmwasm-check --version 2.0.4 --locked @cosmwasm-check --available-capabilities iterator,staking,stargate,neutron,cosmwasm_1_1,cosmwasm_1_2 artifacts/*.wasm build: schema clippy test fmt compile check_contracts