diff options
author | Antoine A <> | 2023-11-21 00:47:30 +0100 |
---|---|---|
committer | Antoine A <> | 2023-11-21 00:47:30 +0100 |
commit | 42ba478f5dc26e0e2654112d3dba33e61ffdc1fa (patch) | |
tree | bf1779667ccffbdc396a7029c7c700de2a7e76ad /instrumentation/src/eth.rs | |
parent | c3f80619983e4eb80897c87add51bc70594e4b54 (diff) | |
download | depolymerization-42ba478f5dc26e0e2654112d3dba33e61ffdc1fa.tar.gz depolymerization-42ba478f5dc26e0e2654112d3dba33e61ffdc1fa.tar.bz2 depolymerization-42ba478f5dc26e0e2654112d3dba33e61ffdc1fa.zip |
Support ethereum 1.13.5
Use POA ethereum network for tests
Improve test runner
Update dependencies
Diffstat (limited to 'instrumentation/src/eth.rs')
-rw-r--r-- | instrumentation/src/eth.rs | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/instrumentation/src/eth.rs b/instrumentation/src/eth.rs index f6aa719..f215fd3 100644 --- a/instrumentation/src/eth.rs +++ b/instrumentation/src/eth.rs @@ -247,19 +247,6 @@ impl EthCtx { "create account", ) } - cmd_redirect_ok( - "geth", - &[ - "--datadir", - ctx.wire2_dir.to_str().unwrap(), - "account", - "new", - "--password", - pswd_path.to_str().unwrap(), - ], - &ctx.log("geth2"), - "create account", - ); let list = cmd_out( "geth", &[ @@ -269,7 +256,8 @@ impl EthCtx { "list", ], ); - let addr = &list.lines().nth(1).unwrap()[13..][..40]; + let reserve = &list[13..][..40]; + let client = &list.lines().nth(1).unwrap()[13..][..40]; let genesis = format!( "{{ \"config\": {{ @@ -284,16 +272,19 @@ impl EthCtx { \"istanbulBlock\": 0, \"berlinBlock\": 0, \"londonBlock:\": 0, - \"ethash\": {{}} + \"clique\": {{ + \"period\": 1 + }} }}, \"difficulty\": \"1\", \"gasLimit\": \"0\", \"baseFeePerGas\": null, + \"extraData\": \"0x0000000000000000000000000000000000000000000000000000000000000000{}0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\", \"alloc\": {{ \"{}\": {{ \"balance\": \"10000000000000000000\" }} }} }}", - addr + reserve, client ); std::fs::write(ctx.wire_dir.join("genesis.json"), genesis.as_bytes()).unwrap(); @@ -330,6 +321,7 @@ impl EthCtx { &unused_port().to_string(), "--port", &unused_port().to_string(), + "--rpc.enabledeprecatedpersonal" ], &ctx.log("geth"), ); @@ -338,7 +330,7 @@ impl EthCtx { // Generate wallet let out = cmd_out( - "eth-wire", + &ctx.wire_bin_path, &["-c", ctx.conf.to_str().unwrap(), "initwallet"], ); @@ -426,6 +418,8 @@ impl EthCtx { &[ "--datadir", self.ctx.wire2_dir.to_str().unwrap(), + "--keystore", + self.ctx.wire_dir.join("keystore").to_str().unwrap(), "import", path, ], @@ -440,12 +434,15 @@ impl EthCtx { &[ "--datadir", self.ctx.wire2_dir.to_str().unwrap(), + "--keystore", + self.ctx.wire_dir.join("keystore").to_str().unwrap(), "--miner.gasprice", "10", "--authrpc.port", &unused_port().to_string(), "--port", &unused_port().to_string(), + "--rpc.enabledeprecatedpersonal" ], &self.ctx.log("geth2"), ); @@ -488,6 +485,7 @@ impl EthCtx { &unused_port().to_string(), "--port", &unused_port().to_string(), + "--rpc.enabledeprecatedpersonal" ], &self.ctx.log("geth"), ); @@ -556,6 +554,7 @@ impl EthCtx { fn _mine(rpc: &mut Rpc, addr: &H160, mut amount: u16, passwd: &str) { rpc.unlock_account(addr, passwd).ok(); + rpc.miner_set_etherbase(addr).ok(); let mut rpc = rpc.subscribe_new_head().unwrap(); rpc.miner_start().unwrap(); |