eth_block fetching RPCs
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user