Repository navigation
fix(node): write StakeHistoryEntry activating/deactivating to their own fields - #438
Merged
Merged
Conversation
…wn fields The `activating` and `deactivating` setters assigned to `effective`, so setting either one from JS overwrote `effective` and left the field being set unchanged. Also fix the constructor doc that named the third parameter `effective`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Aursen
approved these changes
Oct 26, 2026
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.
Problem
In
crates/node-litesvm/src/sysvar/stake_history.rs, theactivatinganddeactivatingsetters onStakeHistoryEntryboth assign toself.0.effective. Setting either property from JS overwriteseffectiveand leaves the property you set unchanged:Fix
Assign
self.0.activatingandself.0.deactivatingin their setters. The constructor doc also named the third parametereffective; it now saysdeactivating, in both the Rust source and the generatedinternal.d.ts.I checked the setters in the other sysvar wrappers (
clock,epoch_rewards,epoch_schedule,rent,slot_hashes,slot_history) and incompute_budget.rs. Each one writes its own field.Test
Added
StakeHistoryEntry setters write their own fieldstotests/sysvar.test.ts. It sets each field and checks that the other two stay the same.20n !== 1n, becauseeffectivewas overwritten byentry.activating = 20n.tests/sysvar.test.tspasses 3/3, and the full node suite (tests/*.test.ts) passes 30/30.cargo fmt --check -p litesvm-nodeandrome check/rome formaton the test file report nothing.I also added an Unreleased/Fixed entry to
crates/node-litesvm/CHANGELOG.md.This change was prepared with AI assistance (Claude) and reviewed before submission.
🤖 Generated with Claude Code