-
Notifications
You must be signed in to change notification settings - Fork 220
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
Pyth solana stub #1754
base: main
Are you sure you want to change the base?
Pyth solana stub #1754
Conversation
…Pyth Structs and Utils
added price update v2 functions in lib.rs
@lopeselio is attempting to deploy a commit to the pyth-web Team on Vercel. A member of the Team first needs to authorize it. |
@@ -254,6 +254,49 @@ pub mod pyth_solana_receiver { | |||
pub fn reclaim_rent(_ctx: Context<ReclaimRent>) -> Result<()> { | |||
Ok(()) | |||
} | |||
|
|||
// New function to initialize a PriceUpdateV2 account without verifications (for testing) | |||
pub fn initialize_price_update_v2( |
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 stub needs to be a different program in programs
, otherwise there's a risk we deploy this
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.
ex:
programs/pyth-solana-receiver-stub
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.
I see. Will take care of this. Thanks for informing me.
// New context for initializing PriceUpdateV2 without verifications | ||
#[derive(Accounts)] | ||
pub struct InitializePriceUpdateV2<'info> { | ||
#[account(init, payer = user, space = PriceUpdateV2::LEN)] |
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.
You can use init_if_needed
and you will only need 1 instruction that can be used to both update and create new ones
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.
Thanks
tokio = "1.14.1" | ||
program-simulator = { path = "../../program_simulator" } | ||
wormhole-vaas-serde = { workspace = true } | ||
serde_wormhole = { workspace = true } | ||
common-test-utils = { path = "../../common_test_utils" } | ||
|
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.
It doesn't compile
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.
Hey @guibescos I had this issue in Rust. I'm still trying to solve the issue
int32 constant PD_EXPO = -9; | ||
uint64 constant PD_SCALE = 1_000_000_000; | ||
uint64 constant MAX_PD_V_U64 = (1 << 28) - 1; | ||
|
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.
Please remove all these unrelated chnages from this branch
Will get back to working on this asap. had a long pause here |
No description provided.