make total difficulty field optional

This commit is contained in:
Robert Habermeier 2017-02-06 15:28:16 +01:00
parent def47b4042
commit b32cb7a97d
3 changed files with 4 additions and 4 deletions

View File

@ -144,7 +144,7 @@ impl<C, SN: ?Sized, S: ?Sized, M, EM> EthClient<C, SN, S, M, EM> where
logs_bloom: view.log_bloom().into(),
timestamp: view.timestamp().into(),
difficulty: view.difficulty().into(),
total_difficulty: total_difficulty.into(),
total_difficulty: Some(total_difficulty.into()),
seal_fields: view.seal().into_iter().map(Into::into).collect(),
uncles: block.uncle_hashes().into_iter().map(Into::into).collect(),
transactions: match include_txs {
@ -194,7 +194,7 @@ impl<C, SN: ?Sized, S: ?Sized, M, EM> EthClient<C, SN, S, M, EM> where
logs_bloom: uncle.log_bloom().clone().into(),
timestamp: uncle.timestamp().into(),
difficulty: uncle.difficulty().clone().into(),
total_difficulty: (uncle.difficulty().clone() + parent_difficulty).into(),
total_difficulty: Some((uncle.difficulty().clone() + parent_difficulty).into()),
receipts_root: uncle.receipts_root().clone().into(),
extra_data: uncle.extra_data().clone().into(),
seal_fields: uncle.seal().into_iter().cloned().map(Into::into).collect(),

View File

@ -181,7 +181,7 @@ impl Eth for EthClient {
self.account(address.into(), num.0.into()).map(|acc| acc.balance.into()).boxed()
}
fn storage_at(&self, address: RpcH160, key: RpcU256, num: Trailing<BlockNumber>) -> BoxFuture<RpcH256, Error> {
fn storage_at(&self, _address: RpcH160, _key: RpcU256, _num: Trailing<BlockNumber>) -> BoxFuture<RpcH256, Error> {
future::err(errors::unimplemented(None)).boxed()
}

View File

@ -83,7 +83,7 @@ pub struct Block {
pub difficulty: U256,
/// Total difficulty
#[serde(rename="totalDifficulty")]
pub total_difficulty: U256,
pub total_difficulty: Option<U256>,
/// Seal fields
#[serde(rename="sealFields")]
pub seal_fields: Vec<Bytes>,