From cb3eb279e659d49e389af302870c55687131c1e6 Mon Sep 17 00:00:00 2001 From: Alexandros Filios Date: Tue, 28 Jan 2025 14:20:03 +0100 Subject: [PATCH] Simplify vault Signed-off-by: Alexandros Filios --- platform/common/core/generic/vault/vault.go | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/platform/common/core/generic/vault/vault.go b/platform/common/core/generic/vault/vault.go index acbafa782..b54bee2ff 100644 --- a/platform/common/core/generic/vault/vault.go +++ b/platform/common/core/generic/vault/vault.go @@ -201,24 +201,8 @@ func (db *Vault[V]) unmapInterceptors(txIDs ...driver.TxID) (map[driver.TxID]TxI result, notFound := collections.SubMap(db.Interceptors, txIDs...) - vcs, err := db.txIDStore.Iterator(&driver.SeekSet{TxIDs: notFound}) - if err != nil { - return nil, errors.Wrapf(err, "read-write set for txids [%v] could not be found", txIDs) - } - - foundInStore := collections.NewSet[driver.TxID]() - for vc, err := vcs.Next(); vc != nil; vc, err = vcs.Next() { - if err != nil { - return nil, errors.Wrapf(err, "read-write set for txid %s could not be found", vc.TxID) - } - if vc.Code == db.vcProvider.Unknown() { - return nil, errors.Errorf("read-write set for txid %s could not be found", vc.TxID) - } - foundInStore.Add(vc.TxID) - } - - if unknownTxIDs := collections.NewSet(notFound...).Minus(foundInStore); !unknownTxIDs.Empty() { - return nil, errors.Errorf("read-write set for txid %s could not be found", unknownTxIDs.ToSlice()[0]) + if len(notFound) > 0 { + return nil, errors.Errorf("read-write set for txids [%v] could not be found", notFound) } for txID, i := range result {