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
The query for account info in /accounts/{id} has a condition (es.id = $1 OR es.id IS NULL) in the where clause of the main query. It's unnecessary since the query has entity as e left join entity_stake as es on es.id = e.id and there is already e.id = $1.
2023-11-21T11:22:36.945-06:00 TRACE e23e9d02 getOneAccount entity query: with latest_token_balance as (select account_id, balance, token_id
from token_account
where associated is true)
select e.alias,
e.auto_renew_period,
e.balance_timestamp,
e.created_timestamp,
e.decline_reward,
e.deleted,
e.ethereum_nonce,
e.evm_address,
e.expiration_timestamp,
e.id,
e.key,
e.max_automatic_token_associations,
e.memo,
e.receiver_sig_required,
e.staked_account_id,
e.staked_node_id,
e.stake_period_start,
e.type,
e.timestamp_range,
(case when es.pending_reward is null then 0
when e.decline_reward is true or coalesce(e.staked_node_id, -1) = -1 then 0
when e.stake_period_start >= es.end_stake_period then 0
else es.pending_reward
end) as pending_reward,
(select json_agg(jsonb_build_object('token_id', token_id, 'balance', balance)) ::jsonb
from (select token_id, balance
from latest_token_balance
where account_id = $1
order by token_id asc
limit 1000) as account_token_balance) as token_balances,
e.balance as balance
from entity e
left join entity_stake es on es.id = e.id
where e.type in ('ACCOUNT', 'CONTRACT') and e.id = $1 and (es.id = $1 OR es.id IS NULL)
order by e.id asc [556677]
Steps to reproduce
Remove entityStakeQuery completely from accounts.js and make sure all tests pass
Additional context
No response
Hedera network
other
Version
v0.93.0-SNAPSHOT
Operating system
None
The text was updated successfully, but these errors were encountered:
Description
The query for account info in
/accounts/{id}
has a condition(es.id = $1 OR es.id IS NULL)
in the where clause of the main query. It's unnecessary since the query hasentity as e left join entity_stake as es on es.id = e.id
and there is alreadye.id = $1
.Steps to reproduce
Remove
entityStakeQuery
completely from accounts.js and make sure all tests passAdditional context
No response
Hedera network
other
Version
v0.93.0-SNAPSHOT
Operating system
None
The text was updated successfully, but these errors were encountered: