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.
This commit is contained in:
Hernando Castano
2020-05-19 14:03:08 -04:00
committed by Bastian Köcher
parent 7a3468a919
commit 5bcae00f19
3 changed files with 10 additions and 10 deletions
+1 -1
View File
@@ -28,7 +28,7 @@ serde = { version = "1.0.110", features = ["derive"] }
serde_json = "1.0.53" serde_json = "1.0.53"
sp-bridge-eth-poa = { path = "../../primitives/ethereum-poa" } sp-bridge-eth-poa = { path = "../../primitives/ethereum-poa" }
time = "0.2" time = "0.2"
web3 = { git = "https://github.com/svyatonik/rust-web3.git", branch = "add-receipt-root" } web3 = "0.11"
# Substrate Based Dependencies # Substrate Based Dependencies
[dependencies.frame-system] [dependencies.frame-system]
@@ -152,12 +152,12 @@ pub async fn header_by_number(client: Client, number: u64) -> (Client, Result<He
.await; .await;
( (
client, client,
header.and_then( header.and_then(|header: Header| {
|header: Header| match header.number.is_some() && header.hash.is_some() { match header.number.is_some() && header.hash.is_some() && header.logs_bloom.is_some() {
true => Ok(header), true => Ok(header),
false => Err(Error::IncompleteHeader), false => Err(Error::IncompleteHeader),
}, }
), }),
) )
} }
@@ -174,12 +174,12 @@ pub async fn header_by_hash(client: Client, hash: H256) -> (Client, Result<Heade
.await; .await;
( (
client, client,
header.and_then( header.and_then(|header: Header| {
|header: Header| match header.number.is_none() && header.hash.is_none() { match header.number.is_some() && header.hash.is_some() && header.logs_bloom.is_some() {
true => Ok(header), true => Ok(header),
false => Err(Error::IncompleteHeader), false => Err(Error::IncompleteHeader),
}, }
), }),
) )
} }
@@ -88,7 +88,7 @@ pub fn into_substrate_ethereum_header(header: &EthereumHeader) -> SubstrateEther
extra_data: header.extra_data.0.clone(), extra_data: header.extra_data.0.clone(),
state_root: header.state_root, state_root: header.state_root,
receipts_root: header.receipts_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_used: header.gas_used,
gas_limit: header.gas_limit, gas_limit: header.gas_limit,
difficulty: header.difficulty, difficulty: header.difficulty,