From 3b78d9634c91c8f08b11fe6fdf9dfee0255edbd1 Mon Sep 17 00:00:00 2001 From: Yash Atreya <44857776+yash-atreya@users.noreply.github.com> Date: Fri, 8 Nov 2024 20:18:58 +0530 Subject: [PATCH] fix --- examples/fillers/examples/gas_filler.rs | 9 +++++---- examples/fillers/examples/nonce_filler.rs | 9 +++++---- examples/fillers/examples/recommended_fillers.rs | 9 +++++---- examples/layers/Cargo.toml | 2 -- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/examples/fillers/examples/gas_filler.rs b/examples/fillers/examples/gas_filler.rs index 2575ac9..c4bd256 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 7591e40..9eb5b52 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 79fa108..0e0fcdf 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/layers/Cargo.toml b/examples/layers/Cargo.toml index f1b3a6e..3b6fd58 100644 --- a/examples/layers/Cargo.toml +++ b/examples/layers/Cargo.toml @@ -18,5 +18,3 @@ alloy.workspace = true eyre.workspace = true tokio = { workspace = true, features = ["macros", "rt-multi-thread"] } tower = { version = "0.5", features = ["retry"] } -tower-http = { version = "0.6.1", features = ["timeout"] } -http-body-util = "0.1"