This repository was archived by the owner on Jan 22, 2025. It is now read-only.
Program Test: Overwrite builtin when program ID matches#35242
Closed
buffalojoec wants to merge 1 commit into
Closed
Program Test: Overwrite builtin when program ID matches#35242buffalojoec wants to merge 1 commit into
buffalojoec wants to merge 1 commit into
Conversation
88f4208 to
462e053
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #35242 +/- ##
========================================
Coverage 81.7% 81.7%
========================================
Files 834 834
Lines 224299 224817 +518
========================================
+ Hits 183361 183843 +482
- Misses 40938 40974 +36 |
462e053 to
17a0400
Compare
Contributor
|
is there something is pr does than cant be accomplished by |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 order to test the Core BPF version of a builtin program, we need to be able to overwrite the existing builtin with the Core BPF version using
solana-program-test.Since
ProgramTest::new()will callSelf::default(), which automatically determinesprefer_bpfbased on theSBF_OUT_DIR, this will result inprefer_bpf = truefor the provided program. This will cause the provided Core BPF program to be overwritten by the existing builtin when the bank is set up.Summary of Changes
Add a check to
ProgramTest::new()that will setprefer_bpftofalseif the provided program ID matches that of a builtin. Withprefer_bpfset tofalse, the Core BPF version of the program will replace the existing builtin duringProgramTest::start().Note: @Lichtso I've rebased this commit on top of your recent PR #35233 since it requires the changes you've made to
LoadedPrograms::assign_program().