Skip to content

refactor(snapshot-legacy-importer): clean up the importer and add unit tests - #1525

Merged
sebastijankuzner merged 10 commits into
developfrom
refactor/snapshot-legacy-importer/cleanup
Oct 9, 2026
Merged

sebastijankuzner merged 10 commits into
developfrom
refactor/snapshot-legacy-importer/cleanup

Conversation

@oXtxNt9U

@oXtxNt9U oXtxNt9U commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Changes

  • Snapshots are read only as brotli (<hash>.compressed). The unused .json path is removed, read failures name the file, and the console output is gone.
  • Removed the total supply check in import(). It compared the prepared wallet list against itself, so it could never fail.
  • Removed unused API: LegacyImporter.totalSupply and .result, arkAddress/publicKey on imported voters and validators, and the empty defaults.ts.
  • import() now rejects an import before prepare() or a second import, and dispose() resets all state.
  • A failed contract call during import names the validator, username or vote batch, and includes the decoded revert reason.
  • run() errors now name what didn't match: snapshot hash vs. milestone, chain tip vs. genesis parent hash, or a missing snapshot milestone.
  • bootstrap: fixed the reversed error message for a snapshot milestone with a zero genesis parent hash.

Checklist

  • Documentation (if necessary)
  • Tests (if necessary)
  • Ready to be merged

@oXtxNt9U
oXtxNt9U added this pull request to stack #1526 October 9, 2026 04:18
@codecov

codecov Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.80%. Comparing base (668d31b) to head (42ed2ac).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1525      +/-   ##
===========================================
+ Coverage    80.39%   80.80%   +0.40%     
===========================================
  Files          952      962      +10     
  Lines        17178    17663     +485     
  Branches      2611     2739     +128     
===========================================
+ Hits         13810    14272     +462     
- Misses        3363     3383      +20     
- Partials         5        8       +3     
Flag Coverage Δ
contracts 91.95% <ø> (?)
packages 80.52% <100.00%> (+0.12%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sebastijankuzner
sebastijankuzner force-pushed the refactor/snapshot-legacy-importer/cleanup branch from 2577cd5 to 3ab1007 Compare October 9, 2026 13:14
Base automatically changed from fix/snapshot-legacy-importer/resigned-validators to develop October 9, 2026 13:22
@sebastijankuzner
sebastijankuzner force-pushed the refactor/snapshot-legacy-importer/cleanup branch from 3ab1007 to 42ed2ac Compare October 9, 2026 13:22
@sebastijankuzner
sebastijankuzner merged commit de7c092 into develop Oct 9, 2026
26 checks passed
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