mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-07 00:42:42 +00:00
Fix lcli merge conflicts
This commit is contained in:
64
Cargo.lock
generated
64
Cargo.lock
generated
@@ -917,7 +917,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
"proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)",
|
"syn 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -1110,7 +1110,7 @@ dependencies = [
|
|||||||
"toml 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
"toml 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"tree_hash 0.1.1",
|
"tree_hash 0.1.1",
|
||||||
"types 0.2.0",
|
"types 0.2.0",
|
||||||
"web3 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"web3 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -1122,7 +1122,7 @@ dependencies = [
|
|||||||
"serde_json 1.0.51 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde_json 1.0.51 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"tokio 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
|
"tokio 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"types 0.2.0",
|
"types 0.2.0",
|
||||||
"web3 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"web3 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -1491,6 +1491,61 @@ dependencies = [
|
|||||||
"num_cpus 1.13.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"num_cpus 1.13.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "futures-executor"
|
||||||
|
version = "0.3.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
dependencies = [
|
||||||
|
"futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"futures-task 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "futures-io"
|
||||||
|
version = "0.3.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "futures-macro"
|
||||||
|
version = "0.3.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro-hack 0.5.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"syn 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "futures-sink"
|
||||||
|
version = "0.3.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "futures-task"
|
||||||
|
version = "0.3.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "futures-util"
|
||||||
|
version = "0.3.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
dependencies = [
|
||||||
|
"futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"futures-channel 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"futures-io 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"futures-macro 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"futures-sink 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"futures-task 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"pin-utils 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"proc-macro-hack 0.5.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"proc-macro-nested 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "gcc"
|
name = "gcc"
|
||||||
version = "0.3.55"
|
version = "0.3.55"
|
||||||
@@ -5721,6 +5776,7 @@ dependencies = [
|
|||||||
"checksum mio-named-pipes 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "f5e374eff525ce1c5b7687c4cef63943e7686524a387933ad27ca7ec43779cb3"
|
"checksum mio-named-pipes 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "f5e374eff525ce1c5b7687c4cef63943e7686524a387933ad27ca7ec43779cb3"
|
||||||
"checksum mio-uds 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)" = "966257a94e196b11bb43aca423754d87429960a768de9414f3691d6957abf125"
|
"checksum mio-uds 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)" = "966257a94e196b11bb43aca423754d87429960a768de9414f3691d6957abf125"
|
||||||
"checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919"
|
"checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919"
|
||||||
|
"checksum miow 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "396aa0f2003d7df8395cb93e09871561ccc3e785f0acb369170e8cc74ddf9226"
|
||||||
"checksum multistream-select 0.6.1 (git+https://github.com/SigP/rust-libp2p?rev=71cf486b4d992862f5a05f9f4ef5e5c1631f4add)" = "<none>"
|
"checksum multistream-select 0.6.1 (git+https://github.com/SigP/rust-libp2p?rev=71cf486b4d992862f5a05f9f4ef5e5c1631f4add)" = "<none>"
|
||||||
"checksum native-tls 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "2b0d88c06fe90d5ee94048ba40409ef1d9315d86f6f38c2efdaad4fb50c58b2d"
|
"checksum native-tls 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "2b0d88c06fe90d5ee94048ba40409ef1d9315d86f6f38c2efdaad4fb50c58b2d"
|
||||||
"checksum net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88"
|
"checksum net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88"
|
||||||
@@ -5812,7 +5868,7 @@ dependencies = [
|
|||||||
"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
|
"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
|
||||||
"checksum rustls 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b25a18b1bf7387f0145e7f8324e700805aade3842dd3db2e74e4cdeb4677c09e"
|
"checksum rustls 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b25a18b1bf7387f0145e7f8324e700805aade3842dd3db2e74e4cdeb4677c09e"
|
||||||
"checksum rw-stream-sink 0.1.2 (git+https://github.com/SigP/rust-libp2p?rev=71cf486b4d992862f5a05f9f4ef5e5c1631f4add)" = "<none>"
|
"checksum rw-stream-sink 0.1.2 (git+https://github.com/SigP/rust-libp2p?rev=71cf486b4d992862f5a05f9f4ef5e5c1631f4add)" = "<none>"
|
||||||
"checksum ryu 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "535622e6be132bccd223f4bb2b8ac8d53cda3c7a6394944d3b2b33fb974f9d76"
|
"checksum ryu 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "ed3d612bc64430efeb3f7ee6ef26d590dce0c43249217bddc62112540c7941e1"
|
||||||
"checksum safemem 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072"
|
"checksum safemem 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072"
|
||||||
"checksum same-file 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502"
|
"checksum same-file 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502"
|
||||||
"checksum schannel 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)" = "039c25b130bd8c1321ee2d7de7fde2659fa9c2744e4bb29711cfc852ea53cd19"
|
"checksum schannel 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)" = "039c25b130bd8c1321ee2d7de7fde2659fa9c2744e4bb29711cfc852ea53cd19"
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ edition = "2018"
|
|||||||
eth1_test_rig = { path = "../../tests/eth1_test_rig" }
|
eth1_test_rig = { path = "../../tests/eth1_test_rig" }
|
||||||
environment = { path = "../../lighthouse/environment" }
|
environment = { path = "../../lighthouse/environment" }
|
||||||
toml = "^0.5"
|
toml = "^0.5"
|
||||||
web3 = "0.8.0"
|
web3 = "0.10.0"
|
||||||
sloggers = "0.3.4"
|
sloggers = "0.3.4"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ regex = "1.3.1"
|
|||||||
eth1_test_rig = { path = "../tests/eth1_test_rig" }
|
eth1_test_rig = { path = "../tests/eth1_test_rig" }
|
||||||
futures = {version = "0.3", features = ["compat"]}
|
futures = {version = "0.3", features = ["compat"]}
|
||||||
environment = { path = "../lighthouse/environment" }
|
environment = { path = "../lighthouse/environment" }
|
||||||
web3 = "0.8.0"
|
web3 = "0.10.0"
|
||||||
eth2_testnet_config = { path = "../eth2/utils/eth2_testnet_config" }
|
eth2_testnet_config = { path = "../eth2/utils/eth2_testnet_config" }
|
||||||
dirs = "2.0"
|
dirs = "2.0"
|
||||||
genesis = { path = "../beacon_node/genesis" }
|
genesis = { path = "../beacon_node/genesis" }
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ use deposit_contract::{
|
|||||||
CONTRACT_DEPLOY_GAS,
|
CONTRACT_DEPLOY_GAS,
|
||||||
};
|
};
|
||||||
use environment::Environment;
|
use environment::Environment;
|
||||||
use futures::{Future, IntoFuture};
|
use futures::compat::Future01CompatExt;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use types::EthSpec;
|
use types::EthSpec;
|
||||||
use web3::{
|
use web3::{
|
||||||
@@ -15,7 +15,10 @@ use web3::{
|
|||||||
Web3,
|
Web3,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub fn run<T: EthSpec>(mut env: Environment<T>, matches: &ArgMatches) -> Result<(), String> {
|
pub async fn run<T: EthSpec>(
|
||||||
|
_env: Environment<T>,
|
||||||
|
matches: &ArgMatches<'_>,
|
||||||
|
) -> Result<(), String> {
|
||||||
let eth1_ipc_path: PathBuf = clap_utils::parse_required(matches, "eth1-ipc")?;
|
let eth1_ipc_path: PathBuf = clap_utils::parse_required(matches, "eth1-ipc")?;
|
||||||
let from_address: Address = clap_utils::parse_required(matches, "from-address")?;
|
let from_address: Address = clap_utils::parse_required(matches, "from-address")?;
|
||||||
let confirmations: usize = clap_utils::parse_required(matches, "confirmations")?;
|
let confirmations: usize = clap_utils::parse_required(matches, "confirmations")?;
|
||||||
@@ -43,23 +46,21 @@ pub fn run<T: EthSpec>(mut env: Environment<T>, matches: &ArgMatches) -> Result<
|
|||||||
.await
|
.await
|
||||||
.map_err(|e| format!("Failed to get block number: {}", e))?;
|
.map_err(|e| format!("Failed to get block number: {}", e))?;
|
||||||
|
|
||||||
let address = env.runtime().block_on(
|
let pending_contract = Contract::deploy(web3.eth(), &ABI)
|
||||||
Contract::deploy(web3.eth(), &ABI)
|
.map_err(|e| format!("Unable to build contract deployer: {:?}", e))?
|
||||||
.map_err(|e| format!("Unable to build contract deployer: {:?}", e))?
|
.confirmations(confirmations)
|
||||||
.confirmations(confirmations)
|
.options(Options {
|
||||||
.options(Options {
|
gas: Some(U256::from(CONTRACT_DEPLOY_GAS)),
|
||||||
gas: Some(U256::from(CONTRACT_DEPLOY_GAS)),
|
..Options::default()
|
||||||
..Options::default()
|
})
|
||||||
})
|
.execute(bytecode, (), from_address)
|
||||||
.execute(bytecode, (), from_address)
|
.map_err(|e| format!("Unable to execute deployment: {:?}", e))?;
|
||||||
.into_future()
|
|
||||||
.map_err(|e| format!("Unable to execute deployment: {:?}", e))
|
let address = pending_contract
|
||||||
.and_then(|pending| {
|
.compat()
|
||||||
pending.map_err(|e| format!("Unable to await pending contract: {:?}", e))
|
.await
|
||||||
})
|
.map_err(|e| format!("Unable to await pending contract: {:?}", e))?
|
||||||
.map(|tx_receipt| tx_receipt.address())
|
.address();
|
||||||
.map_err(|e| format!("Failed to execute deployment: {:?}", e)),
|
|
||||||
)?;
|
|
||||||
|
|
||||||
println!("deposit_contract_address: {:?}", address);
|
println!("deposit_contract_address: {:?}", address);
|
||||||
println!("deposit_contract_deploy_block: {}", deploy_block);
|
println!("deposit_contract_deploy_block: {}", deploy_block);
|
||||||
|
|||||||
@@ -410,7 +410,7 @@ async fn main() {
|
|||||||
|
|
||||||
macro_rules! run_with_spec {
|
macro_rules! run_with_spec {
|
||||||
($env_builder: expr) => {
|
($env_builder: expr) => {
|
||||||
match run($env_builder, &matches) {
|
match run($env_builder, &matches).await {
|
||||||
Ok(()) => process::exit(0),
|
Ok(()) => process::exit(0),
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
println!("Failed to run lcli: {}", e);
|
println!("Failed to run lcli: {}", e);
|
||||||
@@ -421,9 +421,9 @@ async fn main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
match matches.value_of("spec") {
|
match matches.value_of("spec") {
|
||||||
Some("minimal") => run_with_spec!(EnvironmentBuilder::minimal()).await,
|
Some("minimal") => run_with_spec!(EnvironmentBuilder::minimal()),
|
||||||
Some("mainnet") => run_with_spec!(EnvironmentBuilder::mainnet()).await,
|
Some("mainnet") => run_with_spec!(EnvironmentBuilder::mainnet()),
|
||||||
Some("interop") => run_with_spec!(EnvironmentBuilder::interop()).await,
|
Some("interop") => run_with_spec!(EnvironmentBuilder::interop()),
|
||||||
spec => {
|
spec => {
|
||||||
// This path should be unreachable due to slog having a `default_value`
|
// This path should be unreachable due to slog having a `default_value`
|
||||||
unreachable!("Unknown spec configuration: {:?}", spec);
|
unreachable!("Unknown spec configuration: {:?}", spec);
|
||||||
@@ -431,7 +431,10 @@ async fn main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn run<T: EthSpec>(env_builder: EnvironmentBuilder<T>, matches: &ArgMatches) -> Result<(), String> {
|
async fn run<T: EthSpec>(
|
||||||
|
env_builder: EnvironmentBuilder<T>,
|
||||||
|
matches: &ArgMatches<'_>,
|
||||||
|
) -> Result<(), String> {
|
||||||
let env = env_builder
|
let env = env_builder
|
||||||
.multi_threaded_tokio_runtime()
|
.multi_threaded_tokio_runtime()
|
||||||
.map_err(|e| format!("should start tokio runtime: {:?}", e))?
|
.map_err(|e| format!("should start tokio runtime: {:?}", e))?
|
||||||
@@ -485,14 +488,15 @@ fn run<T: EthSpec>(env_builder: EnvironmentBuilder<T>, matches: &ArgMatches) ->
|
|||||||
run_parse_hex::<T>(matches).map_err(|e| format!("Failed to pretty print hex: {}", e))
|
run_parse_hex::<T>(matches).map_err(|e| format!("Failed to pretty print hex: {}", e))
|
||||||
}
|
}
|
||||||
("deploy-deposit-contract", Some(matches)) => {
|
("deploy-deposit-contract", Some(matches)) => {
|
||||||
deploy_deposit_contract::run::<T>(env, matches)
|
deploy_deposit_contract::run::<T>(env, matches).await
|
||||||
.map_err(|e| format!("Failed to run deploy-deposit-contract command: {}", e))
|
.map_err(|e| format!("Failed to run deploy-deposit-contract command: {}", e))
|
||||||
}
|
}
|
||||||
("refund-deposit-contract", Some(matches)) => {
|
("refund-deposit-contract", Some(matches)) => {
|
||||||
refund_deposit_contract::run::<T>(env, matches)
|
refund_deposit_contract::run::<T>(env, matches).await
|
||||||
.map_err(|e| format!("Failed to run refund-deposit-contract command: {}", e))
|
.map_err(|e| format!("Failed to run refund-deposit-contract command: {}", e))
|
||||||
}
|
}
|
||||||
("eth1-genesis", Some(matches)) => eth1_genesis::run::<T>(env, matches)
|
("eth1-genesis", Some(matches)) => eth1_genesis::run::<T>(env, matches)
|
||||||
|
.await
|
||||||
.map_err(|e| format!("Failed to run eth1-genesis command: {}", e)),
|
.map_err(|e| format!("Failed to run eth1-genesis command: {}", e)),
|
||||||
("interop-genesis", Some(matches)) => interop_genesis::run::<T>(env, matches)
|
("interop-genesis", Some(matches)) => interop_genesis::run::<T>(env, matches)
|
||||||
.map_err(|e| format!("Failed to run interop-genesis command: {}", e)),
|
.map_err(|e| format!("Failed to run interop-genesis command: {}", e)),
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
use clap::ArgMatches;
|
use clap::ArgMatches;
|
||||||
use environment::Environment;
|
use environment::Environment;
|
||||||
use futures::Future;
|
use futures::compat::Future01CompatExt;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use types::EthSpec;
|
use types::EthSpec;
|
||||||
use web3::{
|
use web3::{
|
||||||
@@ -12,7 +12,7 @@ use web3::{
|
|||||||
/// `keccak("steal()")[0..4]`
|
/// `keccak("steal()")[0..4]`
|
||||||
pub const STEAL_FN_SIGNATURE: &[u8] = &[0xcf, 0x7a, 0x89, 0x65];
|
pub const STEAL_FN_SIGNATURE: &[u8] = &[0xcf, 0x7a, 0x89, 0x65];
|
||||||
|
|
||||||
pub fn run<T: EthSpec>(mut env: Environment<T>, matches: &ArgMatches) -> Result<(), String> {
|
pub async fn run<T: EthSpec>(_env: Environment<T>, matches: &ArgMatches<'_>) -> Result<(), String> {
|
||||||
let eth1_ipc_path: PathBuf = clap_utils::parse_required(matches, "eth1-ipc")?;
|
let eth1_ipc_path: PathBuf = clap_utils::parse_required(matches, "eth1-ipc")?;
|
||||||
let from: Address = clap_utils::parse_required(matches, "from-address")?;
|
let from: Address = clap_utils::parse_required(matches, "from-address")?;
|
||||||
let contract_address: Address = clap_utils::parse_required(matches, "contract-address")?;
|
let contract_address: Address = clap_utils::parse_required(matches, "contract-address")?;
|
||||||
@@ -21,20 +21,21 @@ pub fn run<T: EthSpec>(mut env: Environment<T>, matches: &ArgMatches) -> Result<
|
|||||||
Ipc::new(eth1_ipc_path).map_err(|e| format!("Unable to connect to eth1 IPC: {:?}", e))?;
|
Ipc::new(eth1_ipc_path).map_err(|e| format!("Unable to connect to eth1 IPC: {:?}", e))?;
|
||||||
let web3 = Web3::new(transport);
|
let web3 = Web3::new(transport);
|
||||||
|
|
||||||
env.runtime().block_on(
|
let _ = web3
|
||||||
web3.eth()
|
.eth()
|
||||||
.send_transaction(TransactionRequest {
|
.send_transaction(TransactionRequest {
|
||||||
from,
|
from,
|
||||||
to: Some(contract_address),
|
to: Some(contract_address),
|
||||||
gas: Some(U256::from(400_000)),
|
gas: Some(U256::from(400_000)),
|
||||||
gas_price: None,
|
gas_price: None,
|
||||||
value: Some(U256::zero()),
|
value: Some(U256::zero()),
|
||||||
data: Some(STEAL_FN_SIGNATURE.into()),
|
data: Some(STEAL_FN_SIGNATURE.into()),
|
||||||
nonce: None,
|
nonce: None,
|
||||||
condition: None,
|
condition: None,
|
||||||
})
|
})
|
||||||
.map_err(|e| format!("Failed to call deposit fn: {:?}", e)),
|
.compat()
|
||||||
)?;
|
.await
|
||||||
|
.map_err(|e| format!("Failed to call deposit fn: {:?}", e))?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ authors = ["Paul Hauner <paul@paulhauner.com>"]
|
|||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
web3 = "0.8.0"
|
web3 = "0.10.0"
|
||||||
tokio = { version = "0.2", features = ["time"] }
|
tokio = { version = "0.2", features = ["time"] }
|
||||||
futures = { version = "0.3", features = ["compat"] }
|
futures = { version = "0.3", features = ["compat"] }
|
||||||
types = { path = "../../eth2/types"}
|
types = { path = "../../eth2/types"}
|
||||||
|
|||||||
Reference in New Issue
Block a user