From ca42d3ed4f1e8b2c3b5b5c42069c2f2d79dc75a8 Mon Sep 17 00:00:00 2001 From: Giacomo Pasini Date: Fri, 2 Aug 2024 17:43:53 +0200 Subject: [PATCH] simply merkle root calc --- goas/atomic_asset_transfer/common/src/lib.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/goas/atomic_asset_transfer/common/src/lib.rs b/goas/atomic_asset_transfer/common/src/lib.rs index 852bdcf..2c9e323 100644 --- a/goas/atomic_asset_transfer/common/src/lib.rs +++ b/goas/atomic_asset_transfer/common/src/lib.rs @@ -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) }