updateKeyshare method

  1. @override
Future<void> updateKeyshare(
  1. String id,
  2. StorageKeyshare newKeyshare
)
override

Updates a StorageKeyshare in the storage client for a given id.

Implementation

@override

/// Updates a [StorageKeyshare] in the storage client for a given [id].
Future<void> updateKeyshare(String id, StorageKeyshare newKeyshare) async {
  final index = storageKeyshares.indexWhere((e) => e.id == id);
  final newKeyshareToInsert = StorageKeyshare(
    keyId: newKeyshare.keyId,
    id: newKeyshare.id,
    domain: newKeyshare.domain,
    type: newKeyshare.type,
    keyshareData: newKeyshare.keyshareData,
    sessionId: newKeyshare.sessionId,
  );
  storageKeyshares[index] = newKeyshareToInsert;
}