Port account_manager to stable futures (#1121)

* Port account_manager to stable futures

* Run async fns in tokio environment
This commit is contained in:
Pawan Dhananjay
2020-05-08 07:19:36 +05:30
committed by GitHub
parent 1f2acad0df
commit 8e81ea911d
4 changed files with 189 additions and 201 deletions

View File

@@ -304,11 +304,11 @@ impl ValidatorDirectoryBuilder {
}
pub async fn submit_eth1_deposit<T: Transport>(
&self,
self,
web3: Web3<T>,
from: Address,
deposit_contract: Address,
) -> Result<Hash256, String> {
) -> Result<(Self, Hash256), String> {
let (deposit_data, deposit_amount) = self.get_deposit_data()?;
web3.eth()
.send_transaction(TransactionRequest {
@@ -324,6 +324,7 @@ impl ValidatorDirectoryBuilder {
.compat()
.await
.map_err(|e| format!("Failed to send transaction: {:?}", e))
.map(|tx| (self, tx))
}
pub fn build(self) -> Result<ValidatorDirectory, String> {