diff --git a/.generated-sources/emily/openapi/generated-specs/private-emily-openapi-spec.json b/.generated-sources/emily/openapi/generated-specs/private-emily-openapi-spec.json index 2fea3a8bf..36f2ba90d 100644 --- a/.generated-sources/emily/openapi/generated-specs/private-emily-openapi-spec.json +++ b/.generated-sources/emily/openapi/generated-specs/private-emily-openapi-spec.json @@ -1728,13 +1728,6 @@ "description": "Per withdrawal cap. If none then the cap is the same as the global per withdrawal cap.", "nullable": true, "minimum": 0 - }, - "perWithdrawalMinimum": { - "type": "integer", - "format": "int64", - "description": "Per withdrawal minimum. If none then there is no minimum.", - "nullable": true, - "minimum": 0 } } }, @@ -2208,13 +2201,6 @@ "description": "Per withdrawal cap. If none then there is no cap.", "nullable": true, "minimum": 0 - }, - "perWithdrawalMinimum": { - "type": "integer", - "format": "int64", - "description": "Per withdrawal minimum. If none then there is no minimum.", - "nullable": true, - "minimum": 0 } } }, diff --git a/.generated-sources/emily/openapi/generated-specs/public-emily-openapi-spec.json b/.generated-sources/emily/openapi/generated-specs/public-emily-openapi-spec.json index b261ee729..a8e13245b 100644 --- a/.generated-sources/emily/openapi/generated-specs/public-emily-openapi-spec.json +++ b/.generated-sources/emily/openapi/generated-specs/public-emily-openapi-spec.json @@ -1528,13 +1528,6 @@ "description": "Per withdrawal cap. If none then the cap is the same as the global per withdrawal cap.", "nullable": true, "minimum": 0 - }, - "perWithdrawalMinimum": { - "type": "integer", - "format": "int64", - "description": "Per withdrawal minimum. If none then there is no minimum.", - "nullable": true, - "minimum": 0 } } }, @@ -2008,13 +2001,6 @@ "description": "Per withdrawal cap. If none then there is no cap.", "nullable": true, "minimum": 0 - }, - "perWithdrawalMinimum": { - "type": "integer", - "format": "int64", - "description": "Per withdrawal minimum. If none then there is no minimum.", - "nullable": true, - "minimum": 0 } } }, diff --git a/.generated-sources/emily/openapi/generated-specs/testing-emily-openapi-spec.json b/.generated-sources/emily/openapi/generated-specs/testing-emily-openapi-spec.json index 4acfbf4af..9bcf0fffb 100644 --- a/.generated-sources/emily/openapi/generated-specs/testing-emily-openapi-spec.json +++ b/.generated-sources/emily/openapi/generated-specs/testing-emily-openapi-spec.json @@ -1782,13 +1782,6 @@ "description": "Per withdrawal cap. If none then the cap is the same as the global per withdrawal cap.", "nullable": true, "minimum": 0 - }, - "perWithdrawalMinimum": { - "type": "integer", - "format": "int64", - "description": "Per withdrawal minimum. If none then there is no minimum.", - "nullable": true, - "minimum": 0 } } }, @@ -2262,13 +2255,6 @@ "description": "Per withdrawal cap. If none then there is no cap.", "nullable": true, "minimum": 0 - }, - "perWithdrawalMinimum": { - "type": "integer", - "format": "int64", - "description": "Per withdrawal minimum. If none then there is no minimum.", - "nullable": true, - "minimum": 0 } } }, diff --git a/emily/handler/src/api/handlers/limits.rs b/emily/handler/src/api/handlers/limits.rs index a2916b4cf..45591aaf6 100644 --- a/emily/handler/src/api/handlers/limits.rs +++ b/emily/handler/src/api/handlers/limits.rs @@ -73,7 +73,6 @@ pub async fn set_limits(context: EmilyContext, limits: Limits) -> impl warp::rep peg_cap: limits.peg_cap, per_deposit_minimum: limits.per_deposit_minimum, per_deposit_cap: limits.per_deposit_cap, - per_withdrawal_minimum: limits.per_withdrawal_minimum, per_withdrawal_cap: limits.per_withdrawal_cap, }, ), diff --git a/emily/handler/src/api/models/limits.rs b/emily/handler/src/api/models/limits.rs index 64af1fbac..11857a363 100644 --- a/emily/handler/src/api/models/limits.rs +++ b/emily/handler/src/api/models/limits.rs @@ -15,8 +15,6 @@ pub struct Limits { pub per_deposit_minimum: Option, /// Per deposit cap. If none then there is no cap. pub per_deposit_cap: Option, - /// Per withdrawal minimum. If none then there is no minimum. - pub per_withdrawal_minimum: Option, /// Per withdrawal cap. If none then there is no cap. pub per_withdrawal_cap: Option, /// Represents the individual limits for requests coming from different accounts. @@ -46,8 +44,6 @@ pub struct AccountLimits { pub per_deposit_minimum: Option, /// Per deposit cap. If none then the cap is the same as the global per deposit cap. pub per_deposit_cap: Option, - /// Per withdrawal minimum. If none then there is no minimum. - pub per_withdrawal_minimum: Option, /// Per withdrawal cap. If none then the cap is the same as the global per withdrawal cap. pub per_withdrawal_cap: Option, } diff --git a/emily/handler/src/context.rs b/emily/handler/src/context.rs index f21c8d13b..120f3de63 100644 --- a/emily/handler/src/context.rs +++ b/emily/handler/src/context.rs @@ -82,10 +82,6 @@ impl Settings { .ok() .map(|v| v.parse()) .transpose()?, - per_withdrawal_minimum: env::var("DEFAULT_PER_WITHDRAWAL_MINIMUM") - .ok() - .map(|v| v.parse()) - .transpose()?, per_withdrawal_cap: env::var("DEFAULT_PER_WITHDRAWAL_CAP") .ok() .map(|v| v.parse()) diff --git a/emily/handler/src/database/accessors.rs b/emily/handler/src/database/accessors.rs index fb582a53b..5fb4ff7b0 100644 --- a/emily/handler/src/database/accessors.rs +++ b/emily/handler/src/database/accessors.rs @@ -635,7 +635,6 @@ pub async fn get_limits(context: &EmilyContext) -> Result { peg_cap: default_global_cap.peg_cap, per_deposit_minimum: default_global_cap.per_deposit_minimum, per_deposit_cap: default_global_cap.per_deposit_cap, - per_withdrawal_minimum: default_global_cap.per_withdrawal_minimum, per_withdrawal_cap: default_global_cap.per_withdrawal_cap, }; // Aggregate all the latest entries by account. @@ -673,7 +672,6 @@ pub async fn get_limits(context: &EmilyContext) -> Result { peg_cap: global_cap.peg_cap, per_deposit_minimum: global_cap.per_deposit_minimum, per_deposit_cap: global_cap.per_deposit_cap, - per_withdrawal_minimum: global_cap.per_withdrawal_minimum, per_withdrawal_cap: global_cap.per_withdrawal_cap, account_caps, }) diff --git a/emily/handler/src/database/entries/limits.rs b/emily/handler/src/database/entries/limits.rs index a0894c6f7..120e60bc1 100644 --- a/emily/handler/src/database/entries/limits.rs +++ b/emily/handler/src/database/entries/limits.rs @@ -36,8 +36,6 @@ pub struct LimitEntry { pub per_deposit_minimum: Option, /// Per deposit cap. If none then the cap is the same as the global per deposit cap. pub per_deposit_cap: Option, - /// Per withdrawal minimum. If none then there is no minimum. - pub per_withdrawal_minimum: Option, /// Per withdrawal cap. If none then the cap is the same as the global per withdrawal cap. pub per_withdrawal_cap: Option, } @@ -49,7 +47,6 @@ impl From for AccountLimits { peg_cap: limit_entry.peg_cap, per_deposit_minimum: limit_entry.per_deposit_minimum, per_deposit_cap: limit_entry.per_deposit_cap, - per_withdrawal_minimum: limit_entry.per_withdrawal_minimum, per_withdrawal_cap: limit_entry.per_withdrawal_cap, } } @@ -74,7 +71,6 @@ impl LimitEntry { peg_cap: account_limit.peg_cap, per_deposit_minimum: account_limit.per_deposit_minimum, per_deposit_cap: account_limit.per_deposit_cap, - per_withdrawal_minimum: account_limit.per_withdrawal_minimum, per_withdrawal_cap: account_limit.per_withdrawal_cap, } } diff --git a/emily/handler/tests/integration/limits.rs b/emily/handler/tests/integration/limits.rs index 03c410635..865b58325 100644 --- a/emily/handler/tests/integration/limits.rs +++ b/emily/handler/tests/integration/limits.rs @@ -16,7 +16,6 @@ async fn empty_default_is_as_expected() { peg_cap: Some(None), per_deposit_minimum: Some(None), per_deposit_cap: Some(None), - per_withdrawal_minimum: Some(None), per_withdrawal_cap: Some(None), account_caps: HashMap::new(), }; @@ -42,7 +41,6 @@ async fn adding_and_then_updating_single_accout_limit_works() { peg_cap: Some(Some(100)), per_deposit_minimum: Some(Some(100)), per_deposit_cap: Some(Some(100)), - per_withdrawal_minimum: Some(Some(100)), per_withdrawal_cap: Some(Some(100)), }, ), @@ -52,7 +50,6 @@ async fn adding_and_then_updating_single_accout_limit_works() { peg_cap: Some(Some(1200)), per_deposit_minimum: Some(Some(1200)), per_deposit_cap: Some(Some(1200)), - per_withdrawal_minimum: Some(Some(1200)), per_withdrawal_cap: Some(Some(1200)), }, ), @@ -62,7 +59,6 @@ async fn adding_and_then_updating_single_accout_limit_works() { peg_cap: Some(Some(100)), per_deposit_minimum: Some(Some(200)), per_deposit_cap: Some(Some(300)), - per_withdrawal_minimum: Some(Some(400)), per_withdrawal_cap: Some(Some(500)), }, ), @@ -72,7 +68,6 @@ async fn adding_and_then_updating_single_accout_limit_works() { peg_cap: Some(Some(200)), per_deposit_minimum: Some(Some(200)), per_deposit_cap: Some(Some(200)), - per_withdrawal_minimum: Some(Some(200)), per_withdrawal_cap: Some(Some(200)), }, ), @@ -82,7 +77,6 @@ async fn adding_and_then_updating_single_accout_limit_works() { peg_cap: Some(Some(300)), per_deposit_minimum: Some(Some(300)), per_deposit_cap: Some(Some(300)), - per_withdrawal_minimum: Some(Some(300)), per_withdrawal_cap: Some(Some(300)), }, ), @@ -97,7 +91,6 @@ async fn adding_and_then_updating_single_accout_limit_works() { peg_cap: Some(Some(200)), per_deposit_minimum: Some(Some(200)), per_deposit_cap: Some(Some(200)), - per_withdrawal_minimum: Some(Some(200)), per_withdrawal_cap: Some(Some(200)), }, ), @@ -107,7 +100,6 @@ async fn adding_and_then_updating_single_accout_limit_works() { peg_cap: Some(Some(300)), per_deposit_minimum: Some(Some(300)), per_deposit_cap: Some(Some(300)), - per_withdrawal_minimum: Some(Some(300)), per_withdrawal_cap: Some(Some(300)), }, ), @@ -121,7 +113,6 @@ async fn adding_and_then_updating_single_accout_limit_works() { peg_cap: Some(None), per_deposit_minimum: Some(None), per_deposit_cap: Some(None), - per_withdrawal_minimum: Some(None), per_withdrawal_cap: Some(None), account_caps: expected_account_caps.clone(), }; @@ -175,7 +166,6 @@ async fn test_updating_account_limits_via_global_limit_works() { peg_cap: Some(Some(100)), per_deposit_minimum: Some(Some(100)), per_deposit_cap: Some(Some(100)), - per_withdrawal_minimum: Some(Some(100)), per_withdrawal_cap: Some(Some(100)), }, ), @@ -185,7 +175,6 @@ async fn test_updating_account_limits_via_global_limit_works() { peg_cap: Some(Some(150)), per_deposit_minimum: Some(Some(150)), per_deposit_cap: Some(Some(150)), - per_withdrawal_minimum: Some(Some(150)), per_withdrawal_cap: Some(Some(150)), }, ), @@ -195,7 +184,6 @@ async fn test_updating_account_limits_via_global_limit_works() { peg_cap: Some(Some(150)), per_deposit_minimum: Some(Some(150)), per_deposit_cap: Some(Some(150)), - per_withdrawal_minimum: Some(Some(150)), per_withdrawal_cap: Some(Some(150)), }, ), @@ -210,7 +198,6 @@ async fn test_updating_account_limits_via_global_limit_works() { peg_cap: Some(Some(200)), per_deposit_minimum: Some(Some(200)), per_deposit_cap: Some(Some(200)), - per_withdrawal_minimum: Some(Some(200)), per_withdrawal_cap: Some(Some(200)), }, ), @@ -220,7 +207,6 @@ async fn test_updating_account_limits_via_global_limit_works() { peg_cap: Some(Some(300)), per_deposit_minimum: Some(Some(300)), per_deposit_cap: Some(Some(300)), - per_withdrawal_minimum: Some(Some(300)), per_withdrawal_cap: Some(Some(300)), }, ), @@ -232,7 +218,6 @@ async fn test_updating_account_limits_via_global_limit_works() { peg_cap: Some(None), per_deposit_minimum: Some(None), per_deposit_cap: Some(None), - per_withdrawal_minimum: Some(None), per_withdrawal_cap: Some(None), }, ), @@ -244,7 +229,6 @@ async fn test_updating_account_limits_via_global_limit_works() { peg_cap: Some(Some(123)), per_deposit_minimum: Some(Some(654)), per_deposit_cap: Some(Some(456)), - per_withdrawal_minimum: Some(Some(987)), per_withdrawal_cap: Some(Some(789)), account_caps: account_limits_to_set_globally.clone(), }; @@ -258,7 +242,6 @@ async fn test_updating_account_limits_via_global_limit_works() { peg_cap: Some(Some(100)), per_deposit_minimum: Some(Some(100)), per_deposit_cap: Some(Some(100)), - per_withdrawal_minimum: Some(Some(100)), per_withdrawal_cap: Some(Some(100)), }, ), @@ -268,7 +251,6 @@ async fn test_updating_account_limits_via_global_limit_works() { peg_cap: Some(Some(200)), per_deposit_minimum: Some(Some(200)), per_deposit_cap: Some(Some(200)), - per_withdrawal_minimum: Some(Some(200)), per_withdrawal_cap: Some(Some(200)), }, ), @@ -278,7 +260,6 @@ async fn test_updating_account_limits_via_global_limit_works() { peg_cap: Some(Some(300)), per_deposit_minimum: Some(Some(300)), per_deposit_cap: Some(Some(300)), - per_withdrawal_minimum: Some(Some(300)), per_withdrawal_cap: Some(Some(300)), }, ), @@ -290,7 +271,6 @@ async fn test_updating_account_limits_via_global_limit_works() { peg_cap: Some(Some(123)), per_deposit_minimum: Some(Some(654)), per_deposit_cap: Some(Some(456)), - per_withdrawal_minimum: Some(Some(987)), per_withdrawal_cap: Some(Some(789)), account_caps: expected_global_account_limits.clone(), };