Skip to content

Commit 869c21b

Browse files
committed
chore: run tests with zksyncos server
1 parent 9e0fce9 commit 869c21b

File tree

40 files changed

+929
-96
lines changed

40 files changed

+929
-96
lines changed
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
#Cargo.lock
1+
zksync-os-server
2+
account-abstraction

packages/sdk-platforms/rust/zksync-sso-erc4337/Cargo.lock

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

packages/sdk-platforms/rust/zksync-sso-erc4337/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,5 @@ tempfile = "3"
9797
strip-ansi-escapes = "0.2"
9898
libc = "0.2"
9999

100+
# Misc
101+
ureq = "2.10"

packages/sdk-platforms/rust/zksync-sso-erc4337/crates/zksync-sso-erc4337-core/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ base64.workspace = true
4949
libc = { workspace = true, optional = true }
5050
strip-ansi-escapes = { workspace = true, optional = true }
5151
tempfile = { workspace = true, optional = true }
52+
zksync-sso-zksyncos-node = { path = "../zksync-sso-zksyncos-node", optional = true }
5253

5354
# Explicitly add getrandom v0.2 with js feature for WASM (used by rand 0.8 from alloy)
5455
[target.'cfg(target_arch = "wasm32")'.dependencies]
@@ -60,7 +61,7 @@ web-sys = { version = "0.3", features = ["Window"] }
6061
[features]
6162
default = ["tokio-runtime"]
6263
tokio-runtime = ["tokio"]
63-
test-utilities = ["libc", "strip-ansi-escapes", "tempfile"]
64+
test-utilities = ["libc", "strip-ansi-escapes", "tempfile", "zksync-sso-zksyncos-node"]
6465

6566
[dev-dependencies]
6667
# Alloy

packages/sdk-platforms/rust/zksync-sso-erc4337/crates/zksync-sso-erc4337-core/src/erc4337/account/erc7579/module/add.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ mod tests {
122122
signer::create_eoa_signer,
123123
},
124124
utils::alloy_utilities::test_utilities::{
125-
TestInfraConfig,
126-
start_anvil_and_deploy_contracts_and_start_bundler_with_config,
125+
config::TestInfraConfig,
126+
start_node_and_deploy_contracts_and_start_bundler_with_config,
127127
},
128128
};
129129
use alloy::primitives::address;
@@ -143,7 +143,7 @@ mod tests {
143143
let config = TestInfraConfig {
144144
signer_private_key: signer_private_key.clone(),
145145
};
146-
start_anvil_and_deploy_contracts_and_start_bundler_with_config(
146+
start_node_and_deploy_contracts_and_start_bundler_with_config(
147147
&config,
148148
)
149149
.await?
@@ -243,7 +243,7 @@ mod tests {
243243
let config = TestInfraConfig {
244244
signer_private_key: signer_private_key.clone(),
245245
};
246-
start_anvil_and_deploy_contracts_and_start_bundler_with_config(
246+
start_node_and_deploy_contracts_and_start_bundler_with_config(
247247
&config,
248248
)
249249
.await?

packages/sdk-platforms/rust/zksync-sso-erc4337/crates/zksync-sso-erc4337-core/src/erc4337/account/modular_smart_account/deploy.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,8 @@ mod tests {
242242
signer::{Signer, create_eoa_signer},
243243
},
244244
utils::alloy_utilities::test_utilities::{
245-
TestInfraConfig, start_anvil_and_deploy_contracts,
246-
start_anvil_and_deploy_contracts_and_start_bundler_with_config,
245+
config::TestInfraConfig, start_node_and_deploy_contracts,
246+
start_node_and_deploy_contracts_and_start_bundler_with_config,
247247
},
248248
};
249249
use alloy::{
@@ -256,7 +256,7 @@ mod tests {
256256
#[tokio::test]
257257
async fn test_deploy_account_basic() -> eyre::Result<()> {
258258
let (_, anvil_instance, provider, contracts, _) =
259-
start_anvil_and_deploy_contracts().await?;
259+
start_node_and_deploy_contracts().await?;
260260

261261
let factory_address = contracts.account_factory;
262262

@@ -278,7 +278,7 @@ mod tests {
278278
#[tokio::test]
279279
async fn test_deploy_account_with_eoa_signer() -> eyre::Result<()> {
280280
let (_, anvil_instance, provider, contracts, _) =
281-
start_anvil_and_deploy_contracts().await?;
281+
start_node_and_deploy_contracts().await?;
282282

283283
let factory_address = contracts.account_factory;
284284
let eoa_validator_address = contracts.eoa_validator;
@@ -320,7 +320,7 @@ mod tests {
320320
#[tokio::test]
321321
async fn test_deploy_account_with_session_validator() -> eyre::Result<()> {
322322
let (_, anvil_instance, provider, contracts, _) =
323-
start_anvil_and_deploy_contracts().await?;
323+
start_node_and_deploy_contracts().await?;
324324

325325
let factory_address = contracts.account_factory;
326326
let session_validator_address = contracts.session_validator;
@@ -363,7 +363,7 @@ mod tests {
363363
#[tokio::test]
364364
async fn test_deploy_account_with_eoa_and_session() -> eyre::Result<()> {
365365
let (_, anvil_instance, provider, contracts, _) =
366-
start_anvil_and_deploy_contracts().await?;
366+
start_node_and_deploy_contracts().await?;
367367

368368
let factory_address = contracts.account_factory;
369369
let eoa_validator_address = contracts.eoa_validator;
@@ -442,7 +442,7 @@ mod tests {
442442
let config = TestInfraConfig {
443443
signer_private_key: signer_private_key.clone(),
444444
};
445-
start_anvil_and_deploy_contracts_and_start_bundler_with_config(
445+
start_node_and_deploy_contracts_and_start_bundler_with_config(
446446
&config,
447447
)
448448
.await?

packages/sdk-platforms/rust/zksync-sso-erc4337/crates/zksync-sso-erc4337-core/src/erc4337/account/modular_smart_account/deploy/user_op.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ mod tests {
130130
signer::create_eoa_signer,
131131
},
132132
utils::alloy_utilities::test_utilities::{
133-
TestInfraConfig,
134-
start_anvil_and_deploy_contracts_and_start_bundler_with_config,
133+
config::TestInfraConfig,
134+
start_node_and_deploy_contracts_and_start_bundler_with_config,
135135
},
136136
};
137137
use alloy::primitives::{U256, address};
@@ -148,7 +148,7 @@ mod tests {
148148
bundler_client,
149149
) = {
150150
let signer_private_key = "0x2a871d0798f97d79848a013d4936a73bf4cc922c825d33c1cf7073dff6d409c6".to_string();
151-
start_anvil_and_deploy_contracts_and_start_bundler_with_config(
151+
start_node_and_deploy_contracts_and_start_bundler_with_config(
152152
&TestInfraConfig {
153153
signer_private_key: signer_private_key.clone(),
154154
},

packages/sdk-platforms/rust/zksync-sso-erc4337/crates/zksync-sso-erc4337-core/src/erc4337/account/modular_smart_account/guardian/accept.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ mod tests {
5656
utils::alloy_utilities::{
5757
ethereum_wallet_from_private_key,
5858
test_utilities::{
59-
TestInfraConfig,
60-
start_anvil_and_deploy_contracts_and_start_bundler_with_config,
59+
config::TestInfraConfig,
60+
start_node_and_deploy_contracts_and_start_bundler_with_config,
6161
},
6262
},
6363
};
@@ -78,7 +78,7 @@ mod tests {
7878
let config = TestInfraConfig {
7979
signer_private_key: signer_private_key.clone(),
8080
};
81-
start_anvil_and_deploy_contracts_and_start_bundler_with_config(
81+
start_node_and_deploy_contracts_and_start_bundler_with_config(
8282
&config,
8383
)
8484
.await?

packages/sdk-platforms/rust/zksync-sso-erc4337/crates/zksync-sso-erc4337-core/src/erc4337/account/modular_smart_account/guardian/propose.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ mod tests {
100100
signer::create_eoa_signer,
101101
},
102102
utils::alloy_utilities::test_utilities::{
103-
TestInfraConfig,
104-
start_anvil_and_deploy_contracts_and_start_bundler_with_config,
103+
config::TestInfraConfig,
104+
start_node_and_deploy_contracts_and_start_bundler_with_config,
105105
},
106106
};
107107
use alloy::primitives::address;
@@ -121,7 +121,7 @@ mod tests {
121121
let config = TestInfraConfig {
122122
signer_private_key: signer_private_key.clone(),
123123
};
124-
start_anvil_and_deploy_contracts_and_start_bundler_with_config(
124+
start_node_and_deploy_contracts_and_start_bundler_with_config(
125125
&config,
126126
)
127127
.await?

packages/sdk-platforms/rust/zksync-sso-erc4337/crates/zksync-sso-erc4337-core/src/erc4337/account/modular_smart_account/guardian/recovery/finalize.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ mod tests {
7171
utils::alloy_utilities::{
7272
ethereum_wallet_from_private_key,
7373
test_utilities::{
74-
TestInfraConfig,
75-
start_anvil_and_deploy_contracts_and_start_bundler_with_config,
74+
config::TestInfraConfig,
75+
start_node_and_deploy_contracts_and_start_bundler_with_config,
7676
},
7777
},
7878
};
@@ -95,7 +95,7 @@ mod tests {
9595
let config = TestInfraConfig {
9696
signer_private_key: signer_private_key.clone(),
9797
};
98-
start_anvil_and_deploy_contracts_and_start_bundler_with_config(
98+
start_node_and_deploy_contracts_and_start_bundler_with_config(
9999
&config,
100100
)
101101
.await?

0 commit comments

Comments
 (0)