File tree Expand file tree Collapse file tree 2 files changed +56
-0
lines changed
zk_toolbox/crates/zk_supervisor/src/commands/test Expand file tree Collapse file tree 2 files changed +56
-0
lines changed Original file line number Diff line number Diff line change
1
+ use anyhow:: Context ;
2
+ use common:: { cmd:: Cmd , config:: global_config, logger} ;
3
+ use config:: EcosystemConfig ;
4
+ use xshell:: { cmd, Shell } ;
5
+
6
+ use crate :: messages:: MSG_CHAIN_NOT_FOUND_ERR ;
7
+
8
+ pub fn run ( shell : & Shell ) -> anyhow:: Result < ( ) > {
9
+ let ecosystem_config = EcosystemConfig :: from_file ( shell) ?;
10
+
11
+ let chain_config = ecosystem_config
12
+ . load_chain ( global_config ( ) . chain_name . clone ( ) )
13
+ . context ( MSG_CHAIN_NOT_FOUND_ERR ) ?;
14
+
15
+ let general_api = chain_config
16
+ . get_general_config ( ) ?
17
+ . api_config
18
+ . context ( "API config is not found" ) ?;
19
+
20
+ let mut command = cmd ! ( shell, "cargo run --release --bin loadnext" )
21
+ . env (
22
+ "L2_CHAIN_ID" ,
23
+ chain_config
24
+ . get_genesis_config ( ) ?
25
+ . l2_chain_id
26
+ . as_u64 ( )
27
+ . to_string ( ) ,
28
+ )
29
+ . env (
30
+ "MAIN_TOKEN" ,
31
+ format ! (
32
+ "{:?}" ,
33
+ ecosystem_config
34
+ . get_erc20_tokens( )
35
+ . first( )
36
+ . context( "NO Erc20 tokens were deployed" ) ?
37
+ . address
38
+ ) ,
39
+ )
40
+ . env ( "L2_RPC_ADDRESS" , general_api. web3_json_rpc . http_url )
41
+ . env ( "L2_WS_RPC_ADDRESS" , general_api. web3_json_rpc . ws_url ) ;
42
+
43
+ if global_config ( ) . verbose {
44
+ command = command. env ( "RUST_LOG" , "loadnext=debug" )
45
+ }
46
+
47
+ Cmd :: new ( command) . with_force_run ( ) . run ( ) ?;
48
+
49
+ logger:: outro ( "Loadtest success" ) ;
50
+
51
+ Ok ( ( ) )
52
+ }
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ mod args;
15
15
mod build;
16
16
mod integration;
17
17
mod l1_contracts;
18
+ mod loadtest;
18
19
mod prover;
19
20
mod recovery;
20
21
mod revert;
@@ -43,6 +44,8 @@ pub enum TestCommands {
43
44
Prover ,
44
45
#[ clap( about = MSG_TEST_WALLETS_INFO ) ]
45
46
Wallet ,
47
+ #[ clap( about = MSG_TEST_WALLETS_INFO ) ]
48
+ Loadtest ,
46
49
}
47
50
48
51
pub async fn run ( shell : & Shell , args : TestCommands ) -> anyhow:: Result < ( ) > {
@@ -56,5 +59,6 @@ pub async fn run(shell: &Shell, args: TestCommands) -> anyhow::Result<()> {
56
59
TestCommands :: L1Contracts => l1_contracts:: run ( shell) ,
57
60
TestCommands :: Prover => prover:: run ( shell) ,
58
61
TestCommands :: Wallet => wallet:: run ( shell) ,
62
+ TestCommands :: Loadtest => loadtest:: run ( shell) ,
59
63
}
60
64
}
You can’t perform that action at this time.
0 commit comments