Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
This commit is contained in:
microwavedcola1 2022-04-12 20:43:45 +02:00
parent 1206109260
commit 3c469d7194
1 changed files with 2 additions and 0 deletions

View File

@ -5,10 +5,12 @@ use crate::state::Bank;
#[derive(Accounts)]
pub struct UpdateIndex<'info> {
// TODO: should we support arbitrary number of banks with remaining accounts?
// ix - consumed 17641 of 101000 compute units, so we have a lot of compute
#[account(mut)]
pub bank: AccountLoader<'info, Bank>,
}
pub fn update_index(ctx: Context<UpdateIndex>) -> Result<()> {
// TODO: should we enforce a minimum window between 2 update_index ix calls?
let now_ts = Clock::get()?.unix_timestamp;
let mut bank = ctx.accounts.bank.load_mut()?;