From 76baed2eba5e501c6db03c4090ce2b04e66df006 Mon Sep 17 00:00:00 2001 From: Dmitry Demin Date: Wed, 20 Sep 2023 16:41:37 +0200 Subject: [PATCH] Remove issuance/batch.rs I created before --- src/issuance/batch.rs | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 src/issuance/batch.rs diff --git a/src/issuance/batch.rs b/src/issuance/batch.rs deleted file mode 100644 index 41794f694..000000000 --- a/src/issuance/batch.rs +++ /dev/null @@ -1,36 +0,0 @@ -use std::collections::HashSet; - -use super::{verify_issue_bundle, AssetBase, IssueBundle, Signed}; - -/// Batch validation context for Issuance. -/// -#[derive(Debug, Default)] -pub struct BatchValidator { - bundles: Vec<(IssueBundle, [u8; 32])>, -} - -impl BatchValidator { - /// Constructs a new batch validation context. - pub fn new() -> Self { - BatchValidator { bundles: vec![] } - } - - /// Adds bundle to the validator. - pub fn add_bundle(&mut self, bundle: &IssueBundle, sighash: [u8; 32]) { - self.bundles.push((bundle.clone(), sighash)) - } - - /// Batch-validates the accumulated bundles. - /// - /// Returns `true` if every bundle added to the batch validator is valid, or `false` - /// if one or more are invalid. - pub fn validate(self) -> bool { - // FIXME: take/save finalization set from/to the global state - let finalized = HashSet::::new(); - - // FIXME: process resulting supply_info - self.bundles - .into_iter() - .all(|(bundle, sighash)| verify_issue_bundle(&bundle, sighash, &finalized).is_ok()) - } -}