pub struct ResizeWithPayer<'a, 'info> {
pub account: &'a AccountView<'info>,
pub payer: &'a AccountView<'info>,
pub system_program: &'a AccountView<'info>,
pub program_id: &'a Address,
pub new_len: usize,
}Expand description
Resize program-owned state, funding only missing rent through System CPI.
The default invocation reads live rent. Growth is checked against the length
at instruction entry before a payer is charged. Newly exposed bytes are zeroed;
shrinking retains excess lamports in the account. This does not authorize an
application’s resize: validate its authority before invoking this builder.
program_id must be the current entrypoint’s program ID.
Fields§
§account: &'a AccountView<'info>§payer: &'a AccountView<'info>§system_program: &'a AccountView<'info>§program_id: &'a Address§new_len: usizeImplementations§
Source§impl ResizeWithPayer<'_, '_>
impl ResizeWithPayer<'_, '_>
Sourcepub fn invoke(&self) -> ProgramResult
pub fn invoke(&self) -> ProgramResult
Fund from a transaction signer using the live Rent sysvar.
Sourcepub fn invoke_signed(&self, signers: &[Signer<'_, '_>]) -> ProgramResult
pub fn invoke_signed(&self, signers: &[Signer<'_, '_>]) -> ProgramResult
Also support a System-owned PDA payer derived by the current program. Nonempty signer seeds are verified by the SVM, not assumed valid here.
Sourcepub fn invoke_signed_with_rent(
&self,
rent: &Rent,
signers: &[Signer<'_, '_>],
) -> ProgramResult
pub fn invoke_signed_with_rent( &self, rent: &Rent, signers: &[Signer<'_, '_>], ) -> ProgramResult
Reuse a Rent value already read from the target cluster in this instruction.
A fabricated or stale rent value can underfund the account; use invoke
unless the caller already has the live sysvar.