eth_block fetching RPCs

This commit is contained in:
Robert Habermeier
2017-03-28 17:15:36 +02:00
parent d8893b959d
commit 73fa0cdc31
4 changed files with 152 additions and 4 deletions

View File

@@ -199,6 +199,12 @@ impl Block {
/// Decode to a full block.
pub fn decode(&self) -> FullBlock { ::rlp::decode(&self.0) }
/// Decode the header.
pub fn decode_header(&self) -> FullHeader { self.rlp().val_at(0) }
/// Clone the encoded header.
pub fn header(&self) -> Header { Header(self.rlp().at(0).as_raw().to_vec()) }
/// Get the rlp of this block.
#[inline]
pub fn rlp(&self) -> Rlp {