Skip to content

Commit

Permalink
Merge branch 'nightly' into preston/docs/sov_storage
Browse files Browse the repository at this point in the history
  • Loading branch information
preston-evans98 authored Jul 26, 2023
2 parents afdc8f1 + 824bfa6 commit a116f3b
Show file tree
Hide file tree
Showing 44 changed files with 1,674 additions and 4,233 deletions.
13 changes: 6 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,13 @@ schemars = { version = "0.8.12", features = ["derive"] }
tempfile = "3.5"
tokio = { version = "1", features = ["full"] }

ethers = "2.0.8"
ethers-core = "2.0.8"
ethers-contract = "2.0.8"
ethers-providers = "2.0.8"
ethers-signers = { version = "2.0.8", default-features = false }
ethers-middleware = "2.0.8"
ethers = "=2.0.8"
ethers-core = "=2.0.8"
ethers-contract = "=2.0.8"
ethers-providers = "=2.0.8"
ethers-signers = { version = "=2.0.8", default-features = false }
ethers-middleware = "=2.0.8"

# TODO https://github.com/Sovereign-Labs/sovereign-sdk/issues/498
anvil = { git = "https://github.com/foundry-rs/foundry", rev = "684d394db587bef427475a660c72013e97ef71d2" }
anvil-core = { git = "https://github.com/foundry-rs/foundry", features = ["fastrlp", "serde"], rev = "684d394db587bef427475a660c72013e97ef71d2" }

13 changes: 13 additions & 0 deletions adapters/celestia/src/celestia.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::fmt::{Display, Formatter};
use std::ops::Range;
use std::str::FromStr;
use std::sync::{Arc, Mutex};

use base64::engine::general_purpose::STANDARD as B64_ENGINE;
Expand Down Expand Up @@ -352,6 +353,18 @@ impl From<[u8; 32]> for H160 {
}
}

impl FromStr for H160 {
type Err = hex::FromHexError;

fn from_str(s: &str) -> Result<Self, Self::Err> {
// Remove the "0x" prefix, if it exists.
let s = s.strip_prefix("0x").unwrap_or(s);
let mut output = [0u8; 20];
hex::decode_to_slice(s, &mut output)?;
Ok(H160(output))
}
}

impl Display for H160 {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
write!(f, "0x{}", hex::encode(self.0))
Expand Down
Loading

0 comments on commit a116f3b

Please sign in to comment.