Skip to content

Commit

Permalink
Pool ID can be empty
Browse files Browse the repository at this point in the history
When reward comes from MIR transfer from rewards or treasury pot, the
pool ID is empty.
  • Loading branch information
mkoura committed Dec 2, 2021
1 parent b733679 commit e8655c4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cardano_node_tests/tests/test_staking.py
Expand Up @@ -180,7 +180,7 @@ def _dbsync_check_rewards(
db_pool_ids_dict = {
r.spendable_epoch: r.pool_id
for r in reward_db_record.rewards
if pool_first_epoch <= r.spendable_epoch <= epoch_to
if r.pool_id and pool_first_epoch <= r.spendable_epoch <= epoch_to
}
assert pool_ids_dict == db_pool_ids_dict

Expand Down
2 changes: 1 addition & 1 deletion cardano_node_tests/utils/dbsync_queries.py
Expand Up @@ -545,7 +545,7 @@ def query_address_reward(
" reward.spendable_epoch, pool_hash.view AS pool_view "
"FROM reward "
"INNER JOIN stake_address ON reward.addr_id = stake_address.id "
"INNER JOIN pool_hash ON pool_hash.id = reward.pool_id "
"LEFT JOIN pool_hash ON pool_hash.id = reward.pool_id "
"WHERE (stake_address.view = %s) AND (reward.spendable_epoch BETWEEN %s AND %s) "
"ORDER BY reward.id;"
)
Expand Down
2 changes: 1 addition & 1 deletion cardano_node_tests/utils/dbsync_utils.py
Expand Up @@ -149,7 +149,7 @@ def get_address_reward(
earned_epoch=db_row.earned_epoch,
spendable_epoch=db_row.spendable_epoch,
type=db_row.type,
pool_id=db_row.pool_id,
pool_id=db_row.pool_id or "",
)
)
if not rewards:
Expand Down

0 comments on commit e8655c4

Please sign in to comment.