diff --git a/Cargo.toml b/Cargo.toml index 5e0d94b..4e271c4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,17 +11,17 @@ repository = "https://github.com/init4tech/zenith" license = "AGPL-3.0" [dependencies] -alloy-primitives = { version = "0.8", features = ["serde", "tiny-keccak"] } -alloy-sol-types = { version = "0.8", features = ["json"] } +alloy-primitives = { version = "0.8.11", features = ["serde", "tiny-keccak"] } +alloy-sol-types = { version = "0.8.11", features = ["json"] } alloy-rlp = { version = "0.3.4" } -alloy = { version = "=0.5.4", features = ["full", "json-rpc", "signer-aws"] } -alloy-contract = { version = "=0.5.4", features = ["pubsub"] } +alloy = { version = "=0.7.3", features = ["full", "json-rpc", "signer-aws"] } +alloy-contract = { version = "=0.7.3", features = ["pubsub"] } serde = { version = "1.0.197", features = ["derive"] } [dev-dependencies] -serde_json = "1.0.116" +serde_json = "1.0.94" tokio = { version = "1.37.0", features = ["macros"] } diff --git a/src/block.rs b/src/block.rs index 54be55f..11af25b 100644 --- a/src/block.rs +++ b/src/block.rs @@ -223,19 +223,18 @@ where #[cfg(test)] mod test { use alloy::consensus::{Signed, TxEip1559}; - use alloy::signers::Signature; + use alloy_primitives::PrimitiveSignature; use alloy_primitives::{b256, bytes, Address, U256}; use super::*; #[test] fn encode_decode() { - let sig = Signature::from_scalars_and_parity( + let sig = PrimitiveSignature::from_scalars_and_parity( b256!("840cfc572845f5786e702984c2a582528cad4b49b2a10b9db1be7fca90058565"), b256!("25e7109ceb98168d95b09b18bbf6b685130e0562f233877d492b94eee0c5b6d1"), false, - ) - .unwrap(); + ); let tx = ZenithTransaction::Eip1559(Signed::new_unchecked( TxEip1559 { diff --git a/src/lib.rs b/src/lib.rs index 4366b63..6458d22 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -40,8 +40,9 @@ pub trait RequestSigner { fn sign_request( &self, request: &SignRequest, - ) -> impl std::future::Future> - + Send; + ) -> impl std::future::Future< + Output = Result, + > + Send; } impl RequestSigner for T @@ -51,7 +52,7 @@ where async fn sign_request( &self, request: &SignRequest, - ) -> Result { + ) -> Result { let hash = request.signing_hash(); self.sign_hash(&hash).await } diff --git a/src/resp.rs b/src/resp.rs index d3389f5..a3cff07 100644 --- a/src/resp.rs +++ b/src/resp.rs @@ -1,5 +1,5 @@ use crate::SignRequest; -use alloy_primitives::{Address, Signature, SignatureError}; +use alloy_primitives::{Address, PrimitiveSignature, SignatureError}; use serde::{Deserialize, Serialize}; /// A signature response from a [`RequestSigner`]. @@ -11,7 +11,7 @@ pub struct SignResponse { /// The request that was signed. pub req: SignRequest, /// The signature over that request. - pub sig: Signature, + pub sig: PrimitiveSignature, } impl SignResponse {