Skip to content
This repository was archived by the owner on Mar 26, 2025. It is now read-only.

feat: upgrade to alloy 0.7.3 / primitives 0.8.11 #67

Merged
merged 1 commit into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }

7 changes: 3 additions & 4 deletions src/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
7 changes: 4 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ pub trait RequestSigner {
fn sign_request(
&self,
request: &SignRequest,
) -> impl std::future::Future<Output = Result<alloy_primitives::Signature, alloy::signers::Error>>
+ Send;
) -> impl std::future::Future<
Output = Result<alloy_primitives::PrimitiveSignature, alloy::signers::Error>,
> + Send;
}

impl<T> RequestSigner for T
Expand All @@ -51,7 +52,7 @@ where
async fn sign_request(
&self,
request: &SignRequest,
) -> Result<alloy_primitives::Signature, alloy::signers::Error> {
) -> Result<alloy_primitives::PrimitiveSignature, alloy::signers::Error> {
let hash = request.signing_hash();
self.sign_hash(&hash).await
}
Expand Down
4 changes: 2 additions & 2 deletions src/resp.rs
Original file line number Diff line number Diff line change
@@ -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`].
Expand All @@ -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 {
Expand Down
Loading