todo
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
This commit is contained in:
parent
1206109260
commit
3c469d7194
|
@ -5,10 +5,12 @@ use crate::state::Bank;
|
||||||
#[derive(Accounts)]
|
#[derive(Accounts)]
|
||||||
pub struct UpdateIndex<'info> {
|
pub struct UpdateIndex<'info> {
|
||||||
// TODO: should we support arbitrary number of banks with remaining accounts?
|
// 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)]
|
#[account(mut)]
|
||||||
pub bank: AccountLoader<'info, Bank>,
|
pub bank: AccountLoader<'info, Bank>,
|
||||||
}
|
}
|
||||||
pub fn update_index(ctx: Context<UpdateIndex>) -> Result<()> {
|
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 now_ts = Clock::get()?.unix_timestamp;
|
||||||
|
|
||||||
let mut bank = ctx.accounts.bank.load_mut()?;
|
let mut bank = ctx.accounts.bank.load_mut()?;
|
||||||
|
|
Loading…
Reference in New Issue