From 3c063e41ee6901f665c0366e2838051b37367349 Mon Sep 17 00:00:00 2001 From: zerosnacks Date: Thu, 7 Nov 2024 15:16:59 +0100 Subject: [PATCH] prepare 0.6.1 bump --- Cargo.toml | 2 +- examples/advanced/examples/foundry_fork_db.rs | 4 ++-- examples/comparison/examples/compare_new_heads.rs | 4 ++-- examples/fillers/examples/gas_filler.rs | 9 +++++---- examples/fillers/examples/nonce_filler.rs | 9 +++++---- examples/fillers/examples/recommended_fillers.rs | 9 +++++---- examples/providers/examples/builtin.rs | 4 ++-- examples/providers/examples/ws.rs | 4 ++-- examples/providers/examples/ws_with_auth.rs | 8 ++++---- examples/subscriptions/examples/subscribe_blocks.rs | 4 ++-- examples/transactions/examples/encode_decode_eip1559.rs | 6 +++--- 11 files changed, 33 insertions(+), 30 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 0705e566..4c272887 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -95,7 +95,7 @@ significant_drop_tightening = "allow" needless_return = "allow" [workspace.dependencies] -alloy = { version = "0.5.3", features = [ +alloy = { version = "0.6.1", features = [ "full", "node-bindings", "rpc-types-debug", diff --git a/examples/advanced/examples/foundry_fork_db.rs b/examples/advanced/examples/foundry_fork_db.rs index 96d2ecbb..892c6391 100644 --- a/examples/advanced/examples/foundry_fork_db.rs +++ b/examples/advanced/examples/foundry_fork_db.rs @@ -128,11 +128,11 @@ fn configure_evm_env( let basefee = block.header.base_fee_per_gas.map(U256::from).unwrap_or_default(); let block_env = BlockEnv { number: U256::from(block.header.number), - coinbase: block.header.miner, + coinbase: block.header.beneficiary, timestamp: U256::from(block.header.timestamp), gas_limit: U256::from(block.header.gas_limit), basefee, - prevrandao: block.header.mix_hash, + prevrandao: Some(block.header.mix_hash), difficulty: block.header.difficulty, blob_excess_gas_and_price: Some(BlobExcessGasAndPrice::new( block.header.excess_blob_gas.unwrap_or_default(), diff --git a/examples/comparison/examples/compare_new_heads.rs b/examples/comparison/examples/compare_new_heads.rs index 772dfc32..22e2187d 100644 --- a/examples/comparison/examples/compare_new_heads.rs +++ b/examples/comparison/examples/compare_new_heads.rs @@ -66,8 +66,8 @@ async fn main() -> Result<()> { } let mut tracker = HashMap::new(); - while let Some((name, block, timestamp)) = rx.recv().await { - let block_number = block.header.number; + while let Some((name, block_header, timestamp)) = rx.recv().await { + let block_number = block_header.number; let track = tracker .entry(block_number) .and_modify(|t: &mut TxTrack| { diff --git a/examples/fillers/examples/gas_filler.rs b/examples/fillers/examples/gas_filler.rs index 2575ac9b..c4bd2568 100644 --- a/examples/fillers/examples/gas_filler.rs +++ b/examples/fillers/examples/gas_filler.rs @@ -1,6 +1,7 @@ //! Example of using the `GasFiller` in the provider. use alloy::{ + consensus::Transaction, network::TransactionBuilder, primitives::{address, U256}, providers::{Provider, ProviderBuilder}, @@ -34,9 +35,9 @@ async fn main() -> Result<()> { let node_hash = *builder.tx_hash(); let pending_tx = provider.get_transaction_by_hash(node_hash).await?.expect("Pending transaction not found"); - assert_eq!(pending_tx.nonce, 0); + assert_eq!(pending_tx.nonce(), 0); - println!("Transaction sent with nonce: {}", pending_tx.nonce); + println!("Transaction sent with nonce: {}", pending_tx.nonce()); // Update the nonce and send the transaction again. let tx = tx.with_nonce(1); @@ -46,9 +47,9 @@ async fn main() -> Result<()> { let node_hash = *builder.tx_hash(); let pending_tx = provider.get_transaction_by_hash(node_hash).await?.expect("Pending transaction not found"); - assert_eq!(pending_tx.nonce, 1); + assert_eq!(pending_tx.nonce(), 1); - println!("Transaction sent with nonce: {}", pending_tx.nonce); + println!("Transaction sent with nonce: {}", pending_tx.nonce()); Ok(()) } diff --git a/examples/fillers/examples/nonce_filler.rs b/examples/fillers/examples/nonce_filler.rs index 7591e409..9eb5b523 100644 --- a/examples/fillers/examples/nonce_filler.rs +++ b/examples/fillers/examples/nonce_filler.rs @@ -1,6 +1,7 @@ //! Example of using the `NonceFiller` in the provider. use alloy::{ + consensus::Transaction, network::TransactionBuilder, primitives::{address, U256}, providers::{Provider, ProviderBuilder}, @@ -51,18 +52,18 @@ async fn main() -> Result<()> { let node_hash = *builder.tx_hash(); let pending_tx = provider.get_transaction_by_hash(node_hash).await?.expect("Transaction not found"); - assert_eq!(pending_tx.nonce, 0); + assert_eq!(pending_tx.nonce(), 0); - println!("Transaction sent with nonce: {}", pending_tx.nonce); + println!("Transaction sent with nonce: {}", pending_tx.nonce()); // Send the transaction, the nonce (1) is automatically managed by the provider. let builder = provider.send_transaction(tx).await?; let node_hash = *builder.tx_hash(); let pending_tx = provider.get_transaction_by_hash(node_hash).await?.expect("Transaction not found"); - assert_eq!(pending_tx.nonce, 1); + assert_eq!(pending_tx.nonce(), 1); - println!("Transaction sent with nonce: {}", pending_tx.nonce); + println!("Transaction sent with nonce: {}", pending_tx.nonce()); Ok(()) } diff --git a/examples/fillers/examples/recommended_fillers.rs b/examples/fillers/examples/recommended_fillers.rs index 79fa1080..0e0fcdfc 100644 --- a/examples/fillers/examples/recommended_fillers.rs +++ b/examples/fillers/examples/recommended_fillers.rs @@ -1,6 +1,7 @@ //! Example of using the `.with_recommended_fillers()` method in the provider. use alloy::{ + consensus::Transaction, network::TransactionBuilder, primitives::{address, U256}, providers::{Provider, ProviderBuilder}, @@ -30,18 +31,18 @@ async fn main() -> Result<()> { let node_hash = *builder.tx_hash(); let pending_tx = provider.get_transaction_by_hash(node_hash).await?.expect("Pending transaction not found"); - assert_eq!(pending_tx.nonce, 0); + assert_eq!(pending_tx.nonce(), 0); - println!("Transaction sent with nonce: {}", pending_tx.nonce); + println!("Transaction sent with nonce: {}", pending_tx.nonce()); // Send the transaction, the nonce (1) is automatically managed by the provider. let builder = provider.send_transaction(tx).await?; let node_hash = *builder.tx_hash(); let pending_tx = provider.get_transaction_by_hash(node_hash).await?.expect("Pending transaction not found"); - assert_eq!(pending_tx.nonce, 1); + assert_eq!(pending_tx.nonce(), 1); - println!("Transaction sent with nonce: {}", pending_tx.nonce); + println!("Transaction sent with nonce: {}", pending_tx.nonce()); Ok(()) } diff --git a/examples/providers/examples/builtin.rs b/examples/providers/examples/builtin.rs index 05ee440d..b7ce8407 100644 --- a/examples/providers/examples/builtin.rs +++ b/examples/providers/examples/builtin.rs @@ -33,8 +33,8 @@ async fn main() -> Result<()> { println!("Awaiting blocks..."); let handle = tokio::spawn(async move { - while let Some(block) = stream.next().await { - println!("{}", block.header.number); + while let Some(block_header) = stream.next().await { + println!("{}", block_header.number); } }); diff --git a/examples/providers/examples/ws.rs b/examples/providers/examples/ws.rs index 3d75440d..620e3f11 100644 --- a/examples/providers/examples/ws.rs +++ b/examples/providers/examples/ws.rs @@ -21,8 +21,8 @@ async fn main() -> Result<()> { // Take the stream and print the block number upon receiving a new block. let handle = tokio::spawn(async move { - while let Some(block) = stream.next().await { - println!("Latest block number: {}", block.header.number); + while let Some(block_header) = stream.next().await { + println!("Latest block number: {}", block_header.number); } }); diff --git a/examples/providers/examples/ws_with_auth.rs b/examples/providers/examples/ws_with_auth.rs index dcc3aae0..22889865 100644 --- a/examples/providers/examples/ws_with_auth.rs +++ b/examples/providers/examples/ws_with_auth.rs @@ -34,15 +34,15 @@ async fn main() -> Result<()> { // Take the basic stream and print the block number upon receiving a new block. let basic_handle = tokio::spawn(async move { - while let Some(block) = stream_basic.next().await { - println!("Latest block number (basic): {}", block.header.number); + while let Some(block_header) = stream_basic.next().await { + println!("Latest block number (basic): {}", block_header.number); } }); // Take the bearer stream and print the block number upon receiving a new block. let bearer_handle = tokio::spawn(async move { - while let Some(block) = stream_bearer.next().await { - println!("Latest block number (bearer): {}", block.header.number); + while let Some(block_header) = stream_bearer.next().await { + println!("Latest block number (bearer): {}", block_header.number); } }); diff --git a/examples/subscriptions/examples/subscribe_blocks.rs b/examples/subscriptions/examples/subscribe_blocks.rs index 3c57bb58..92274d15 100644 --- a/examples/subscriptions/examples/subscribe_blocks.rs +++ b/examples/subscriptions/examples/subscribe_blocks.rs @@ -21,8 +21,8 @@ async fn main() -> Result<()> { let subscription = provider.subscribe_blocks().await?; let mut stream = subscription.into_stream().take(2); - while let Some(block) = stream.next().await { - println!("Received block number: {}", block.header.number); + while let Some(block_header) = stream.next().await { + println!("Received block number: {}", block_header.number); } // Poll for block headers. diff --git a/examples/transactions/examples/encode_decode_eip1559.rs b/examples/transactions/examples/encode_decode_eip1559.rs index 44ff6fd5..9aa57dcb 100644 --- a/examples/transactions/examples/encode_decode_eip1559.rs +++ b/examples/transactions/examples/encode_decode_eip1559.rs @@ -3,7 +3,7 @@ use alloy::{ consensus::{SignableTransaction, TxEip1559}, eips::eip2930::AccessList, - primitives::{address, b256, hex, Signature, TxKind, U256}, + primitives::{address, b256, hex, PrimitiveSignature, TxKind, U256}, }; use eyre::Result; @@ -29,11 +29,11 @@ async fn main() -> Result<()> { }; // Construct the signature of the transaction. - let signature = Signature::from_scalars_and_parity( + let signature = PrimitiveSignature::from_scalars_and_parity( b256!("840cfc572845f5786e702984c2a582528cad4b49b2a10b9db1be7fca90058565"), b256!("25e7109ceb98168d95b09b18bbf6b685130e0562f233877d492b94eee0c5b6d1"), false, - )?; + ); // Convert the transaction into a signed transaction. let signed_tx = tx.into_signed(signature);