babe: add comments to block weight and expose block_weight function (#9145)

* babe: add comments to block weight and expose block_weight function

* babe: expose function for block weight key
This commit is contained in:
André Silva
2021-06-19 13:40:53 +01:00
committed by GitHub
parent 90d47870a9
commit 0417e4e37f
3 changed files with 63 additions and 55 deletions
@@ -32,7 +32,8 @@ const BABE_EPOCH_CHANGES_VERSION: &[u8] = b"babe_epoch_changes_version";
const BABE_EPOCH_CHANGES_KEY: &[u8] = b"babe_epoch_changes";
const BABE_EPOCH_CHANGES_CURRENT_VERSION: u32 = 2;
fn block_weight_key<H: Encode>(block_hash: H) -> Vec<u8> {
/// The aux storage key used to store the block weight of the given block hash.
pub fn block_weight_key<H: Encode>(block_hash: H) -> Vec<u8> {
(b"block_weight", block_hash).encode()
}