From 7bf436c9a9182e91c3c7dbbc329ad562c3b1697c Mon Sep 17 00:00:00 2001 From: Thibault Martinez Date: Thu, 9 Nov 2023 12:32:21 +0100 Subject: [PATCH] Comment and rename --- sdk/src/types/block/unlock/mod.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sdk/src/types/block/unlock/mod.rs b/sdk/src/types/block/unlock/mod.rs index 5ad91ca480..fce07f8150 100644 --- a/sdk/src/types/block/unlock/mod.rs +++ b/sdk/src/types/block/unlock/mod.rs @@ -133,7 +133,9 @@ impl Unlocks { } } -fn verify_unlock<'a>( +/// Verifies the consistency of non-multi unlocks. +/// Will error on multi unlocks as they can't be nested. +fn verify_non_multi_unlock<'a>( unlocks: &'a [Unlock], unlock: &'a Unlock, index: u16, @@ -183,10 +185,10 @@ fn verify_unlocks(unlocks: &[Unlock], _: &()) -> Result<(), match unlock { Unlock::Multi(multi) => { for unlock in multi.unlocks() { - verify_unlock(unlocks, unlock, index, &mut seen_signatures)? + verify_non_multi_unlock(unlocks, unlock, index, &mut seen_signatures)? } } - _ => verify_unlock(unlocks, unlock, index, &mut seen_signatures)?, + _ => verify_non_multi_unlock(unlocks, unlock, index, &mut seen_signatures)?, } } }