Skip to content

Commit

Permalink
Simplify vault
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandros Filios <[email protected]>
  • Loading branch information
alexandrosfilios committed Jan 28, 2025
1 parent da9f9b1 commit cb3eb27
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions platform/common/core/generic/vault/vault.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit cb3eb27

Please sign in to comment.