From 0987b78f3e6ab2bff37f3230951565e3d556d78d Mon Sep 17 00:00:00 2001 From: David Salami Date: Wed, 8 Jan 2025 10:38:41 +0000 Subject: [PATCH] cosmetic fixes --- .../pallets/mmr/gadget/src/offchain_mmr.rs | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/modules/pallets/mmr/gadget/src/offchain_mmr.rs b/modules/pallets/mmr/gadget/src/offchain_mmr.rs index 932dce3a..8841b4e2 100644 --- a/modules/pallets/mmr/gadget/src/offchain_mmr.rs +++ b/modules/pallets/mmr/gadget/src/offchain_mmr.rs @@ -242,18 +242,13 @@ where self.offchain_db.local_storage_set(StorageKind::PERSISTENT, &canon_key, &elem); self.offchain_db.local_storage_clear(StorageKind::PERSISTENT, &temp_key); // if it's a leaf node, also clear the duplicate that was added to no_op storage - if let Ok(data) = pallet_mmr::mmr::Node::::decode(&mut &*elem) { - match data { - DataOrHash::Data(leaf) => { - let pre_image = leaf.preimage(); - let commitment = keccak_256(&pre_image); - let duplicate_key = - pallet_ismp::offchain::leaf_default_key(commitment.into()); - self.offchain_db - .local_storage_clear(StorageKind::PERSISTENT, &duplicate_key); - }, - _ => {}, - } + if let Ok(DataOrHash::Data(leaf)) = + pallet_mmr::mmr::Node::::decode(&mut &*elem) + { + let pre_image = leaf.preimage(); + let commitment = keccak_256(&pre_image); + let duplicate_key = pallet_ismp::offchain::leaf_default_key(commitment.into()); + self.offchain_db.local_storage_clear(StorageKind::PERSISTENT, &duplicate_key); } debug!( target: LOG_TARGET,