Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

override sysvars from accounts list #61

Closed
wants to merge 3 commits into from

Conversation

2501babe
Copy link
Member

@2501babe 2501babe commented Dec 6, 2024

this is a convenience to make porting stake_instruction.rs tests (and other similar InvokeContext-based tests) much simpler. sysvars from the accounts list are used to override the sysvars on Mollusk, without mutating it. this is to accord with the way existing tests are structured, so we dont need to add any setup logic that doesnt already exist. in general they create sysvar states and pass them into InvokeContext via process_instruction directly

i considered letting it mutate Sysvars but this seems cleaner, especially since we will be able to remove it someday when the bpf programs use sysvar syscalls and dont need to accept sysvar accounts at all

Copy link
Collaborator

@buffalojoec buffalojoec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this manages to accomplish what you're after here: #64

Let me know if there's more we need!

@2501babe 2501babe closed this Dec 10, 2024
@2501babe 2501babe deleted the sysvar-override branch December 11, 2024 04:59
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