diff --git a/src/db.rs b/src/db.rs index 90b65d1..d935abc 100644 --- a/src/db.rs +++ b/src/db.rs @@ -132,7 +132,8 @@ impl Database { nonce, current_nonce, max_inflight_txs, - gas_price_limits + gas_price_limits, + enabled FROM relayers "#, ) @@ -152,7 +153,8 @@ impl Database { nonce, current_nonce, max_inflight_txs, - gas_price_limits + gas_price_limits, + enabled FROM relayers WHERE id = $1 "#, @@ -1241,6 +1243,7 @@ mod tests { chain_id: 1, value: U256Wrapper(U256::from(10_123u64)), }]), + enabled: None, }, ) .await?; diff --git a/src/types.rs b/src/types.rs index c7373aa..62c8bae 100644 --- a/src/types.rs +++ b/src/types.rs @@ -43,6 +43,7 @@ pub struct RelayerInfo { #[sqlx(try_from = "i64")] pub max_inflight_txs: u64, pub gas_price_limits: Json>, + pub enabled: bool, } #[derive(Deserialize, Serialize, Debug, Clone, Default)] @@ -50,12 +51,12 @@ pub struct RelayerInfo { pub struct RelayerUpdate { #[serde(default)] pub relayer_name: Option, - #[serde(default)] pub max_inflight_txs: Option, - #[serde(default)] pub gas_price_limits: Option>, + #[serde(default)] + pub enabled: Option, } #[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Eq)] @@ -86,6 +87,7 @@ mod tests { value: U256Wrapper(U256::zero()), chain_id: 1, }]), + enabled: true }; let json = serde_json::to_string_pretty(&info).unwrap(); @@ -105,7 +107,8 @@ mod tests { "value": "0x0", "chainId": 1 } - ] + ], + "enabled": true } "#};