feat: flashbots_validateBuilderSubmissionV3 (#12168)

This commit is contained in:
Arsenii Kulikov
2024-10-31 23:22:42 +04:00
committed by GitHub
parent 998b3b3d3a
commit d020b41f6a
24 changed files with 812 additions and 127 deletions

View File

@ -24,6 +24,7 @@ eyre.workspace = true
rand.workspace = true
secp256k1 = { workspace = true, features = ["rand"] }
thiserror.workspace = true
serde.workspace = true
tracy-client = { workspace = true, optional = true, features = ["demangle"] }

View File

@ -1,7 +1,9 @@
use alloy_eips::BlockHashOrNumber;
use alloy_primitives::B256;
use reth_fs_util::FsPathError;
use std::{
net::{IpAddr, Ipv4Addr, SocketAddr, ToSocketAddrs},
path::Path,
str::FromStr,
time::Duration,
};
@ -82,6 +84,11 @@ pub fn parse_socket_address(value: &str) -> eyre::Result<SocketAddr, SocketAddre
.ok_or_else(|| SocketAddressParsingError::Parse(value.to_string()))
}
/// Wrapper around [`reth_fs_util::read_json_file`] which can be used as a clap value parser.
pub fn read_json_from_file<T: serde::de::DeserializeOwned>(path: &str) -> Result<T, FsPathError> {
reth_fs_util::read_json_file(Path::new(path))
}
#[cfg(test)]
mod tests {
use super::*;