@@ -65,11 +65,13 @@ pub enum TokenInstruction {
6565 ///
6666 /// 0. `[writable]` The multisignature account to initialize.
6767 /// 1. `[]` Rent sysvar.
68- /// 2. `..+N` `[signer]` The signer accounts, must equal to N where `1 <= N <= 11`.
68+ /// 2. `..+N` `[signer]` The signer accounts, must equal to N where `1 <=
69+ /// N <= 11`.
6970 ///
7071 /// Data expected by this instruction:
7172 ///
72- /// - `u8` The number of signers (M) required to validate this multisignature account.
73+ /// - `u8` The number of signers (M) required to validate this
74+ /// multisignature account.
7375 InitializeMultisig ,
7476
7577 /// Transfers tokens from one account to another either directly or via a
@@ -268,7 +270,8 @@ pub enum TokenInstruction {
268270 /// Data expected by this instruction:
269271 ///
270272 /// - `u64` The amount of tokens to transfer.
271- /// - `u8` Expected number of base 10 digits to the right of the decimal place.
273+ /// - `u8` Expected number of base 10 digits to the right of the decimal
274+ /// place.
272275 TransferChecked ,
273276
274277 /// Approves a delegate. A delegate is given the authority over tokens on
@@ -296,7 +299,8 @@ pub enum TokenInstruction {
296299 /// Data expected by this instruction:
297300 ///
298301 /// - `u64` The amount of tokens the delegate is approved for.
299- /// - `u8` Expected number of base 10 digits to the right of the decimal place.
302+ /// - `u8` Expected number of base 10 digits to the right of the decimal
303+ /// place.
300304 ApproveChecked ,
301305
302306 /// Mints new tokens to an account. The native mint does not support
@@ -322,7 +326,8 @@ pub enum TokenInstruction {
322326 /// Data expected by this instruction:
323327 ///
324328 /// - `u64` The amount of new tokens to mint.
325- /// - `u8` Expected number of base 10 digits to the right of the decimal place.
329+ /// - `u8` Expected number of base 10 digits to the right of the decimal
330+ /// place.
326331 MintToChecked ,
327332
328333 /// Burns tokens by removing them from an account. [`BurnChecked`] does not
@@ -349,13 +354,14 @@ pub enum TokenInstruction {
349354 /// Data expected by this instruction:
350355 ///
351356 /// - `u64` The amount of tokens to burn.
352- /// - `u8` Expected number of base 10 digits to the right of the decimal place.
357+ /// - `u8` Expected number of base 10 digits to the right of the decimal
358+ /// place.
353359 BurnChecked ,
354360
355- /// Like [`InitializeAccount`], but the owner pubkey is passed via instruction
356- /// data rather than the accounts list. This variant may be preferable
357- /// when using Cross Program Invocation from an instruction that does
358- /// not need the owner's `AccountInfo` otherwise.
361+ /// Like [`InitializeAccount`], but the owner pubkey is passed via
362+ /// instruction data rather than the accounts list. This variant may be
363+ /// preferable when using Cross Program Invocation from an instruction
364+ /// that does not need the owner's `AccountInfo` otherwise.
359365 ///
360366 /// Accounts expected by this instruction:
361367 ///
@@ -399,11 +405,13 @@ pub enum TokenInstruction {
399405 /// Accounts expected by this instruction:
400406 ///
401407 /// 0. `[writable]` The multisignature account to initialize.
402- /// 1. `..+N` `[signer]` The signer accounts, must equal to N where `1 <= N <= 11`.
408+ /// 1. `..+N` `[signer]` The signer accounts, must equal to N where `1 <=
409+ /// N <= 11`.
403410 ///
404411 /// Data expected by this instruction:
405412 ///
406- /// - `u8` The number of signers (M) required to validate this multisignature account.
413+ /// - `u8` The number of signers (M) required to validate this
414+ /// multisignature account.
407415 InitializeMultisig2 ,
408416
409417 /// Like [`InitializeMint`], but does not require the Rent sysvar to be
@@ -462,9 +470,9 @@ pub enum TokenInstruction {
462470 /// - `u64` The amount of tokens to reformat.
463471 AmountToUiAmount ,
464472
465- /// Convert a `UiAmount` of tokens to a little-endian `u64` raw Amount, using
466- /// the given mint. In this version of the program, the mint can only
467- /// specify the number of decimals.
473+ /// Convert a `UiAmount` of tokens to a little-endian `u64` raw Amount,
474+ /// using the given mint. In this version of the program, the mint can
475+ /// only specify the number of decimals.
468476 ///
469477 /// Return data can be fetched using `sol_get_return_data` and deserializing
470478 /// the return data as a little-endian `u64`.
@@ -490,22 +498,26 @@ pub enum TokenInstruction {
490498 /// 3. `..+M` `[signer]` M signer accounts.
491499 WithdrawExcessLamports = 38 ,
492500
493- /// Executes a batch of instructions. The instructions to be executed are specified
494- /// in sequence on the instruction data. Each instruction provides:
501+ /// Executes a batch of instructions. The instructions to be executed are
502+ /// specified in sequence on the instruction data. Each instruction
503+ /// provides:
495504 /// - `u8`: number of accounts
496505 /// - `u8`: instruction data length (includes the discriminator)
497506 /// - `u8`: instruction discriminator
498507 /// - `[u8]`: instruction data
499508 ///
500- /// Accounts follow a similar pattern, where accounts for each instruction are
501- /// specified in sequence. Therefore, the number of accounts expected by this
502- /// instruction is variable, i.e., it depends on the instructions provided.
509+ /// Accounts follow a similar pattern, where accounts for each instruction
510+ /// are specified in sequence. Therefore, the number of accounts
511+ /// expected by this instruction is variable, i.e., it depends on the
512+ /// instructions provided.
503513 ///
504- /// Both the number of accounts and instruction data length are used to identify
505- /// the slice of accounts and instruction data for each instruction.
514+ /// Both the number of accounts and instruction data length are used to
515+ /// identify the slice of accounts and instruction data for each
516+ /// instruction.
506517 ///
507- /// Note that it is not sound to have a `batch` instruction that contains other
508- /// `batch` instruction; an error will be raised when this is detected.
518+ /// Note that it is not sound to have a `batch` instruction that contains
519+ /// other `batch` instruction; an error will be raised when this is
520+ /// detected.
509521 Batch = 255 ,
510522 // Any new variants also need to be added to program-2022 `TokenInstruction`, so that the
511523 // latter remains a superset of this instruction set. New variants also need to be added to
@@ -554,8 +566,10 @@ impl TryFrom<u8> for AuthorityType {
554566
555567#[ cfg( test) ]
556568mod tests {
557- use super :: { AuthorityType , TokenInstruction } ;
558- use strum:: IntoEnumIterator ;
569+ use {
570+ super :: { AuthorityType , TokenInstruction } ,
571+ strum:: IntoEnumIterator ,
572+ } ;
559573
560574 #[ test]
561575 fn test_token_instruction_from_u8_exhaustive ( ) {
0 commit comments