Skip to content

[accumulator-updater 6/x] Funding account #771

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

Merged
merged 1 commit into from
Apr 19, 2023

Conversation

swimricky
Copy link
Contributor

@swimricky swimricky commented Apr 19, 2023

Summary

Add a SystemAccount that will be used as the payer for all AccumulatorInput account creation

Updates

  • add fund account to put_all ix and list of accounts passed from mock_cpi_caller

TODOs

  • realloc (need wrapper struct in increments of 10240 bytes?)
  • rename AccumulatorInput/AccumulatorHeader to MessageBuffer & MessageHeader - see comment

@swimricky swimricky requested a review from jayantk April 19, 2023 13:37
@vercel
Copy link

vercel bot commented Apr 19, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Ignored Deployments
Name Status Preview Updated (UTC)
example-oracle-amm ⬜️ Ignored (Inspect) Apr 19, 2023 1:37pm
xc-admin-frontend ⬜️ Ignored (Inspect) Apr 19, 2023 1:37pm

Copy link
Contributor

@jayantk jayantk left a comment

Choose a reason for hiding this comment

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

nice!

cpi_caller.as_ref(),
ACCUMULATOR.as_ref(),
base_account_key.as_ref(),
&[bump],
];
let fund_pda_bump = *ctx
.bumps
.get("fund")
Copy link
Contributor

Choose a reason for hiding this comment

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

use the constant?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sorry missed these, will update in #772

@@ -45,8 +45,10 @@ pub struct UpdatePrice<'info> {
bump,
)]
pub pyth_price_account: AccountLoader<'info, PriceAccount>,
// #[account(mut)]
// pub payer: Signer<'info>,
Copy link
Contributor

Choose a reason for hiding this comment

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

delete?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sorry missed these, will update in #772

@@ -15,6 +15,10 @@ const accumulatorUpdaterProgram = anchor.workspace
.AccumulatorUpdater as Program<AccumulatorUpdater>;
const mockCpiProg = anchor.workspace.MockCpiCaller as Program<MockCpiCaller>;
let whitelistAuthority = anchor.web3.Keypair.generate();
const [fundPda] = anchor.web3.PublicKey.findProgramAddressSync(
[Buffer.from("accumulator"), Buffer.from("fund")],
Copy link
Contributor

Choose a reason for hiding this comment

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

can you write down the system for seed paths somewhere? It's a little confusing to me that the "fund" seed is under "accumulator" -- i thought that "accumulator" was the path for the account keys.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i didn't really have any system for these it was arbitrarily chosen. i'll change the fund's seeds to be just "fund"

@swimricky swimricky merged commit 9fea461 into main Apr 19, 2023
@swimricky swimricky deleted the accumulator-updater/funding branch April 19, 2023 16:51
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