storeExchangeHistoryEntry method
Put a new Entry to Exchange history of a credential identified by credentialDid
.
Implementation
Future<void> storeExchangeHistoryEntry(String credentialDid,
DateTime timestamp, String action, String otherParty,
[List<String>? shownAttributes]) async {
List<ExchangeHistoryEntry>? existingHistoryEntries =
getExchangeHistoryEntriesForCredential(credentialDid);
var tmp = ExchangeHistoryEntry(
timestamp, action, otherParty, shownAttributes ?? []);
if (existingHistoryEntries == null) {
await _exchangeHistory!.put(credentialDid, [tmp]);
} else {
await _exchangeHistory!
.put(credentialDid, [tmp] + existingHistoryEntries);
}
}