fuel_core_chain_config/
genesis.rsuse fuel_core_storage::MerkleRoot;
use fuel_core_types::{
blockchain::consensus::Genesis,
fuel_crypto::Hasher,
};
pub trait GenesisCommitment {
fn root(&self) -> anyhow::Result<MerkleRoot>;
}
impl GenesisCommitment for Genesis {
fn root(&self) -> anyhow::Result<MerkleRoot> {
let genesis_hash = *Hasher::default()
.chain(self.chain_config_hash)
.chain(self.coins_root)
.chain(self.contracts_root)
.chain(self.messages_root)
.chain(self.transactions_root)
.finalize();
Ok(genesis_hash)
}
}