getAccounts method
MessageAccountKeys
getAccounts({
- List<
AddressLookupTableAccount> addressLookupTableAccounts = const [], - AccountLookupKeys? lookupKeys,
override
Gets the accounts associated with the message.
Implementation
@override
MessageAccountKeys getAccounts({
List<AddressLookupTableAccount> addressLookupTableAccounts = const [],
AccountLookupKeys? lookupKeys,
}) {
if (lookupKeys != null) {
if (numAccountKeysFromLookups !=
lookupKeys.writable.length + lookupKeys.readonly.length) {
throw const MessageException(
'Failed to get account keys because of a mismatch in the number of account keys from lookups');
}
} else if (addressLookupTableAccounts.isNotEmpty) {
lookupKeys = _resolveAddressTableLookups(addressLookupTableAccounts);
} else if (addressTableLookups.isNotEmpty) {
throw const MessageException(
'Failed to get account keys because address table lookups were not resolved');
}
return MessageAccountKeys(accountKeys, lookupKeys);
}