This repository was archived by the owner on Jun 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Feat/add price slot check (In on-chain programs) #16
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
1c6958a
Add slot check in load_price for bpf arch (on-chain programs)
ali-behjati b026932
Add newline to end of files
ali-behjati b12f339
Move status logic to a getter function
ali-behjati aafac8c
Revert load_price to previous naming
ali-behjati ad2c9b9
Rename max_sender_delay to max_slot_difference
ali-behjati dbbd5d6
Refactor & Add more comments
ali-behjati 508adb5
Add newline to files
ali-behjati b1ae955
Make comments and namings much better according to Jayant suggestions
ali-behjati b77cb07
Move Price deserialization in instruction api
ali-behjati ffd8a89
Rename get_current_status to get_current_price_status
ali-behjati a49ad38
Update readme
ali-behjati 2621445
Fix formatting
ali-behjati 7b5dc22
Update get_accounts example
ali-behjati 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 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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| use { | ||
| pyth_client::id, | ||
| pyth_client::processor::process_instruction, | ||
| solana_program::instruction::Instruction, | ||
| solana_program_test::*, | ||
| solana_sdk::{signature::Signer, transaction::Transaction}, | ||
| }; | ||
|
|
||
| // Panics if running instruction fails | ||
| pub async fn test_instr_exec_ok(instr: Instruction) { | ||
| let (mut banks_client, payer, recent_blockhash) = ProgramTest::new( | ||
| "pyth_client", | ||
| id(), | ||
| processor!(process_instruction), | ||
| ) | ||
| .start() | ||
| .await; | ||
| let mut transaction = Transaction::new_with_payer( | ||
| &[instr], | ||
| Some(&payer.pubkey()), | ||
| ); | ||
| transaction.sign(&[&payer], recent_blockhash); | ||
| banks_client.process_transaction(transaction).await.unwrap() | ||
| } |
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
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.
Uh oh!
There was an error while loading. Please reload this page.