Skip to content

fix(nano): Method.from_callable could leak StopIteration#1376

Merged
jansegre merged 1 commit intomasterfrom
fix/method-from-callable
Aug 21, 2025
Merged

fix(nano): Method.from_callable could leak StopIteration#1376
jansegre merged 1 commit intomasterfrom
fix/method-from-callable

Conversation

@jansegre
Copy link
Member

@jansegre jansegre commented Aug 21, 2025

Motivation

Method.from_callable could leak a StopIteration exception in some cases where an unsupported callable was given.

Acceptance Criteria

  • Raise a TypeError instead of StopIteration

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

@jansegre jansegre requested review from glevco and msbrogli August 21, 2025 17:21
@jansegre jansegre self-assigned this Aug 21, 2025
@jansegre jansegre moved this from Todo to In Progress (WIP) in Hathor Network Aug 21, 2025
@jansegre jansegre changed the title fix(nano): Method.from_callable could leak StopIteration fix(nano): Method.from_callable could leak StopIteration Aug 21, 2025
@github-actions
Copy link

github-actions bot commented Aug 21, 2025

🐰 Bencher Report

Branchfix/method-from-callable
Testbedubuntu-22.04
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
1.86 m
(+11.58%)Baseline: 1.67 m
1.50 m
(80.66%)
2.00 m
(92.98%)
🐰 View full continuous benchmarking report in Bencher

@jansegre jansegre force-pushed the fix/method-from-callable branch from e123329 to 8a86413 Compare August 21, 2025 17:32
@github-project-automation github-project-automation bot moved this from In Progress (WIP) to In Review (WIP) in Hathor Network Aug 21, 2025
@codecov
Copy link

codecov bot commented Aug 21, 2025

Codecov Report

❌ Patch coverage is 50.00000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.67%. Comparing base (a4ad960) to head (8a86413).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
hathor/nanocontracts/method.py 50.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1376      +/-   ##
==========================================
- Coverage   85.70%   85.67%   -0.04%     
==========================================
  Files         429      429              
  Lines       32444    32450       +6     
  Branches     5068     5068              
==========================================
- Hits        27807    27800       -7     
- Misses       3612     3621       +9     
- Partials     1025     1029       +4     

☔ 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.

@jansegre jansegre moved this from In Review (WIP) to In Review (Done) in Hathor Network Aug 21, 2025
@jansegre jansegre merged commit c10ec87 into master Aug 21, 2025
7 of 8 checks passed
@jansegre jansegre deleted the fix/method-from-callable branch August 21, 2025 18:34
@github-project-automation github-project-automation bot moved this from In Review (Done) to Waiting to be deployed in Hathor Network Aug 21, 2025
@jansegre jansegre mentioned this pull request Sep 11, 2025
2 tasks
@jansegre jansegre moved this from Waiting to be deployed to Done in Hathor Network Sep 18, 2025
@jansegre jansegre mentioned this pull request Sep 24, 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.

3 participants