From 452422ebdc887595ff25296d6ec4ad78faeaa6f3 Mon Sep 17 00:00:00 2001 From: pr0n00gler Date: Thu, 31 Oct 2024 13:23:39 +0200 Subject: [PATCH 1/3] respect gogoproto nullable --- Cargo.lock | 6 +++--- Cargo.toml | 4 ++-- contracts/dex_grpc/src/contract.rs | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c068646..7a883a9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1128,7 +1128,7 @@ dependencies = [ [[package]] name = "neutron-sdk" version = "0.11.0" -source = "git+https://github.com/neutron-org/neutron-sdk?branch=main#b83c182e8688f826c313cae318ff8ae908b87c81" +source = "git+https://github.com/neutron-org/neutron-sdk?branch=feat/respect-gogoproto-nullable#0a2b67e66008bd9bb716513fca0257e0ecd4754d" dependencies = [ "bech32 0.9.1", "chrono", @@ -1152,7 +1152,7 @@ dependencies = [ [[package]] name = "neutron-std" version = "5.0.0" -source = "git+https://github.com/neutron-org/neutron-std?branch=main#25e0d0c1e7f56d40ba62908d9e2c03b5d3779bd2" +source = "git+https://github.com/neutron-org/neutron-std?branch=feat/respect-gogoproto-nullable#dbfee8680e62a17840c9251e02e1fcf3ee2a71f3" dependencies = [ "bech32 0.9.1", "chrono", @@ -1176,7 +1176,7 @@ dependencies = [ [[package]] name = "neutron-std-derive" version = "0.20.1" -source = "git+https://github.com/neutron-org/neutron-std?branch=main#25e0d0c1e7f56d40ba62908d9e2c03b5d3779bd2" +source = "git+https://github.com/neutron-org/neutron-std?branch=feat/respect-gogoproto-nullable#dbfee8680e62a17840c9251e02e1fcf3ee2a71f3" dependencies = [ "itertools 0.10.5", "proc-macro2", diff --git a/Cargo.toml b/Cargo.toml index f9dfd2f..5ce2580 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,8 +13,8 @@ incremental = false overflow-checks = true [workspace.dependencies] -neutron-sdk = { package = "neutron-sdk", git = "https://github.com/neutron-org/neutron-sdk", branch = "main" } -neutron-std = { git = "https://github.com/neutron-org/neutron-std", branch = "main" } +neutron-sdk = { package = "neutron-sdk", git = "https://github.com/neutron-org/neutron-sdk", branch = "feat/respect-gogoproto-nullable" } +neutron-std = { git = "https://github.com/neutron-org/neutron-std", branch = "feat/respect-gogoproto-nullable" } prost = "0.12.4" prost-types = "0.12.4" diff --git a/contracts/dex_grpc/src/contract.rs b/contracts/dex_grpc/src/contract.rs index 00dba8f..bccba8f 100644 --- a/contracts/dex_grpc/src/contract.rs +++ b/contracts/dex_grpc/src/contract.rs @@ -88,12 +88,12 @@ pub fn execute( token_in, token_out, tick_index_in_to_out, - limit_sell_price, + limit_sell_price: Some(limit_sell_price), amount_in, order_type, expiration_time, - max_amount_out, - min_average_sell_price: "".to_string(), + max_amount_out: Some(max_amount_out), + min_average_sell_price: None, })), ExecuteMsg::WithdrawFilledLimitOrder { tranche_key } => { Ok(Response::new().add_message(MsgWithdrawFilledLimitOrder { From dd3d3464bd43aaf352b8973c1fdc39f5ce9762a2 Mon Sep 17 00:00:00 2001 From: pr0n00gler Date: Thu, 31 Oct 2024 19:23:53 +0200 Subject: [PATCH 2/3] fix --- contracts/dex_grpc/schema/execute_msg.json | 6 ++++-- contracts/dex_grpc/schema/query_msg.json | 18 ++++++++++++------ contracts/dex_grpc/src/contract.rs | 2 +- contracts/dex_grpc/src/msg.rs | 2 +- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/contracts/dex_grpc/schema/execute_msg.json b/contracts/dex_grpc/schema/execute_msg.json index 415e13e..7480276 100644 --- a/contracts/dex_grpc/schema/execute_msg.json +++ b/contracts/dex_grpc/schema/execute_msg.json @@ -133,7 +133,6 @@ "required": [ "amount_in", "limit_sell_price", - "max_amount_out", "order_type", "receiver", "tick_index_in_to_out", @@ -158,7 +157,10 @@ "type": "string" }, "max_amount_out": { - "type": "string" + "type": [ + "string", + "null" + ] }, "order_type": { "type": "integer", diff --git a/contracts/dex_grpc/schema/query_msg.json b/contracts/dex_grpc/schema/query_msg.json index 7122ae1..b64a27a 100644 --- a/contracts/dex_grpc/schema/query_msg.json +++ b/contracts/dex_grpc/schema/query_msg.json @@ -840,9 +840,6 @@ "required": [ "amount_in", "creator", - "limit_sell_price", - "max_amount_out", - "min_average_sell_price", "order_type", "receiver", "tick_index_in_to_out", @@ -868,14 +865,23 @@ ] }, "limit_sell_price": { - "type": "string" + "type": [ + "string", + "null" + ] }, "max_amount_out": { - "type": "string" + "type": [ + "string", + "null" + ] }, "min_average_sell_price": { "description": "min_average_sell_price is an optional parameter that sets a required minimum average price for the entire trade. if the min_average_sell_price is not met the trade will fail. If min_average_sell_price is omitted limit_sell_price will be used instead", - "type": "string" + "type": [ + "string", + "null" + ] }, "order_type": { "type": "integer", diff --git a/contracts/dex_grpc/src/contract.rs b/contracts/dex_grpc/src/contract.rs index bccba8f..df4272e 100644 --- a/contracts/dex_grpc/src/contract.rs +++ b/contracts/dex_grpc/src/contract.rs @@ -92,7 +92,7 @@ pub fn execute( amount_in, order_type, expiration_time, - max_amount_out: Some(max_amount_out), + max_amount_out, min_average_sell_price: None, })), ExecuteMsg::WithdrawFilledLimitOrder { tranche_key } => { diff --git a/contracts/dex_grpc/src/msg.rs b/contracts/dex_grpc/src/msg.rs index 27aafb5..061c43f 100644 --- a/contracts/dex_grpc/src/msg.rs +++ b/contracts/dex_grpc/src/msg.rs @@ -39,7 +39,7 @@ pub enum ExecuteMsg { amount_in: String, order_type: i32, expiration_time: Option, - max_amount_out: String, + max_amount_out: Option, limit_sell_price: String, }, WithdrawFilledLimitOrder { From be73db3ba02bfd97534a84f799a03918e518576c Mon Sep 17 00:00:00 2001 From: pr0n00gler Date: Mon, 11 Nov 2024 15:42:27 +0200 Subject: [PATCH 3/3] upd deps --- Cargo.lock | 6 +++--- Cargo.toml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7a883a9..6406a7e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1128,7 +1128,7 @@ dependencies = [ [[package]] name = "neutron-sdk" version = "0.11.0" -source = "git+https://github.com/neutron-org/neutron-sdk?branch=feat/respect-gogoproto-nullable#0a2b67e66008bd9bb716513fca0257e0ecd4754d" +source = "git+https://github.com/neutron-org/neutron-sdk?branch=main#3c831143e4eb7998433322e85f167c88166d087f" dependencies = [ "bech32 0.9.1", "chrono", @@ -1152,7 +1152,7 @@ dependencies = [ [[package]] name = "neutron-std" version = "5.0.0" -source = "git+https://github.com/neutron-org/neutron-std?branch=feat/respect-gogoproto-nullable#dbfee8680e62a17840c9251e02e1fcf3ee2a71f3" +source = "git+https://github.com/neutron-org/neutron-std?branch=main#b17f083c0617dab1daa5c6dfb69bc63255006499" dependencies = [ "bech32 0.9.1", "chrono", @@ -1176,7 +1176,7 @@ dependencies = [ [[package]] name = "neutron-std-derive" version = "0.20.1" -source = "git+https://github.com/neutron-org/neutron-std?branch=feat/respect-gogoproto-nullable#dbfee8680e62a17840c9251e02e1fcf3ee2a71f3" +source = "git+https://github.com/neutron-org/neutron-std?branch=main#b17f083c0617dab1daa5c6dfb69bc63255006499" dependencies = [ "itertools 0.10.5", "proc-macro2", diff --git a/Cargo.toml b/Cargo.toml index 5ce2580..f9dfd2f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,8 +13,8 @@ incremental = false overflow-checks = true [workspace.dependencies] -neutron-sdk = { package = "neutron-sdk", git = "https://github.com/neutron-org/neutron-sdk", branch = "feat/respect-gogoproto-nullable" } -neutron-std = { git = "https://github.com/neutron-org/neutron-std", branch = "feat/respect-gogoproto-nullable" } +neutron-sdk = { package = "neutron-sdk", git = "https://github.com/neutron-org/neutron-sdk", branch = "main" } +neutron-std = { git = "https://github.com/neutron-org/neutron-std", branch = "main" } prost = "0.12.4" prost-types = "0.12.4"