Skip to content

Commit

Permalink
prepare 0.6.1 bump
Browse files Browse the repository at this point in the history
  • Loading branch information
zerosnacks committed Nov 7, 2024
1 parent bbf7225 commit 3c063e4
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 30 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions examples/advanced/examples/foundry_fork_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
4 changes: 2 additions & 2 deletions examples/comparison/examples/compare_new_heads.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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| {
Expand Down
9 changes: 5 additions & 4 deletions examples/fillers/examples/gas_filler.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//! Example of using the `GasFiller` in the provider.

use alloy::{
consensus::Transaction,
network::TransactionBuilder,
primitives::{address, U256},
providers::{Provider, ProviderBuilder},
Expand Down Expand Up @@ -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);
Expand All @@ -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(())
}
9 changes: 5 additions & 4 deletions examples/fillers/examples/nonce_filler.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//! Example of using the `NonceFiller` in the provider.

use alloy::{
consensus::Transaction,
network::TransactionBuilder,
primitives::{address, U256},
providers::{Provider, ProviderBuilder},
Expand Down Expand Up @@ -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(())
}
9 changes: 5 additions & 4 deletions examples/fillers/examples/recommended_fillers.rs
Original file line number Diff line number Diff line change
@@ -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},
Expand Down Expand Up @@ -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(())
}
4 changes: 2 additions & 2 deletions examples/providers/examples/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});

Expand Down
4 changes: 2 additions & 2 deletions examples/providers/examples/ws.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});

Expand Down
8 changes: 4 additions & 4 deletions examples/providers/examples/ws_with_auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});

Expand Down
4 changes: 2 additions & 2 deletions examples/subscriptions/examples/subscribe_blocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions examples/transactions/examples/encode_decode_eip1559.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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);
Expand Down

0 comments on commit 3c063e4

Please sign in to comment.