Skip to content

fix: bump alloy to 0.15 #199

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ resolver = "2"
[workspace.package]
version = "0.1.0"
edition = "2021"
rust-version = "1.81"
rust-version = "1.83"
authors = ["Alloy Contributors"]
license = "MIT OR Apache-2.0"
homepage = "https://github.com/alloy-rs/examples"
Expand Down Expand Up @@ -95,7 +95,7 @@ significant_drop_tightening = "allow"
needless_return = "allow"

[workspace.dependencies]
alloy = { version = "0.14", features = [
alloy = { version = "0.15", features = [
"eips",
"full",
"json-rpc",
Expand All @@ -114,7 +114,7 @@ alloy = { version = "0.14", features = [

# async
futures-util = "0.3"
tokio = "1.44"
tokio = "1.45"

# misc
eyre = "0.6"
Expand Down
4 changes: 2 additions & 2 deletions benches/benches/rlp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ fn rlp(c: &mut Criterion) {
g.bench_with_input("Alloy-Rlp/Encoding", &my_struct, |b, my_struct| {
b.iter(|| {
let mut out = Vec::new();
let _ = my_struct.encode(&mut out);
my_struct.encode(&mut out);
black_box(out);
})
});

let mut encoded = Vec::new();
let _ = my_struct.encode(&mut encoded);
my_struct.encode(&mut encoded);

// Parity RLP decoding
g.bench_with_input("Parity-Rlp/Decoding", &encoded, |b, encoded| {
Expand Down
2 changes: 1 addition & 1 deletion clippy.toml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
msrv = "1.81"
msrv = "1.83"
18 changes: 9 additions & 9 deletions examples/advanced/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ workspace = true

[dev-dependencies]
alloy.workspace = true
# foundry-fork-db = "0.12"
# foundry-fork-db = { git = "https://github.com/foundry-rs/foundry-fork-db.git", rev = "cdbbe64" }

# # reth
# revm-primitives = { version = "17.0.0", default-features = false }
# revm = { version = "21.0.0", default-features = false }
# reth-db = { git = "https://github.com/paradigmxyz/reth", package = "reth-db", rev = "v1.3.8" }
# reth-provider = { git = "https://github.com/paradigmxyz/reth", package = "reth-provider", rev = "v1.3.8" }
# reth-node-types = { git = "https://github.com/paradigmxyz/reth", package = "reth-node-types", rev = "v1.3.8" }
# reth-chainspec = { git = "https://github.com/paradigmxyz/reth", package = "reth-chainspec", rev = "v1.3.8" }
# reth-node-ethereum = { git = "https://github.com/paradigmxyz/reth", package = "reth-node-ethereum", rev = "v1.3.8" }
# reth
# revm = { version = "22.0.1", default-features = false }
# revm-primitives = { version = "18.0.0", default-features = false }
# reth-db = { git = "https://github.com/paradigmxyz/reth", package = "reth-db", rev = "7029951" }
# reth-provider = { git = "https://github.com/paradigmxyz/reth", package = "reth-provider", rev = "7029951" }
# reth-node-types = { git = "https://github.com/paradigmxyz/reth", package = "reth-node-types", rev = "7029951" }
# reth-chainspec = { git = "https://github.com/paradigmxyz/reth", package = "reth-chainspec", rev = "7029951" }
# reth-node-ethereum = { git = "https://github.com/paradigmxyz/reth", package = "reth-node-ethereum", rev = "7029951" }

eyre.workspace = true
tokio = { workspace = true, features = ["macros", "rt-multi-thread"] }
Expand Down
7 changes: 4 additions & 3 deletions examples/advanced/examples/any_network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ async fn main() -> Result<()> {

// Create a provider with the Arbitrum Sepolia network and the wallet.
let rpc_url = "https://sepolia-rollup.arbitrum.io/rpc".parse()?;
let provider = ProviderBuilder::new().network::<AnyNetwork>().wallet(signer).on_http(rpc_url);
let provider =
ProviderBuilder::new().network::<AnyNetwork>().wallet(signer).connect_http(rpc_url);

// Create a contract instance.
let contract = Counter::new(COUNTER_CONTRACT_ADDRESS, &provider);
Expand All @@ -62,8 +63,8 @@ async fn main() -> Result<()> {
let l1_gas = arb_fields.gas_used_for_l1.to::<u128>();
let l1_block_number = arb_fields.l1_block_number.to::<u64>();

println!("Gas used for L1: {}", l1_gas);
println!("L1 block number: {}", l1_block_number);
println!("Gas used for L1: {l1_gas}");
println!("L1 block number: {l1_block_number}");

Ok(())
}
6 changes: 3 additions & 3 deletions examples/advanced/examples/decoding_json_abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
// Functions
println!("Functions:");
for (name, functions) in &abi.functions {
println!("\n>> {}:", name);
println!("\n>> {name}:");
for function in functions {
println!(" Inputs: {:?}", function.inputs);
println!(" Outputs: {:?}", function.outputs);
Expand All @@ -36,7 +36,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
// Events
println!("Events:");
for (name, events) in &abi.events {
println!("\n>> {}:", name);
println!("\n>> {name}:");
for event in events {
println!(" Inputs: {:?}", event.inputs);
println!(" Anonymous: {}", event.anonymous);
Expand All @@ -48,7 +48,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
// Errors
println!("Errors:");
for (name, errors) in &abi.errors {
println!(">> {}:", name);
println!(">> {name}:");
for error in errors {
println!(" Inputs: {:?}", error.inputs);
}
Expand Down
4 changes: 2 additions & 2 deletions examples/advanced/examples/encoding_dyn_abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {

// Verify the signature
let recovered_address = signature.recover_address_from_prehash(&eip712_hash)?;
println!("Recovered address: {}", recovered_address);
println!("Recovered address: {recovered_address}");

assert_eq!(recovered_address, wallet.address(), "Signature verification failed");
println!("Signature verified successfully!");
Expand All @@ -87,7 +87,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
fn print_tuple(value: &DynSolValue, field_names: &[&str]) {
if let DynSolValue::Tuple(values) = value {
for (value, name) in values.iter().zip(field_names.iter()) {
println!(" {}: {:?}", name, value);
println!(" {name}: {value:?}");
}
}
}
2 changes: 1 addition & 1 deletion examples/advanced/examples/encoding_sol_static.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {

let encoded = hex::encode(swapExactTokensForTokensCall::abi_encode(&swap_data));

println!("Encoded: 0x{}", encoded);
println!("Encoded: 0x{encoded}");

Ok(())
}
Loading