Skip to content

feat(nano): use more custom classes with faux protection#1388

Merged
jansegre merged 1 commit intomasterfrom
feat/nano/better-types
Aug 29, 2025
Merged

feat(nano): use more custom classes with faux protection#1388
jansegre merged 1 commit intomasterfrom
feat/nano/better-types

Conversation

@jansegre
Copy link
Member

Motivation

Some classes in hathor.nanocontracts.types are simple NewTypes, which isn't ideal.

Acceptance Criteria

  • Change all NewType classes to custom types with faux-immutable protection
  • Rename _FauxImmutableMeta to FauxImmutableMeta for external use
  • Add __allow_faux_inheritance__ to bypass inheritance restriction

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 self-assigned this Aug 29, 2025
@jansegre jansegre requested a review from msbrogli as a code owner August 29, 2025 13:25
@github-actions
Copy link

github-actions bot commented Aug 29, 2025

🐰 Bencher Report

Branchfeat/nano/better-types
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.84 m
(+10.09%)Baseline: 1.68 m
1.51 m
(81.75%)
2.01 m
(91.74%)
🐰 View full continuous benchmarking report in Bencher

@jansegre jansegre force-pushed the feat/nano/better-types branch from eabc53d to 65da3be Compare August 29, 2025 13:37
@jansegre jansegre moved this from Todo to In Progress (Done) in Hathor Network Aug 29, 2025
@codecov
Copy link

codecov bot commented Aug 29, 2025

Codecov Report

❌ Patch coverage is 94.11765% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.79%. Comparing base (f25fc0e) to head (65da3be).
⚠️ Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
hathor/nanocontracts/faux_immutable.py 90.00% 0 Missing and 1 partial ⚠️
hathor/nanocontracts/nc_types/bytes_nc_type.py 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1388      +/-   ##
==========================================
+ Coverage   85.77%   85.79%   +0.01%     
==========================================
  Files         429      429              
  Lines       32433    32453      +20     
  Branches     5056     5057       +1     
==========================================
+ Hits        27821    27843      +22     
+ Misses       3596     3592       -4     
- Partials     1016     1018       +2     

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

@github-project-automation github-project-automation bot moved this from In Progress (Done) to In Review (WIP) in Hathor Network Aug 29, 2025
@glevco glevco moved this from In Review (WIP) to In Review (Done) in Hathor Network Aug 29, 2025
@jansegre jansegre merged commit 482fec5 into master Aug 29, 2025
8 checks passed
@jansegre jansegre deleted the feat/nano/better-types branch August 29, 2025 19:01
@github-project-automation github-project-automation bot moved this from In Review (Done) to Waiting to be deployed in Hathor Network Aug 29, 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