saveProofs method
Implementation
@override
Future<void> saveProofs({
required List<CashuProof> proofs,
required String mintUrl,
}) async {
await _database.transaction((txn) async {
// Remove existing proofs by secret (upsert logic)
final secretsToCheck = proofs.map((p) => p.secret).toList();
final finder = sembast.Finder(
filter: sembast.Filter.inList('secret', secretsToCheck),
);
await _proofStore.delete(txn, finder: finder);
// Insert new proofs
for (final proof in proofs) {
await _proofStore
.record(proof.secret)
.put(txn, proof.toJsonForStorage());
}
});
}