Skip to content

Display mining rewards#451

Merged
n13 merged 12 commits into
mainfrom
display-mining-rewards
Apr 15, 2026
Merged

Display mining rewards#451
n13 merged 12 commits into
mainfrom
display-mining-rewards

Conversation

@n13

@n13 n13 commented Apr 15, 2026

Copy link
Copy Markdown
Collaborator
Simulator Screenshot - iPhone 16 - 2026-04-15 at 12 53 31 Simulator Screenshot - iPhone 16 - 2026-04-15 at 12 53 38 Simulator Screenshot - iPhone 16 - 2026-04-15 at 12 53 43

'query':
'''
query {
minerStats(where: {id_in: [${queryIds.map((id) => '"$id"').join(', ')}]}) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this working? usually the safe way to insert query is through variables payload.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it works

Comment thread mobile-app/lib/services/mining_rewards_service.dart Outdated
Comment thread mobile-app/lib/services/mining_rewards_service.dart Outdated
Comment thread mobile-app/lib/services/mining_rewards_service.dart Outdated

@dewabisma dewabisma left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looking good, some error handling issues and confirmation about the query

n13 added 2 commits April 15, 2026 13:17
fix loading spinner when retrying
@n13

n13 commented Apr 15, 2026

Copy link
Copy Markdown
Collaborator Author

Yeah.. AI doesn't handle errors lol

Added error handling to everything ;)


final mappings = await _fetchAccountMappings();
print('[MiningRewards] Account mappings total: ${mappings.length} rows');
for (final m in mappings) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems this looping doesn't have any meaning, please remove this

if (oldId != null && allIds.add(oldId)) {
print('[MiningRewards] Chain depth $depth: $id -> $oldId');
next.add(oldId);
} else if (oldId == null) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need to add if else here if we do nothing?

total += miner.blocks;
}
}
if (total == 0) print('[MiningRewards] No matches in $network for any of ${accountIds.length} account IDs');

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems to be not usefull

@dewabisma dewabisma left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still need to do some small changes

@dewabisma dewabisma left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@n13 n13 merged commit f3b1abd into main Apr 15, 2026
1 check passed
@dewabisma dewabisma deleted the display-mining-rewards branch May 3, 2026 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants