Skip to content

Commit

Permalink
Fix Eth::uncle
Browse files Browse the repository at this point in the history
  • Loading branch information
vorot93 committed Nov 18, 2020
1 parent ac198be commit 23ddb40
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/api/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use crate::api::Namespace;
use crate::helpers::{self, CallFuture};
use crate::types::{
Address, Block, BlockId, BlockNumber, Bytes, CallRequest, Filter, Index, Log, SyncState, Transaction,
Address, Block, BlockHeader, BlockId, BlockNumber, Bytes, CallRequest, Filter, Index, Log, SyncState, Transaction,
TransactionId, TransactionReceipt, TransactionRequest, Work, H256, H520, H64, U256, U64,
};
use crate::Transport;
Expand Down Expand Up @@ -220,7 +220,7 @@ impl<T: Transport> Eth<T> {
}

/// Get uncle by block ID and uncle index -- transactions only has hashes.
pub fn uncle(&self, block: BlockId, index: Index) -> CallFuture<Option<Block<H256>>, T::Out> {
pub fn uncle(&self, block: BlockId, index: Index) -> CallFuture<Option<BlockHeader>, T::Out> {
let index = helpers::serialize(&index);

let result = match block {
Expand Down Expand Up @@ -335,8 +335,8 @@ mod tests {
use crate::api::Namespace;
use crate::rpc::Value;
use crate::types::{
Address, Block, BlockId, BlockNumber, Bytes, CallRequest, FilterBuilder, Log, SyncInfo, SyncState, Transaction,
TransactionId, TransactionReceipt, TransactionRequest, Work, H256, H520, H64,
Address, Block, BlockHeader, BlockId, BlockNumber, Bytes, CallRequest, FilterBuilder, Log, SyncInfo, SyncState,
Transaction, TransactionId, TransactionReceipt, TransactionRequest, Work, H256, H520, H64,
};

use super::Eth;
Expand Down Expand Up @@ -656,7 +656,7 @@ mod tests {
=>
"eth_getUncleByBlockHashAndIndex", vec![r#""0x0000000000000000000000000000000000000000000000000000000000000123""#, r#""0x5""#];
::serde_json::from_str(EXAMPLE_BLOCK).unwrap()
=> Some(::serde_json::from_str::<Block<H256>>(EXAMPLE_BLOCK).unwrap())
=> Some(::serde_json::from_str::<BlockHeader>(EXAMPLE_BLOCK).unwrap())
);

rpc_test! (
Expand Down

0 comments on commit 23ddb40

Please sign in to comment.