Skip to content

Commit

Permalink
misc: use Cargo version of alloy-dyn-abi (#454)
Browse files Browse the repository at this point in the history
  • Loading branch information
agostbiro authored May 15, 2024
1 parent a9a296e commit c5cb61c
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 55 deletions.
90 changes: 45 additions & 45 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions crates/edr_provider/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ version = "0.3.5"
edition = "2021"

[dependencies]
# TODO switch to Cargo version https://github.com/NomicFoundation/edr/issues/445
alloy-dyn-abi = { git = "https://github.com/alloy-rs/core", rev = "85aecdf", features = ["eip712"] }
alloy-dyn-abi = { version = "0.7.4", features = ["eip712"] }
alloy-sol-types = { version = "0.5.1", default-features = false, features = ["std"] }
anyhow = { version = "1.0.75", optional = true }
auto_impl = { version = "1.2", default-features = false }
Expand Down
9 changes: 1 addition & 8 deletions crates/edr_provider/src/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1774,14 +1774,7 @@ impl<LoggerErrorT: Debug, TimerT: Clone + TimeSinceEpoch> ProviderData<LoggerErr
) -> Result<Signature, ProviderError<LoggerErrorT>> {
match self.local_accounts.get(address) {
Some(secret_key) => {
let hash: B256 = message
// TODO https://github.com/NomicFoundation/edr/issues/445
// This returns B256, but we're currently using the EIP-712 types for Alloy from
// Git, so we need to convert it to a slice before converting to our B256.
.eip712_signing_hash()?
.as_slice()
.try_into()
.expect("Git and released version of B256 are compatible");
let hash = message.eip712_signing_hash()?;
Ok(Signature::new(RecoveryMessage::Hash(hash), secret_key)?)
}
None => Err(ProviderError::UnknownAddress { address: *address }),
Expand Down

0 comments on commit c5cb61c

Please sign in to comment.