updateAccount method
Updates an account.
correlation_id
(optional) transaction id to trace execution through call chain.account
an account to be updated. Return (optional) Future that receives updated account Throws error.
Implementation
@override
Future<AccountV1?> updateAccount(
String? correlationId, AccountV1? account) async {
var index = _accounts.indexWhere((el) => el.id == account?.id).toInt();
if (index < 0 || account == null) {
return null;
}
var newAccount = AccountV1();
newAccount.fromJson(account.toJson());
_accounts[index] = newAccount;
return newAccount;
}