Repository navigation
refactor(merkle-tree-token-claimer): Rust snapshot generator, drop the JS tooling - #772
Merged
Merged
Conversation
…e JS tooling The snapshot-to-proofs generator becomes a cargo example (`cargo run --example generate_merkle_tree`) with serde/serde_json as dev-dependencies, producing the same JSON output as the TypeScript version. The anchor example no longer carries a package.json, lockfile, pnpm overrides or tsconfig, matching the Rust-only anchor test stack.
Contributor
[Medium impact] The PR appears safe to merge; the previous address-parsing issue is fixed. SummaryMoves the snapshot generator from TypeScript to a Rust Cargo example.
No new actionable issues were found in the changes since the previous review. Reviews (2) · Last reviewed commit: "fix(merkle-tree-token-claimer): skip sna..." · Reviewed by Greptile |
…non-string address instead of aborting
amilz
approved these changes
Oct 28, 2026
1 of 2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The merkle-tree-token-claimer was the last anchor example with a
package.json, kept only for its snapshot-to-proofs generator. AGENTS.md says anchor examples are Rust-only, so the generator moves to Rust.Changes
programs/merkle-tree-token-claimer/examples/generate_merkle_tree.rs: reads a snapshot JSON, skips invalid entries with a warning (bad address, non-u64 amount), builds the zero-hash-padded SHA-256 tree and writes the root plus a proof per claimant.serdeandserde_jsonare added as dev-dependencies.scripts/sample-snapshot.jsonmoves next to the example.scripts/generate-merkle-tree.ts,scripts/merkle.ts,package.json(with the leftover mocha/chai/litesvm deps),pnpm-lock.yaml,pnpm-workspace.yaml(overrides) andtsconfig.json.Testing
cargo run --example generate_merkle_tree -- examples/sample-snapshot.json out.jsonproduces JSON identical to the old TypeScript generator's on the sample snapshot.cargo fmt --checkclean;cargo clippy --example generate_merkle_treereports nothing for the example (the lib's two existingmanual_is_multiple_ofwarnings are untouched).AI disclosure