Skip to content

fix(nano): serialization on state api#1492

Merged
glevco merged 1 commit intomasterfrom
fix/get-state-serialization
Nov 21, 2025
Merged

fix(nano): serialization on state api#1492
glevco merged 1 commit intomasterfrom
fix/get-state-serialization

Conversation

@glevco
Copy link
Contributor

@glevco glevco commented Nov 20, 2025

Motivation

The nanocontract state API was not properly serializing return values from view method calls. When calling view methods that returned complex types (like tuples), the serialization was only checking if the value was bytes and converting to hex, but didn't handle other types correctly.

Acceptance Criteria

  • View method return values should be properly serialized using the method's return type specification
  • The parse_nc_method_call function now returns the Method object to enable proper serialization
  • Tests confirm that complex return types (like NamedTuples) are correctly serialized

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 Nov 20, 2025
@glevco glevco moved this from Todo to In Progress (Done) in Hathor Network Nov 20, 2025
@github-actions
Copy link

🐰 Bencher Report

Branchfix/get-state-serialization
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.79 m
(+3.12%)Baseline: 1.73 m
1.56 m
(87.28%)
2.08 m
(85.93%)
🐰 View full continuous benchmarking report in Bencher

@codecov
Copy link

codecov bot commented Nov 20, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.15%. Comparing base (a25e7ab) to head (6862c38).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1492      +/-   ##
==========================================
+ Coverage   86.12%   86.15%   +0.02%     
==========================================
  Files         437      437              
  Lines       33758    33757       -1     
  Branches     5275     5274       -1     
==========================================
+ Hits        29074    29083       +9     
+ Misses       3660     3654       -6     
+ Partials     1024     1020       -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.

@github-project-automation github-project-automation bot moved this from In Progress (Done) to In Review (WIP) in Hathor Network Nov 21, 2025
@glevco glevco moved this from In Review (WIP) to In Review (Done) in Hathor Network Nov 21, 2025
@glevco glevco merged commit b451499 into master Nov 21, 2025
13 of 14 checks passed
@glevco glevco deleted the fix/get-state-serialization branch November 21, 2025 12:58
@github-project-automation github-project-automation bot moved this from In Review (Done) to Waiting to be deployed in Hathor Network Nov 21, 2025
This was referenced Dec 2, 2025
@jansegre jansegre moved this from Waiting to be deployed to Done in Hathor Network Dec 4, 2025
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