diff --git a/CHANGELOG.md b/CHANGELOG.md index 42b6b46b1..47c9ae46b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,7 @@ Release built: _not released yet_ - `/state/entity/page/non-fungibles/` (when using `explicit_metadata` opt-in) - `/state/entity/page/fungibles/` (when using `explicit_metadata` opt-in) - Added missing `total_count` property to `/state/validators/list` response. +- Fix `/transaction/account-deposit-pre-validation` for virtual, non persisted accounts. It no longer returns error with code 404 `Entity not found`. ### API Changes - Restored previously removed `total_count` property to `/state/key-value-store/keys` endpoint. diff --git a/src/RadixDlt.NetworkGateway.PostgresIntegration/Services/AccountDepositSettings/DepositPreValidationQuerier.cs b/src/RadixDlt.NetworkGateway.PostgresIntegration/Services/AccountDepositSettings/DepositPreValidationQuerier.cs index 92edb72b2..c29e9c8b4 100644 --- a/src/RadixDlt.NetworkGateway.PostgresIntegration/Services/AccountDepositSettings/DepositPreValidationQuerier.cs +++ b/src/RadixDlt.NetworkGateway.PostgresIntegration/Services/AccountDepositSettings/DepositPreValidationQuerier.cs @@ -110,8 +110,25 @@ public DepositPreValidationQuerier( CancellationToken token = default ) { - var accountEntity = await _entityQuerier.GetNonVirtualEntity(_dbContext, accountAddress, ledgerState, token); var xrdResourceAddress = (await _networkConfigurationProvider.GetNetworkConfiguration(token)).WellKnownAddresses.Xrd; + var accountEntity = await _entityQuerier.GetEntity(accountAddress, ledgerState, token); + if (accountEntity is VirtualAccountComponentEntity) + { + var resourceItems = resourceAddresses + .Select( + resourceAddress => new GatewayModel.AccountDepositPreValidationDecidingFactorsResourceSpecificDetailsItem( + resourceAddress, + false, + resourceAddress == xrdResourceAddress)) + .ToList(); + + return new GatewayModel.AccountDepositPreValidationDecidingFactors( + badgeResourceAddress.HasValue ? false : null, + AccountDefaultDepositRule.Accept.ToGatewayModel(), + resourceItems + ); + } + var addressesToResolve = resourceAddresses.ToList(); if (badgeResourceAddress.HasValue) {