Skip to content

Commit 110acac

Browse files
committed
sync alloy-zksync version with base alloy crate
1 parent 7c72273 commit 110acac

File tree

14 files changed

+334
-955
lines changed

14 files changed

+334
-955
lines changed

Cargo.lock

Lines changed: 116 additions & 429 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ zksync_web3_decl = { git = "https://github.com/matter-labs/zksync-era.git", rev
4141
#########################
4242
# External dependencies #
4343
#########################
44+
45+
# Keep `alloy-zksync` version in sync with base `alloy` crate to avoid two different sets of dependencies
46+
alloy-zksync = "0.9.0"
47+
alloy = { version = "0.9.2", default-features = false }
48+
4449
anyhow = "1.0"
45-
alloy-signer-local = { version = "0.5.4", features = ["mnemonic"] }
46-
alloy-signer = { version = "0.5.4", default-features = false }
47-
alloy-dyn-abi = "0.5.4"
48-
alloy-primitives = { version = "0.5.4" }
49-
alloy-json-abi = "0.5.4"
5050
async-trait = "0.1.85"
5151
chrono = { version = "0.4.31", default-features = false }
5252
clap = { version = "4.2.4", features = ["derive", "env"] }
@@ -87,7 +87,6 @@ url = "2.5.4"
8787
httptest = "0.15.4"
8888
tempdir = "0.3.7"
8989
maplit = "1.0.2"
90-
alloy-zksync = "0.9.0"
9190
test-case = "3.3.1"
9291
backon = "1.3.0"
9392

crates/cli/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ anvil_zksync_config.workspace = true
1616
anvil_zksync_api_server.workspace = true
1717
anvil_zksync_types.workspace = true
1818

19+
alloy = { workspace = true, default-features = false, features = ["signer-mnemonic"] }
20+
1921
zksync_types.workspace = true
2022
zksync_web3_decl.workspace = true
21-
22-
alloy-signer-local.workspace = true
2323
anyhow.workspace = true
2424
clap.workspace = true
2525
eyre.workspace = true

crates/cli/src/cli.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::utils::parse_genesis_file;
2-
use alloy_signer_local::coins_bip39::{English, Mnemonic};
2+
use alloy::signers::local::coins_bip39::{English, Mnemonic};
33
use anvil_zksync_config::constants::{
44
DEFAULT_DISK_CACHE_DIR, DEFAULT_MNEMONIC, TEST_NODE_NETWORK_ID,
55
};

crates/config/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ anvil_zksync_types.workspace = true
1616
zksync_types.workspace = true
1717
zksync_vm_interface.workspace = true
1818

19-
alloy-signer.workspace = true
20-
alloy-signer-local.workspace = true
19+
alloy = { workspace = true, default-features = false, features = ["signer-mnemonic"] }
20+
2121
clap.workspace = true
2222
colored.workspace = true
2323
hex.workspace = true

crates/config/src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::constants::*;
22
use crate::types::*;
33
use crate::utils::{format_eth, format_gwei};
4-
use alloy_signer_local::PrivateKeySigner;
4+
use alloy::signers::local::PrivateKeySigner;
55
use anvil_zksync_types::{
66
LogLevel, ShowCalls, ShowGasDetails, ShowStorageLogs, ShowVMDetails, TransactionOrder,
77
};

crates/config/src/types/account_generator.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::constants::{DERIVATION_PATH, TEST_NODE_NETWORK_ID};
2-
use alloy_signer::Signer;
3-
use alloy_signer_local::coins_bip39::{English, Mnemonic};
4-
use alloy_signer_local::{MnemonicBuilder, PrivateKeySigner};
2+
use alloy::signers::local::coins_bip39::{English, Mnemonic};
3+
use alloy::signers::local::{MnemonicBuilder, PrivateKeySigner};
4+
use alloy::signers::Signer;
55
use serde::Deserialize;
66

77
/// Account Generator

crates/core/Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ tokio.workspace = true
2323
futures.workspace = true
2424
once_cell.workspace = true
2525

26-
alloy-json-abi.workspace = true
27-
alloy-primitives.workspace = true
28-
alloy-dyn-abi.workspace = true
26+
alloy = { workspace = true, default-features = false, features = ["json-abi", "dyn-abi"] }
2927

3028
reqwest.workspace = true
3129
serde.workspace = true

crates/core/src/console_log.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
use std::{collections::HashMap, str::FromStr};
22

33
use crate::utils::format_token;
4-
use alloy_dyn_abi::JsonAbiExt;
5-
use alloy_json_abi::{Function, Param, StateMutability};
6-
use alloy_primitives::Selector;
4+
use alloy::dyn_abi::JsonAbiExt;
5+
use alloy::json_abi::{Function, Param, StateMutability};
6+
use alloy::primitives::Selector;
77
use colored::Colorize;
88
use itertools::Itertools;
99
use zksync_multivm::interface::Call;
@@ -71,8 +71,7 @@ impl ConsoleLogHandler {
7171
self.signature_map
7272
.get(signature)
7373
.map_or("Unknown log call.".to_owned(), |func| {
74-
let tokens: Result<Vec<alloy_dyn_abi::DynSolValue>, alloy_dyn_abi::Error> =
75-
func.abi_decode_input(&current_call.input.as_slice()[4..], false);
74+
let tokens = func.abi_decode_input(&current_call.input.as_slice()[4..], false);
7675
tokens.map_or("Failed to parse inputs for log.".to_owned(), |tokens| {
7776
tokens.iter().map(|t| format_token(t, false)).join(" ")
7877
})

crates/core/src/node/debug.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ impl InMemoryNode {
124124

125125
#[cfg(test)]
126126
mod tests {
127-
use alloy_dyn_abi::{DynSolValue, FunctionExt, JsonAbiExt};
128-
use alloy_json_abi::{Function, Param};
129-
use alloy_primitives::{Address as AlloyAddress, U256 as AlloyU256};
127+
use alloy::dyn_abi::{DynSolValue, FunctionExt, JsonAbiExt};
128+
use alloy::json_abi::{Function, Param, StateMutability};
129+
use alloy::primitives::{Address as AlloyAddress, U256 as AlloyU256};
130130
use anvil_zksync_config::constants::DEFAULT_ACCOUNT_BALANCE;
131131
use zksync_types::{
132132
transaction_request::CallRequestBuilder, utils::deployed_address_create, Address,
@@ -209,7 +209,7 @@ mod tests {
209209
components: vec![],
210210
internal_type: None,
211211
}],
212-
state_mutability: alloy_json_abi::StateMutability::NonPayable,
212+
state_mutability: StateMutability::NonPayable,
213213
};
214214

215215
let calldata = func
@@ -284,7 +284,7 @@ mod tests {
284284
internal_type: None,
285285
}],
286286
outputs: vec![],
287-
state_mutability: alloy_json_abi::StateMutability::NonPayable,
287+
state_mutability: StateMutability::NonPayable,
288288
};
289289

290290
let calldata = func
@@ -330,7 +330,7 @@ mod tests {
330330
name: "shouldRevert".to_string(),
331331
inputs: vec![],
332332
outputs: vec![],
333-
state_mutability: alloy_json_abi::StateMutability::NonPayable,
333+
state_mutability: StateMutability::NonPayable,
334334
};
335335

336336
// trace a call to the primary contract

crates/core/src/node/inner/in_memory_inner.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1417,8 +1417,8 @@ impl InMemoryNodeInner {
14171417
calldata: Option<Vec<u8>>,
14181418
nonce: zksync_types::Nonce,
14191419
) -> H256 {
1420-
use alloy_dyn_abi::{DynSolValue, JsonAbiExt};
1421-
use alloy_json_abi::{Function, Param, StateMutability};
1420+
use alloy::dyn_abi::{DynSolValue, JsonAbiExt};
1421+
use alloy::json_abi::{Function, Param, StateMutability};
14221422
use alloy_zksync::network::unsigned_tx::eip712::hash_bytecode;
14231423

14241424
let salt = [0u8; 32];
@@ -1563,8 +1563,8 @@ mod tests {
15631563
use crate::node::inner::fork_storage::ForkStorage;
15641564
use crate::testing;
15651565
use crate::testing::{TransactionBuilder, STORAGE_CONTRACT_BYTECODE};
1566-
use alloy_dyn_abi::{DynSolType, DynSolValue};
1567-
use alloy_primitives::U256 as AlloyU256;
1566+
use alloy::dyn_abi::{DynSolType, DynSolValue};
1567+
use alloy::primitives::U256 as AlloyU256;
15681568
use anvil_zksync_config::constants::{
15691569
DEFAULT_ACCOUNT_BALANCE, DEFAULT_ESTIMATE_GAS_PRICE_SCALE_FACTOR,
15701570
DEFAULT_ESTIMATE_GAS_SCALE_FACTOR, DEFAULT_FAIR_PUBDATA_PRICE, DEFAULT_L2_GAS_PRICE,

crates/core/src/utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use alloy_dyn_abi::DynSolValue;
2-
use alloy_primitives::{Sign, I256, U256 as AlloyU256};
1+
use alloy::dyn_abi::DynSolValue;
2+
use alloy::primitives::{Sign, I256, U256 as AlloyU256};
33
use anyhow::Context;
44
use chrono::{DateTime, Utc};
55
use colored::Colorize;

0 commit comments

Comments
 (0)