mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 06:21:02 +00:00
chain-api subsystem: implement BlockHeader messsage (#1778)
* chain-api subsystem: implement BlockHeader messsage * update the guide
This commit is contained in:
@@ -14,6 +14,7 @@ On receipt of `ChainApiMessage`, answer the request and provide the response to
|
||||
|
||||
Currently, the following requests are supported:
|
||||
* Block hash to number
|
||||
* Block hash to header
|
||||
* Finalized block number to hash
|
||||
* Last finalized block number
|
||||
* Ancestors
|
||||
|
||||
@@ -140,6 +140,9 @@ enum ChainApiMessage {
|
||||
/// Get the block number by hash.
|
||||
/// Returns `None` if a block with the given hash is not present in the db.
|
||||
BlockNumber(Hash, ResponseChannel<Result<Option<BlockNumber>, Error>>),
|
||||
/// Request the block header by hash.
|
||||
/// Returns `None` if a block with the given hash is not present in the db.
|
||||
BlockHeader(Hash, ResponseChannel<Result<Option<BlockHeader>, Error>>),
|
||||
/// Get the finalized block hash by number.
|
||||
/// Returns `None` if a block with the given number is not present in the db.
|
||||
/// Note: the caller must ensure the block is finalized.
|
||||
|
||||
Reference in New Issue
Block a user