Skip to content

Commit 2c1b6ee

Browse files
authored
p-token: Expand comments (#152)
Expand comments
1 parent e804b3a commit 2c1b6ee

3 files changed

Lines changed: 20 additions & 2 deletions

File tree

pinocchio/interface/src/error.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ pub enum TokenError {
2727
/// Invalid number of required signers.
2828
InvalidNumberOfRequiredSigners,
2929
/// State is uninitialized.
30+
///
31+
/// This error is not currently returned by the program and is reserved
32+
/// for compatibility.
3033
UninitializedState,
3134

3235
// 10

pinocchio/interface/src/instruction.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,9 @@ pub enum TokenInstruction {
134134

135135
/// Sets a new authority of a mint or account.
136136
///
137+
/// Note that when setting a new account owner authority on a native
138+
/// token account, the current close authority (if any) will be removed.
139+
///
137140
/// Accounts expected by this instruction:
138141
///
139142
/// * Single authority
@@ -550,7 +553,15 @@ pub enum TokenInstruction {
550553
///
551554
/// Both the number of accounts and instruction data length are used to
552555
/// identify the slice of accounts and instruction data for each
553-
/// instruction.
556+
/// instruction. Since the instruction data length is specified as a `u8`,
557+
/// the maximum instruction data length is 255 bytes, which is sufficient
558+
/// for all current instructions in the program.
559+
///
560+
/// When one or more batched instructions write return data, the batch
561+
/// instruction returns the data written by the last instruction that does
562+
/// so. That instruction does not have to be the final instruction in the
563+
/// batch: later instructions that do not write return data leave the last
564+
/// written return data unchanged.
554565
///
555566
/// Note that it is not sound to have a `batch` instruction that contains
556567
/// other `batch` instruction; an error will be raised when this is

pinocchio/program/src/entrypoint.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,10 +274,14 @@ pub fn process_instruction(accounts: &[AccountInfo], instruction_data: &[u8]) ->
274274
/// - `1`: `InitializeAccount`
275275
/// - `3`: `Transfer`
276276
/// - `7`: `MintTo`
277+
/// - `8`: `Burn`
277278
/// - `9`: `CloseAccount`
278-
/// - `16`: `InitializeAccount2`
279+
/// - `12`: `TransferChecked`
280+
/// - `15`: `BurnChecked`
281+
/// - `17`: `SyncNative`
279282
/// - `18`: `InitializeAccount3`
280283
/// - `20`: `InitializeMint2`
284+
/// - `22`: `InitializeImmutableOwner`
281285
#[inline(always)]
282286
pub(crate) fn inner_process_instruction(
283287
accounts: &[AccountInfo],

0 commit comments

Comments
 (0)