-
Notifications
You must be signed in to change notification settings - Fork 222
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
[Solana] More tests #1263
Merged
Merged
[Solana] More tests #1263
Changes from 20 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
0e3dd8d
Checkpoint
guibescos 31143ad
Checkpoint
guibescos 299dbc0
Cleanup
guibescos 71356ce
Checkpoint, debug
guibescos 422c2db
Go
guibescos 8e810fc
Checkpoint
guibescos 4ba2740
Fix
guibescos 860b4a9
Add new error and test
guibescos 6ea2a86
Cleanup
guibescos e491fb9
Add another test
guibescos b3510b0
Keep adding errors
guibescos e01e64b
Another test
guibescos d2c92c4
Add comment
guibescos 14a8df5
More
guibescos 336eb34
Do it
guibescos 7596a4a
Again
guibescos c0df649
Nice (#1265)
guibescos 3870b0e
Merge branch 'main' into solana/all-tests
guibescos 0f8ec7f
Merge remote-tracking branch 'refs/remotes/origin/solana/all-tests' i…
guibescos 5bad889
Test governance
guibescos 80f48ab
Fix
guibescos File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,8 +68,8 @@ pub mod pyth_solana_receiver { | |
Ok(()) | ||
} | ||
|
||
pub fn authorize_governance_authority_transfer( | ||
ctx: Context<AuthorizeGovernanceAuthorityTransfer>, | ||
pub fn accept_governance_authority_transfer( | ||
ctx: Context<AcceptGovernanceAuthorityTransfer>, | ||
) -> Result<()> { | ||
let config = &mut ctx.accounts.config; | ||
config.governance_authority = config.target_governance_authority.ok_or(error!( | ||
|
@@ -244,13 +244,13 @@ pub struct Governance<'info> { | |
} | ||
|
||
#[derive(Accounts)] | ||
pub struct AuthorizeGovernanceAuthorityTransfer<'info> { | ||
pub struct AcceptGovernanceAuthorityTransfer<'info> { | ||
#[account(constraint = | ||
payer.key() == config.target_governance_authority.ok_or(error!(ReceiverError::NonexistentGovernanceAuthorityTransferRequest))? @ | ||
ReceiverError::TargetGovernanceAuthorityMismatch | ||
)] | ||
pub payer: Signer<'info>, | ||
#[account(seeds = [CONFIG_SEED.as_ref()], bump)] | ||
#[account(mut, seeds = [CONFIG_SEED.as_ref()], bump)] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lol I had forgotten this |
||
pub config: Account<'info, Config>, | ||
} | ||
|
||
|
@@ -269,7 +269,7 @@ pub struct PostUpdates<'info> { | |
pub treasury: AccountInfo<'info>, | ||
/// The contraint is such that either the price_update_account is uninitialized or the payer is the write_authority. | ||
/// Pubkey::default() is the SystemProgram on Solana and it can't sign so it's impossible that price_update_account.write_authority == Pubkey::default() once the account is initialized | ||
#[account(init_if_needed, constraint = price_update_account.write_authority == Pubkey::default() || price_update_account.write_authority == payer.key(), payer =payer, space = PriceUpdateV1::LEN)] | ||
#[account(init_if_needed, constraint = price_update_account.write_authority == Pubkey::default() || price_update_account.write_authority == payer.key() @ ReceiverError::WrongWriteAuthority , payer =payer, space = PriceUpdateV1::LEN)] | ||
pub price_update_account: Account<'info, PriceUpdateV1>, | ||
pub system_program: Program<'info, System>, | ||
} | ||
|
@@ -290,7 +290,7 @@ pub struct PostUpdatesAtomic<'info> { | |
pub treasury: AccountInfo<'info>, | ||
/// The contraint is such that either the price_update_account is uninitialized or the payer is the write_authority. | ||
/// Pubkey::default() is the SystemProgram on Solana and it can't sign so it's impossible that price_update_account.write_authority == Pubkey::default() once the account is initialized | ||
#[account(init_if_needed, constraint = price_update_account.write_authority == Pubkey::default() || price_update_account.write_authority == payer.key(), payer = payer, space = PriceUpdateV1::LEN)] | ||
#[account(init_if_needed, constraint = price_update_account.write_authority == Pubkey::default() || price_update_account.write_authority == payer.key() @ ReceiverError::WrongWriteAuthority, payer = payer, space = PriceUpdateV1::LEN)] | ||
pub price_update_account: Account<'info, PriceUpdateV1>, | ||
pub system_program: Program<'info, System>, | ||
} | ||
|
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The arguments to this function changed