mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: use alloy Signature type (#10758)
Co-authored-by: Emilia Hane <elsaemiliaevahane@gmail.com>
This commit is contained in:
@ -28,7 +28,7 @@ async fn test_large_tx_req() {
|
||||
|
||||
let ts = TransactionSigned {
|
||||
hash: Default::default(),
|
||||
signature: Signature::default(),
|
||||
signature: Signature::test_signature(),
|
||||
transaction: tx.clone().into(),
|
||||
};
|
||||
tx.set_hash(ts.recalculate_hash());
|
||||
|
||||
@ -16,7 +16,8 @@ use reth_network_p2p::{
|
||||
headers::client::{HeadersClient, HeadersRequest},
|
||||
};
|
||||
use reth_primitives::{
|
||||
Block, BlockBody, Header, Signature, Transaction, TransactionSigned, TxEip2930,
|
||||
alloy_primitives::Parity, Block, BlockBody, Header, Signature, Transaction, TransactionSigned,
|
||||
TxEip2930,
|
||||
};
|
||||
use reth_provider::test_utils::MockEthProvider;
|
||||
|
||||
@ -32,7 +33,7 @@ pub fn rng_transaction(rng: &mut impl rand::RngCore) -> TransactionSigned {
|
||||
input: Bytes::from(vec![1, 2]),
|
||||
access_list: Default::default(),
|
||||
});
|
||||
let signature = Signature { odd_y_parity: true, r: U256::default(), s: U256::default() };
|
||||
let signature = Signature::new(U256::default(), U256::default(), Parity::Parity(true));
|
||||
|
||||
TransactionSigned::from_transaction_and_signature(request, signature)
|
||||
}
|
||||
|
||||
@ -7,7 +7,7 @@ use futures::StreamExt;
|
||||
use rand::thread_rng;
|
||||
use reth_network::{test_utils::Testnet, NetworkEvent, NetworkEventListenerProvider};
|
||||
use reth_network_api::PeersInfo;
|
||||
use reth_primitives::{TransactionSigned, TxLegacy};
|
||||
use reth_primitives::{Signature, TransactionSigned, TxLegacy};
|
||||
use reth_provider::test_utils::{ExtendedAccount, MockEthProvider};
|
||||
use reth_transaction_pool::{test_utils::TransactionGenerator, PoolTransaction, TransactionPool};
|
||||
|
||||
@ -131,7 +131,10 @@ async fn test_sending_invalid_transactions() {
|
||||
value: Default::default(),
|
||||
input: Default::default(),
|
||||
};
|
||||
let tx = TransactionSigned::from_transaction_and_signature(tx.into(), Default::default());
|
||||
let tx = TransactionSigned::from_transaction_and_signature(
|
||||
tx.into(),
|
||||
Signature::test_signature(),
|
||||
);
|
||||
peer0.network().send_transactions(*peer1.peer_id(), vec![Arc::new(tx)]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user