archive: Fetch body, genesisHash and header (#1560)

This PR lays the foundation for implementing the archive RPC methods.

The methods implemented by this PR:
- archive_unstable_body: Fetch the block's body (a vector of hex-encoded
scale-encoded extrinsics) from a given block hash
- archive_unstable_genesisHash: Fetch the genesis hash
- archive_unstable_header: Fetch the header from a given block hash

Added unit tests for the methods.

This PR is implementing the methods without exposing them to the RPC
layer; which are to be exposed by a follow-up PR.

Closes: https://github.com/paritytech/polkadot-sdk/issues/1509 
Closes: https://github.com/paritytech/polkadot-sdk/issues/1514

@paritytech/subxt-team

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This commit is contained in:
Alexandru Vasile
2023-09-19 14:29:22 +03:00
committed by GitHub
parent 6079b6dd3a
commit f3061c14bf
5 changed files with 287 additions and 0 deletions
+1
View File
@@ -23,6 +23,7 @@
#![warn(missing_docs)]
#![deny(unused_crate_dependencies)]
pub mod archive;
pub mod chain_head;
pub mod chain_spec;
pub mod transaction;