diff --git a/lcli/Cargo.toml b/lcli/Cargo.toml index 43d2743d5a..d4afbdbeac 100644 --- a/lcli/Cargo.toml +++ b/lcli/Cargo.toml @@ -27,4 +27,4 @@ dirs = "2.0" genesis = { path = "../beacon_node/genesis" } deposit_contract = { path = "../eth2/utils/deposit_contract" } tree_hash = { path = "../eth2/utils/tree_hash" } -tokio = { version = "0.3", features = ["full"] } +tokio = { version = "0.2", features = ["full"] } diff --git a/tests/eth1_test_rig/src/lib.rs b/tests/eth1_test_rig/src/lib.rs index 2513593137..a861c06b58 100644 --- a/tests/eth1_test_rig/src/lib.rs +++ b/tests/eth1_test_rig/src/lib.rs @@ -190,31 +190,31 @@ impl DepositContract { .get(DEPOSIT_ACCOUNTS_INDEX) .cloned() .ok_or_else(|| "Insufficient accounts for deposit".to_string()) - }) - .and_then(move |from| { - let tx_request = TransactionRequest { - from, - to: Some(contract.address()), - gas: Some(U256::from(DEPOSIT_GAS)), - gas_price: None, - value: Some(from_gwei(deposit_data.amount)), - // Note: the reason we use this `TransactionRequest` instead of just using the - // function in `self.contract` is so that the `encode_eth1_tx_data` function gets used - // during testing. - // - // It's important that `encode_eth1_tx_data` stays correct and does not suffer from - // code-rot. - data: encode_eth1_tx_data(&deposit_data).map(Into::into).ok(), - nonce: None, - condition: None, - }; + })?; + let tx_request = TransactionRequest { + from, + to: Some(self.contract.address()), + gas: Some(U256::from(DEPOSIT_GAS)), + gas_price: None, + value: Some(from_gwei(deposit_data.amount)), + // Note: the reason we use this `TransactionRequest` instead of just using the + // function in `self.contract` is so that the `eth1_tx_data` function gets used + // during testing. + // + // It's important that `eth1_tx_data` stays correct and does not suffer from + // code-rot. + data: encode_eth1_tx_data(&deposit_data).map(Into::into).ok(), + nonce: None, + condition: None, + }; - web3_1 - .eth() - .send_transaction(tx_request) - .compa().await() - .map_err(|e| format!("Failed to call deposit fn: {:?}", e))?; - Ok()) + self.web3 + .eth() + .send_transaction(tx_request) + .compat() + .await + .map_err(|e| format!("Failed to call deposit fn: {:?}", e))?; + Ok(()) } /// Peforms many deposits, each preceded by a delay.