You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running tests with transaction executors flow.
Reusable services can be checking
for Contract id ->
final var contract = accountStore.getContractById(body.contractIDOrThrow());
if (contract != null) {
// Throws exception if accountId is of returned with type alias
final var contractNum = contract.accountIdOrThrow().accountNumOrThrow();
final var mayNotExist = featureFlags.isAllowCallsToNonContractAccountsEnabled(contractsConfig, contractNum);
validateTrue(mayNotExist || !contract.deleted(), CONTRACT_DELETED);
}
Throws exception when contractId has its accountId with type AccountOneOfType.Alias
2. Checks for account id
protected Account getAliasedAccountLeaf(@NonNull final AccountID id) {
// The Account ID may be aliased, in which case we need to convert it to a number-based account ID first.
requireNonNull(id);
final var accountId = lookupAliasedAccountId(id);
return accountId == null ? null : accountState.get(accountId);
}
Tries to find the aliased account first and then returns it in a form of AccountOneOfType.AccountNum (expects the accountState to return it in account num -> this is our AccountReadableKVState)
Currently our AccountReadableKVState uses toAccountId method that returns it with type ALIAS
if the entity has evm address or alias.
While we observed from the above cases that we want to return the account with AccountOneOfType.AccountNum always instead of alias.
Otherwise we will be getting around 200 integration tests failing with exception thrown while handling dispatch java.lang.IllegalArgumentException: No account has id AccountID[Alias]
Solution
In AccountReadableKVState when returning the account model.
We should set it AccountId to an AccountNum type.
Alternatives
No response
The text was updated successfully, but these errors were encountered:
Problem
When running tests with transaction executors flow.
Reusable services can be checking
Throws exception when contractId has its accountId with type AccountOneOfType.Alias
2. Checks for account id
Tries to find the aliased account first and then returns it in a form of AccountOneOfType.AccountNum (expects the accountState to return it in account num -> this is our AccountReadableKVState)
Currently our AccountReadableKVState uses toAccountId method that returns it with type ALIAS
if the entity has evm address or alias.
While we observed from the above cases that we want to return the account with AccountOneOfType.AccountNum always instead of alias.
Otherwise we will be getting around 200 integration tests failing with exception thrown while handling dispatch
java.lang.IllegalArgumentException: No account has id AccountID[Alias]
Solution
In AccountReadableKVState when returning the account model.
We should set it AccountId to an AccountNum type.
Alternatives
No response
The text was updated successfully, but these errors were encountered: