Say we have the following definition for an instruction and we know that my_acc
previously took up 200 bytes and is now being realloced to 100. How can we find out how many lamports will be paid to signer
for this?
#[derive(Accounts)]
pub struct ReallocMyAcc<'info> {
#[account(mut)]
pub signer: Signer<'info>,
#[account(
mut,
realloc = 100,
realloc::payer = signer,
realloc::zero = false,
seeds = [123],
bump
)]
pub my_acc: Account<'info, SomeAccount>,
pub system_program: Program<'info, System>,
}
pub fn realloc_my_acc(ctx: Context<ReallocMyAcc>) -> Result<()>{
let lamports_paid_back_to_signer = // How do I calculate this?
}