Kagome
Polkadot Runtime Engine in C++17
block_header.cpp
Go to the documentation of this file.
2 
3 namespace kagome::primitives {
4 
5  outcome::result<BlockHash> calculateBlockHash(
6  BlockHeader const &header, crypto::Hasher const &hasher) {
7  OUTCOME_TRY(enc_header, scale::encode(header));
8  return hasher.blake2b_256(enc_header);
9  }
10 
11 }
outcome::result< BlockHash > calculateBlockHash(BlockHeader const &header, crypto::Hasher const &hasher)
Definition: block_header.cpp:5
virtual Hash256 blake2b_256(gsl::span< const uint8_t > buffer) const =0
blake2b_256 function calculates 32-byte blake2b hash