Skip to content
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

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft

Conversation

guibescos
Copy link
Contributor

No description provided.

Copy link

vercel bot commented Jul 2, 2024

@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(
Copy link
Contributor Author

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

Copy link
Contributor Author

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

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)]
Copy link
Contributor Author

@guibescos guibescos Jul 2, 2024

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

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" }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't compile

Copy link

@lopeselio lopeselio Jul 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

int32 constant PD_EXPO = -9;
uint64 constant PD_SCALE = 1_000_000_000;
uint64 constant MAX_PD_V_U64 = (1 << 28) - 1;

Copy link
Contributor Author

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

@lopeselio
Copy link

Will get back to working on this asap. had a long pause here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants