From 28619fbee1c57401e7da21118ef96762347a6ca6 Mon Sep 17 00:00:00 2001 From: Luke Parker Date: Thu, 17 Oct 2024 18:02:57 -0400 Subject: [PATCH] CI fixes Mainly corrects for https://github.com/alloy-rs/alloy/issues/1510 yet also corrects a missing machete ignore. --- patches/tiny-bip39/Cargo.toml | 3 +++ processor/src/networks/ethereum.rs | 11 ++++++----- tests/processor/src/networks.rs | 5 +++-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/patches/tiny-bip39/Cargo.toml b/patches/tiny-bip39/Cargo.toml index 08211c1b6..ff9b8a614 100644 --- a/patches/tiny-bip39/Cargo.toml +++ b/patches/tiny-bip39/Cargo.toml @@ -13,6 +13,9 @@ rust-version = "1.70" all-features = true rustdoc-args = ["--cfg", "docsrs"] +[package.metadata.cargo-machete] +ignored = ["tiny-bip39"] + [lib] name = "bip39" path = "src/lib.rs" diff --git a/processor/src/networks/ethereum.rs b/processor/src/networks/ethereum.rs index c325833fe..f47888496 100644 --- a/processor/src/networks/ethereum.rs +++ b/processor/src/networks/ethereum.rs @@ -918,16 +918,17 @@ impl Network for Ethereum { .into(), }; - use ethereum_serai::alloy::{primitives::Signature, consensus::SignableTransaction}; + use ethereum_serai::alloy::{ + primitives::{Parity, Signature}, + consensus::SignableTransaction, + }; let sig = k256::ecdsa::SigningKey::from(k256::elliptic_curve::NonZeroScalar::new(key).unwrap()) .sign_prehash_recoverable(tx.signature_hash().as_ref()) .unwrap(); let mut bytes = vec![]; - tx.encode_with_signature_fields( - &Signature::from(sig).with_chain_id(self.provider.get_chain_id().await.unwrap()), - &mut bytes, - ); + let parity = Parity::NonEip155(Parity::from(sig.1).y_parity()); + tx.encode_with_signature_fields(&Signature::from(sig).with_parity(parity), &mut bytes); let pending_tx = self.provider.send_raw_transaction(&bytes).await.ok().unwrap(); // Mine an epoch containing this TX diff --git a/tests/processor/src/networks.rs b/tests/processor/src/networks.rs index b46577317..e6ef485c1 100644 --- a/tests/processor/src/networks.rs +++ b/tests/processor/src/networks.rs @@ -299,7 +299,7 @@ impl Wallet { use std::sync::Arc; use ethereum_serai::{ alloy::{ - primitives::{U256, Signature, TxKind}, + primitives::{U256, Parity, Signature, TxKind}, sol_types::SolCall, simple_request_transport::SimpleRequest, consensus::{TxLegacy, SignableTransaction}, @@ -389,7 +389,8 @@ impl Wallet { .unwrap(); let mut bytes = vec![]; - tx.encode_with_signature_fields(&Signature::from(sig), &mut bytes); + let parity = Parity::NonEip155(Parity::from(sig.1).y_parity()); + tx.encode_with_signature_fields(&Signature::from(sig).with_parity(parity), &mut bytes); // We drop the bottom 10 decimals (