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 { pub fn commit(&self) -> StateCommitment {
let io_root = cl::merkle::node(self.events_root(), self.included_txs_root()); let io_root = cl::merkle::node(self.events_root(), self.included_txs_root());
let balances_root = self.balances_root(); let root = cl::merkle::root([
let zone_id = self.zone_metadata.id(); self.events_root(),
let state_root = cl::merkle::node(zone_id, balances_root); self.included_txs_root(),
zone_id,
let root = cl::merkle::node(io_root, state_root); balances_root,
]);
StateCommitment(root) StateCommitment(root)
} }