From 3b2741d0ff724953b4ee0c1942c963ba3924117b Mon Sep 17 00:00:00 2001 From: Hernando Castano Date: Tue, 19 May 2020 14:03:08 -0400 Subject: [PATCH] Bump rust-web3 to latest v0.11 (#100) * Bump rust-web3 to latest master * Use tagged release from crates.io * Add check for `logs_bloom` Since this is required by the runtime we want to enforce that an incoming header has this. --- bridges/relays/ethereum/Cargo.toml | 2 +- bridges/relays/ethereum/src/ethereum_client.rs | 16 ++++++++-------- bridges/relays/ethereum/src/substrate_types.rs | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/bridges/relays/ethereum/Cargo.toml b/bridges/relays/ethereum/Cargo.toml index d0bc37073d537..c41b13d22ed42 100644 --- a/bridges/relays/ethereum/Cargo.toml +++ b/bridges/relays/ethereum/Cargo.toml @@ -28,7 +28,7 @@ serde = { version = "1.0.110", features = ["derive"] } serde_json = "1.0.53" sp-bridge-eth-poa = { path = "../../primitives/ethereum-poa" } time = "0.2" -web3 = { git = "https://github.com/svyatonik/rust-web3.git", branch = "add-receipt-root" } +web3 = "0.11" # Substrate Based Dependencies [dependencies.frame-system] diff --git a/bridges/relays/ethereum/src/ethereum_client.rs b/bridges/relays/ethereum/src/ethereum_client.rs index ac70c310449d0..974d5ddeff7ba 100644 --- a/bridges/relays/ethereum/src/ethereum_client.rs +++ b/bridges/relays/ethereum/src/ethereum_client.rs @@ -152,12 +152,12 @@ pub async fn header_by_number(client: Client, number: u64) -> (Client, Result Ok(header), false => Err(Error::IncompleteHeader), - }, - ), + } + }), ) } @@ -174,12 +174,12 @@ pub async fn header_by_hash(client: Client, hash: H256) -> (Client, Result Ok(header), false => Err(Error::IncompleteHeader), - }, - ), + } + }), ) } diff --git a/bridges/relays/ethereum/src/substrate_types.rs b/bridges/relays/ethereum/src/substrate_types.rs index 89e8572ccaaba..66e5aee67282b 100644 --- a/bridges/relays/ethereum/src/substrate_types.rs +++ b/bridges/relays/ethereum/src/substrate_types.rs @@ -88,7 +88,7 @@ pub fn into_substrate_ethereum_header(header: &EthereumHeader) -> SubstrateEther extra_data: header.extra_data.0.clone(), state_root: header.state_root, receipts_root: header.receipts_root, - log_bloom: header.logs_bloom.data().into(), + log_bloom: header.logs_bloom.unwrap_or_default().data().into(), gas_used: header.gas_used, gas_limit: header.gas_limit, difficulty: header.difficulty,