jsonrpc optionals
This commit is contained in:
@@ -31,6 +31,7 @@ use service::{NetSyncMessage, SyncMessage};
|
||||
use env_info::LastHashes;
|
||||
use verification::*;
|
||||
use block::*;
|
||||
use transaction::SignedTransaction;
|
||||
pub use blockchain::TreeRoute;
|
||||
|
||||
/// General block status
|
||||
@@ -104,6 +105,9 @@ pub trait BlockChainClient : Sync + Send {
|
||||
/// Get block total difficulty.
|
||||
fn block_total_difficulty_at(&self, n: BlockNumber) -> Option<U256>;
|
||||
|
||||
/// Get transaction with given hash.
|
||||
fn transaction(&self, hash: &H256) -> Option<SignedTransaction>;
|
||||
|
||||
/// Get a tree route between `from` and `to`.
|
||||
/// See `BlockChain::tree_route`.
|
||||
fn tree_route(&self, from: &H256, to: &H256) -> Option<TreeRoute>;
|
||||
@@ -388,6 +392,10 @@ impl BlockChainClient for Client {
|
||||
self.chain.read().unwrap().block_hash(n).and_then(|h| self.block_total_difficulty(&h))
|
||||
}
|
||||
|
||||
fn transaction(&self, hash: &H256) -> Option<SignedTransaction> {
|
||||
self.chain.read().unwrap().transaction(hash)
|
||||
}
|
||||
|
||||
fn tree_route(&self, from: &H256, to: &H256) -> Option<TreeRoute> {
|
||||
self.chain.read().unwrap().tree_route(from.clone(), to.clone())
|
||||
}
|
||||
|
||||
@@ -98,6 +98,7 @@ pub mod ethereum;
|
||||
pub mod header;
|
||||
pub mod service;
|
||||
pub mod spec;
|
||||
pub mod transaction;
|
||||
pub mod views;
|
||||
pub mod receipt;
|
||||
|
||||
@@ -115,7 +116,6 @@ mod state;
|
||||
mod account;
|
||||
mod account_db;
|
||||
mod action_params;
|
||||
mod transaction;
|
||||
mod null_engine;
|
||||
mod builtin;
|
||||
mod extras;
|
||||
|
||||
@@ -156,8 +156,7 @@ impl Transaction {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// Signed transaction information.
|
||||
#[derive(Debug, Clone, Eq)]
|
||||
pub struct SignedTransaction {
|
||||
/// Plain Transaction.
|
||||
|
||||
Reference in New Issue
Block a user