Skip to content

Commit

Permalink
Remove deny_unknown_fields for auction order in solvers-dto
Browse files Browse the repository at this point in the history
  • Loading branch information
m-lord-renkse committed Apr 23, 2024
1 parent b482f79 commit 43d57b6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
28 changes: 14 additions & 14 deletions crates/solvers-dto/src/auction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use {

#[serde_as]
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase", deny_unknown_fields)]
#[serde(rename_all = "camelCase")]
pub struct Auction {
#[serde_as(as = "Option<DisplayFromStr>")]
pub id: Option<i64>,
Expand All @@ -24,7 +24,7 @@ pub struct Auction {

#[serde_as]
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase", deny_unknown_fields)]
#[serde(rename_all = "camelCase")]
pub struct Order {
#[serde_as(as = "serialize::Hex")]
pub uid: [u8; 56],
Expand Down Expand Up @@ -56,7 +56,7 @@ pub enum Class {
}

#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase", deny_unknown_fields)]
#[serde(rename_all = "camelCase")]
pub enum FeePolicy {
#[serde(rename_all = "camelCase")]
Surplus { factor: f64, max_volume_factor: f64 },
Expand All @@ -72,7 +72,7 @@ pub enum FeePolicy {

#[serde_as]
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase", deny_unknown_fields)]
#[serde(rename_all = "camelCase")]
pub struct Quote {
#[serde_as(as = "HexOrDecimalU256")]
pub sell_amount: U256,
Expand All @@ -84,7 +84,7 @@ pub struct Quote {

#[serde_as]
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase", deny_unknown_fields)]
#[serde(rename_all = "camelCase")]
pub struct Token {
pub decimals: Option<u8>,
pub symbol: Option<String>,
Expand All @@ -97,7 +97,7 @@ pub struct Token {

#[allow(clippy::enum_variant_names)]
#[derive(Debug, Deserialize)]
#[serde(tag = "kind", rename_all = "camelCase", deny_unknown_fields)]
#[serde(tag = "kind", rename_all = "camelCase")]
pub enum Liquidity {
ConstantProduct(ConstantProductPool),
WeightedProduct(WeightedProductPool),
Expand All @@ -108,7 +108,7 @@ pub enum Liquidity {

#[serde_as]
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase", deny_unknown_fields)]
#[serde(rename_all = "camelCase")]
pub struct ConstantProductPool {
pub id: String,
pub address: H160,
Expand All @@ -121,15 +121,15 @@ pub struct ConstantProductPool {

#[serde_as]
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase", deny_unknown_fields)]
#[serde(rename_all = "camelCase")]
pub struct ConstantProductReserve {
#[serde_as(as = "HexOrDecimalU256")]
pub balance: U256,
}

#[serde_as]
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase", deny_unknown_fields)]
#[serde(rename_all = "camelCase")]
pub struct WeightedProductPool {
pub id: String,
pub address: H160,
Expand All @@ -143,7 +143,7 @@ pub struct WeightedProductPool {

#[serde_as]
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase", deny_unknown_fields)]
#[serde(rename_all = "camelCase")]
pub struct WeightedProductReserve {
#[serde_as(as = "HexOrDecimalU256")]
pub balance: U256,
Expand All @@ -160,7 +160,7 @@ pub enum WeightedProductVersion {

#[serde_as]
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase", deny_unknown_fields)]
#[serde(rename_all = "camelCase")]
pub struct StablePool {
pub id: String,
pub address: H160,
Expand All @@ -174,7 +174,7 @@ pub struct StablePool {

#[serde_as]
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase", deny_unknown_fields)]
#[serde(rename_all = "camelCase")]
pub struct StableReserve {
#[serde_as(as = "HexOrDecimalU256")]
pub balance: U256,
Expand All @@ -183,7 +183,7 @@ pub struct StableReserve {

#[serde_as]
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase", deny_unknown_fields)]
#[serde(rename_all = "camelCase")]
pub struct ConcentratedLiquidityPool {
pub id: String,
pub address: H160,
Expand All @@ -203,7 +203,7 @@ pub struct ConcentratedLiquidityPool {

#[serde_as]
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase", deny_unknown_fields)]
#[serde(rename_all = "camelCase")]
pub struct ForeignLimitOrder {
pub id: String,
pub address: H160,
Expand Down
2 changes: 1 addition & 1 deletion crates/solvers-dto/src/notification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ type BlockNo = u64;

#[serde_as]
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase", deny_unknown_fields)]
#[serde(rename_all = "camelCase")]
pub struct Tx {
pub from: H160,
pub to: H160,
Expand Down

0 comments on commit 43d57b6

Please sign in to comment.