simply merkle root calc

This commit is contained in:
Giacomo Pasini 2024-08-02 17:43:53 +02:00
parent 584f814465
commit ca42d3ed4f
No known key found for this signature in database
GPG Key ID: FC08489D2D895D4B
1 changed files with 6 additions and 5 deletions

View File

@ -59,11 +59,12 @@ impl StateWitness {
pub fn commit(&self) -> StateCommitment {
let io_root = cl::merkle::node(self.events_root(), self.included_txs_root());
let balances_root = self.balances_root();
let zone_id = self.zone_metadata.id();
let state_root = cl::merkle::node(zone_id, balances_root);
let root = cl::merkle::node(io_root, state_root);
let root = cl::merkle::root([
self.events_root(),
self.included_txs_root(),
zone_id,
balances_root,
]);
StateCommitment(root)
}