updateMainKeyVaultStore method
Future<Either<WalletKeyException, Unit> >
updateMainKeyVaultStore(
- VaultStore mainKeyVaultStore,
- String name
Updates the main key vault store.
mainKeyVaultStore
is the new VaultStore to update to.
name
is the filepath of the VaultStore to update.
Returns nothing if successful. Throws an exception if the VaultStore does not exist.
Implementation
@override
Future<Either<WalletKeyException, Unit>> updateMainKeyVaultStore(
VaultStore mainKeyVaultStore, String name) async {
if (await _storage.containsKey(key: name)) {
(await saveMainKeyVaultStore(mainKeyVaultStore, name))
.withResult((res) => res);
return Either.unit();
} else {
return Either.left(_vaultStoreDoesNotExist(name));
}
}