uncle returns rlp

This commit is contained in:
NikVolf 2016-06-29 21:08:34 +03:00
parent 562e591ed3
commit 5337de8d42
3 changed files with 5 additions and 4 deletions

View File

@ -48,6 +48,7 @@ pub use types::blockchain_info::BlockChainInfo;
pub use types::block_status::BlockStatus;
use evm::Factory as EvmFactory;
use miner::{Miner, MinerService, TransactionImportResult, AccountDetails};
use basic_types::*;
use ipc::IpcConfig;
use ipc::binary::{BinaryConvertable, BinaryConvertError};
@ -576,9 +577,9 @@ impl BlockChainClient for Client {
self.transaction_address(id).and_then(|address| self.chain.transaction(&address))
}
fn uncle(&self, id: UncleID) -> Option<Header> {
fn uncle(&self, id: UncleID) -> Option<Bytes> {
let index = id.position;
self.block(id.block).and_then(|block| BlockView::new(&block).uncle_at(index))
self.block(id.block).and_then(|block| BlockView::new(&block).uncle_at(index).and_then(|u| Some(u.rlp(Seal::With))))
}
fn transaction_receipt(&self, id: TransactionID) -> Option<LocalizedReceipt> {

View File

@ -126,7 +126,7 @@ pub trait BlockChainClient : Sync + Send {
fn transaction(&self, id: TransactionID) -> Option<LocalizedTransaction>;
/// Get uncle with given id.
fn uncle(&self, id: UncleID) -> Option<Header>;
fn uncle(&self, id: UncleID) -> Option<Bytes>;
/// Get transaction receipt with given hash.
fn transaction_receipt(&self, id: TransactionID) -> Option<LocalizedReceipt>;

View File

@ -294,7 +294,7 @@ impl BlockChainClient for TestBlockChainClient {
unimplemented!();
}
fn uncle(&self, _id: UncleID) -> Option<BlockHeader> {
fn uncle(&self, _id: UncleID) -> Option<Bytes> {
unimplemented!();
}