-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into 0xkitsune/fetch-missing-txs
- Loading branch information
Showing
16 changed files
with
470 additions
and
277 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
RUST_LOG=info,tx_sitter=debug,fake_rpc=debug,tower_http=debug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
target/ | ||
target/ | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,34 @@ pub struct TxSitterConfig { | |
|
||
#[serde(default)] | ||
pub statsd_enabled: bool, | ||
|
||
#[serde(default, skip_serializing_if = "Option::is_none")] | ||
pub predefined: Option<Predefined>, | ||
} | ||
|
||
#[derive(Debug, Clone, Serialize, Deserialize)] | ||
#[serde(rename_all = "snake_case")] | ||
pub struct Predefined { | ||
pub network: PredefinedNetwork, | ||
pub relayer: PredefinedRelayer, | ||
} | ||
|
||
#[derive(Debug, Clone, Serialize, Deserialize)] | ||
#[serde(rename_all = "snake_case")] | ||
pub struct PredefinedNetwork { | ||
pub chain_id: u64, | ||
pub name: String, | ||
pub http_rpc: String, | ||
pub ws_rpc: String, | ||
} | ||
|
||
#[derive(Debug, Clone, Serialize, Deserialize)] | ||
#[serde(rename_all = "snake_case")] | ||
pub struct PredefinedRelayer { | ||
pub id: String, | ||
pub name: String, | ||
pub key_id: String, | ||
pub chain_id: u64, | ||
} | ||
|
||
#[derive(Debug, Clone, Serialize, Deserialize)] | ||
|
@@ -101,10 +129,16 @@ pub enum KeysConfig { | |
#[serde(rename_all = "snake_case")] | ||
pub struct KmsKeysConfig {} | ||
|
||
#[derive(Debug, Clone, Serialize, Deserialize)] | ||
#[derive(Debug, Default, Clone, Serialize, Deserialize)] | ||
#[serde(rename_all = "snake_case")] | ||
pub struct LocalKeysConfig {} | ||
|
||
impl KeysConfig { | ||
pub fn is_local(&self) -> bool { | ||
matches!(self, Self::Local(_)) | ||
} | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use indoc::indoc; | ||
|
@@ -156,6 +190,7 @@ mod tests { | |
escalation_interval: Duration::from_secs(60 * 60), | ||
datadog_enabled: false, | ||
statsd_enabled: false, | ||
predefined: None, | ||
}, | ||
server: ServerConfig { | ||
host: SocketAddr::from(([127, 0, 0, 1], 3000)), | ||
|
@@ -166,7 +201,7 @@ mod tests { | |
"postgres://postgres:[email protected]:52804/database" | ||
.to_string(), | ||
), | ||
keys: KeysConfig::Local(LocalKeysConfig {}), | ||
keys: KeysConfig::Local(LocalKeysConfig::default()), | ||
}; | ||
|
||
let toml = toml::to_string_pretty(&config).unwrap(); | ||
|
@@ -181,6 +216,7 @@ mod tests { | |
escalation_interval: Duration::from_secs(60 * 60), | ||
datadog_enabled: false, | ||
statsd_enabled: false, | ||
predefined: None, | ||
}, | ||
server: ServerConfig { | ||
host: SocketAddr::from(([127, 0, 0, 1], 3000)), | ||
|
@@ -194,7 +230,7 @@ mod tests { | |
password: "pass".to_string(), | ||
database: "db".to_string(), | ||
}), | ||
keys: KeysConfig::Local(LocalKeysConfig {}), | ||
keys: KeysConfig::Local(LocalKeysConfig::default()), | ||
}; | ||
|
||
let toml = toml::to_string_pretty(&config).unwrap(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.