Skip to content

Commit

Permalink
Merge pull request #72 from neutron-org/feat/respect-gogoproto-nullable
Browse files Browse the repository at this point in the history
Feat: respect gogoproto nullable
  • Loading branch information
pr0n00gler authored Nov 18, 2024
2 parents f81c62d + be73db3 commit 1baf105
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 14 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions contracts/dex_grpc/schema/execute_msg.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@
"required": [
"amount_in",
"limit_sell_price",
"max_amount_out",
"order_type",
"receiver",
"tick_index_in_to_out",
Expand All @@ -158,7 +157,10 @@
"type": "string"
},
"max_amount_out": {
"type": "string"
"type": [
"string",
"null"
]
},
"order_type": {
"type": "integer",
Expand Down
18 changes: 12 additions & 6 deletions contracts/dex_grpc/schema/query_msg.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions contracts/dex_grpc/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
min_average_sell_price: None,
})),
ExecuteMsg::WithdrawFilledLimitOrder { tranche_key } => {
Ok(Response::new().add_message(MsgWithdrawFilledLimitOrder {
Expand Down
2 changes: 1 addition & 1 deletion contracts/dex_grpc/src/msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub enum ExecuteMsg {
amount_in: String,
order_type: i32,
expiration_time: Option<Timestamp>,
max_amount_out: String,
max_amount_out: Option<String>,
limit_sell_price: String,
},
WithdrawFilledLimitOrder {
Expand Down

0 comments on commit 1baf105

Please sign in to comment.