-
Notifications
You must be signed in to change notification settings - Fork 124
Open
Description
I have a check on my initialization that prevents front running but it relies on the program being upgrade-able.
// If we only used this, someone could pass in a program data
// address that they control.
#[account(
constraint = program_data.upgrade_authority_address == Some(signer.key())
@ ErrorCode::NotUpgradeAuthority
)]
pub program_data: Account<'info, ProgramData>,
// Verify that the program data address is not bogus.
#[account(
address = crate::ID,
constraint = program.programdata_address()? == Some(program_data.key())
)]
pub program: Program<'info, Soulflip>,
This does not work with litesvm because addProgramFromFile doesn't seem to deploy the program in an upgrade-able way. I am not too aware of the intricacies of litesvm or the svm in general but when anchor test was failing with the same error, I could fix it with:
[[test.genesis]]
upgradeable = true
In my anchor.toml file.
Metadata
Metadata
Assignees
Labels
No labels