mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-18 05:18:30 +00:00
Port lcli to stable futures
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
use clap::ArgMatches;
|
||||
use environment::Environment;
|
||||
use eth1_test_rig::DepositContract;
|
||||
use futures::compat::Future01CompatExt;
|
||||
use std::fs::File;
|
||||
use std::io::Read;
|
||||
use types::EthSpec;
|
||||
use web3::{transports::Http, Web3};
|
||||
|
||||
pub fn run<T: EthSpec>(mut env: Environment<T>, matches: &ArgMatches) -> Result<(), String> {
|
||||
pub async fn run<T: EthSpec>(mut env: Environment<T>, matches: &ArgMatches) -> Result<(), String> {
|
||||
let confirmations = matches
|
||||
.value_of("confirmations")
|
||||
.ok_or_else(|| "Confirmations not specified")?
|
||||
@@ -32,9 +33,11 @@ pub fn run<T: EthSpec>(mut env: Environment<T>, matches: &ArgMatches) -> Result<
|
||||
//
|
||||
// We only need the deposit block to put a lower bound on the block number we need to search
|
||||
// for deposit logs.
|
||||
let deploy_block = env
|
||||
.runtime()
|
||||
.block_on(web3.eth().block_number())
|
||||
let deploy_block = web3
|
||||
.eth()
|
||||
.block_number()
|
||||
.compat()
|
||||
.await
|
||||
.map_err(|e| format!("Failed to get block number: {}", e))?;
|
||||
|
||||
info!("Present eth1 block number is {}", deploy_block);
|
||||
@@ -46,13 +49,8 @@ pub fn run<T: EthSpec>(mut env: Environment<T>, matches: &ArgMatches) -> Result<
|
||||
confirmations
|
||||
);
|
||||
|
||||
let deposit_contract = env
|
||||
.runtime()
|
||||
.block_on(DepositContract::deploy_testnet(
|
||||
web3,
|
||||
confirmations,
|
||||
password,
|
||||
))
|
||||
let deposit_contract = DepositContract::deploy_testnet(web3, confirmations, password)
|
||||
.await
|
||||
.map_err(|e| format!("Failed to deploy contract: {}", e))?;
|
||||
|
||||
info!(
|
||||
|
||||
Reference in New Issue
Block a user