Skip to content

fix(nano): fix calls to get_balance on other contracts#1452

Merged
msbrogli merged 1 commit intomasterfrom
fix/nano/another-balance
Oct 9, 2025
Merged

fix(nano): fix calls to get_balance on other contracts#1452
msbrogli merged 1 commit intomasterfrom
fix/nano/another-balance

Conversation

@glevco
Copy link
Contributor

@glevco glevco commented Oct 8, 2025

Depends on #1406

Motivation

There's a bug when trying to get the balance of another contract when that contact is not part of the call chain. Since its changes tracker is not created, the Runner._get_balance will raise a KeyError. This PR fixes this and adds the missing tests.

Acceptance Criteria

  • Fix Runner._get_balance so it can get the balance of other contracts. Getting the balance of another contract before the current call is not supported.
  • Refactor Runner.get_current_changes_tracker so it doesn't take any arguments. It was always called with the current contract id.
  • Add missing tests.

Checklist

  • If you are requesting a merge into master, confirm this code is production-ready and can be included in future releases as soon as it gets merged

@glevco glevco self-assigned this Oct 8, 2025
@glevco glevco moved this from Todo to In Progress (Done) in Hathor Network Oct 8, 2025
@jansegre jansegre mentioned this pull request Oct 8, 2025
2 tasks
jansegre
jansegre previously approved these changes Oct 8, 2025
@github-actions
Copy link

github-actions bot commented Oct 8, 2025

🐰 Bencher Report

Branchfix/nano/another-balance
Testbedubuntu-22.04

🚨 1 Alert

BenchmarkMeasure
Units
ViewBenchmark Result
(Result Δ%)
Upper Boundary
(Limit %)
sync-v2 (up to 20000 blocks)Latency
minutes (m)
📈 plot
🚷 threshold
🚨 alert (🔔)
2.11 m
(+22.30%)Baseline: 1.72 m
2.07 m
(101.92%)

Click to view all benchmark results
BenchmarkLatencyBenchmark Result
minutes (m)
(Result Δ%)
Lower Boundary
minutes (m)
(Limit %)
Upper Boundary
minutes (m)
(Limit %)
sync-v2 (up to 20000 blocks)📈 view plot
🚷 view threshold
🚨 view alert (🔔)
2.11 m
(+22.30%)Baseline: 1.72 m
1.55 m
(73.59%)
2.07 m
(101.92%)

🐰 View full continuous benchmarking report in Bencher

@glevco glevco moved this from In Progress (Done) to In Review (WIP) in Hathor Network Oct 8, 2025
@codecov
Copy link

codecov bot commented Oct 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.91%. Comparing base (2387a69) to head (990c958).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1452      +/-   ##
==========================================
- Coverage   86.03%   85.91%   -0.13%     
==========================================
  Files         434      434              
  Lines       33739    33740       +1     
  Branches     5291     5291              
==========================================
- Hits        29029    28987      -42     
- Misses       3673     3700      +27     
- Partials     1037     1053      +16     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

raul-oliveira
raul-oliveira previously approved these changes Oct 8, 2025
@glevco glevco dismissed stale reviews from raul-oliveira and jansegre via fa44853 October 8, 2025 22:04
@glevco glevco force-pushed the fix/nano/another-balance branch from a8f2e85 to fa44853 Compare October 8, 2025 22:04
@glevco glevco changed the base branch from master to raul-oliveira/charge-nc-actions-fee October 8, 2025 22:04
@raul-oliveira raul-oliveira force-pushed the raul-oliveira/charge-nc-actions-fee branch from 79f329e to b207594 Compare October 8, 2025 22:20
@glevco glevco force-pushed the fix/nano/another-balance branch 3 times, most recently from edaa0ee to 49bba69 Compare October 9, 2025 15:29
Base automatically changed from raul-oliveira/charge-nc-actions-fee to master October 9, 2025 17:35
@glevco glevco force-pushed the fix/nano/another-balance branch from 49bba69 to 990c958 Compare October 9, 2025 17:41
@glevco glevco moved this from In Review (WIP) to In Review (Done) in Hathor Network Oct 9, 2025
@glevco glevco force-pushed the fix/nano/another-balance branch from 990c958 to ccde97f Compare October 9, 2025 18:47
@msbrogli msbrogli merged commit ccde97f into master Oct 9, 2025
5 of 7 checks passed
@msbrogli msbrogli deleted the fix/nano/another-balance branch October 9, 2025 18:49
@github-project-automation github-project-automation bot moved this from In Review (Done) to Waiting to be deployed in Hathor Network Oct 9, 2025
@jansegre jansegre moved this from Waiting to be deployed to Done in Hathor Network Oct 15, 2025
@jansegre jansegre mentioned this pull request Oct 16, 2025
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants