Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions program/src/instruction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ pub enum ProgramMetadataInstruction {
/// minimum size required to be rent exempt, returning any extra
/// lamports to the `destination` account.
///
/// Note: Immutable metadata accounts cannot be trimmed.
///
/// There are 2 optional accounts:
/// - `program`: required to validate whether the authority is the program upgrade
/// authority.
Expand All @@ -160,8 +162,8 @@ pub enum ProgramMetadataInstruction {
/// 1. `[s]` Authority account.
/// 2. `[o]` Program account.
/// 3. `[o]` Program data account.
/// 5. `[w]` Destination account.
/// 6. `[]` Rent sysvar account.
/// 4. `[w]` Destination account.
/// 5. `[ ]` Rent sysvar account.
Trim,

/// Closes a program-owned buffer or metadata account.
Expand All @@ -184,7 +186,7 @@ pub enum ProgramMetadataInstruction {
/// 1. `[s]` Metadata authority or buffer account.
/// 2. `[o]` Program account.
/// 3. `[o]` Program data account.
/// 5. `[w]` Destination account.
/// 4. `[w]` Destination account.
Close,

/// Allocates a buffer account.
Expand Down Expand Up @@ -225,6 +227,8 @@ pub enum ProgramMetadataInstruction {
/// The account is expected to be pre-funded with the required lamports
/// for the new size.
///
/// Note: Immutable metadata accounts cannot be extended.
///
/// There are 2 optional accounts:
/// - `program`: required to validate whether the authority is the program upgrade
/// authority.
Expand Down
2 changes: 1 addition & 1 deletion program/src/processor/extend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub fn extend(accounts: &mut [AccountView], instruction_data: &[u8]) -> ProgramR

// account
// - authority must be a signer (validated by `validate_authority`)
// - must be a buffer or metadata account
// - must be a buffer or mutable metadata account
// - must have a valid authority
// - must be rent exempt (pre-funded account) since we are reallocating the buffer
// account
Expand Down
2 changes: 1 addition & 1 deletion program/src/processor/trim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub fn trim(accounts: &mut [AccountView]) -> ProgramResult {

// account
// - authority must be a signer (checked by `validate_authority`)
// - must be a buffer or metadata account
// - must be a buffer or mutable metadata account
// - must have a valid authority

if account.is_data_empty() {
Expand Down
Loading