-
Notifications
You must be signed in to change notification settings - Fork 271
[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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ |
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.
nice!
cpi_caller.as_ref(), | ||
ACCUMULATOR.as_ref(), | ||
base_account_key.as_ref(), | ||
&[bump], | ||
]; | ||
let fund_pda_bump = *ctx | ||
.bumps | ||
.get("fund") |
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.
use the constant?
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.
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>, |
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.
delete?
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.
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")], |
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.
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.
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 didn't really have any system for these it was arbitrarily chosen. i'll change the fund's seeds to be just "fund"
Summary
Add a
SystemAccount
that will be used as the payer for allAccumulatorInput
account creationUpdates
fund
account toput_all
ix and list of accounts passed frommock_cpi_caller
TODOs
AccumulatorInput
/AccumulatorHeader
toMessageBuffer
&MessageHeader
- see comment