77#[ repr( u8 ) ]
88#[ derive( Clone , Copy , Debug , PartialEq , Eq ) ]
99pub enum NonceInstruction {
10- /// Creates a nonce account at the PDA derived from a caller-chosen 32-byte `nonce_id`.
11- ///
12- /// Instruction data: [`InitializeData`].
10+ /// Creates the nonce state PDA for an authority.
1311 ///
1412 /// On success, the program:
1513 /// 1. Allocates and assigns the PDA via System program CPI. Caller must pre-fund it with
@@ -48,25 +46,12 @@ pub enum NonceInstruction {
4846 /// flags matching the wrapped message.
4947 Submit ,
5048
51- /// Rotates the authority controlling this nonce account.
52- ///
53- /// Instruction data: [`SetAuthorityData`].
54- ///
55- /// Runs only as an inner instruction of a wrapped transaction submitted through `Submit`.
56- /// Inherits the authorization from the outer `Submit`. A direct outer call cannot succeed,
57- /// because nothing outside this program can sign for `NonceAuthorityPda`.
58- ///
59- /// Accounts required:
60- /// - `[signer]` `NonceAuthorityPda`
61- /// - `[writable]` `NonceStatePda`
62- SetAuthority ,
63-
6449 /// Closes a nonce account and refunds its lamports.
6550 ///
6651 /// Instruction data: [`CloseData`].
6752 ///
68- /// Runs only as an inner instruction of a wrapped transaction submitted through `Submit`
69- /// for the same reason as `SetAuthority `.
53+ /// Runs only as an inner instruction of a wrapped transaction submitted through `Submit`,
54+ /// because nothing outside this program can sign for `NonceAuthorityPda `.
7055 ///
7156 /// Accounts required:
7257 /// - `[signer]` `NonceAuthorityPda`
@@ -106,8 +91,7 @@ impl TryFrom<u8> for NonceInstruction {
10691 match value {
10792 0 => Ok ( Self :: Initialize ) ,
10893 1 => Ok ( Self :: Submit ) ,
109- 2 => Ok ( Self :: SetAuthority ) ,
110- 3 => Ok ( Self :: Close ) ,
94+ 2 => Ok ( Self :: Close ) ,
11195 _ => Err ( ( ) ) ,
11296 }
11397 }
@@ -127,8 +111,7 @@ mod tests {
127111 fn discriminants_match ( ) {
128112 assert_eq ! ( u8 :: from( NonceInstruction :: Initialize ) , 0 ) ;
129113 assert_eq ! ( u8 :: from( NonceInstruction :: Submit ) , 1 ) ;
130- assert_eq ! ( u8 :: from( NonceInstruction :: SetAuthority ) , 2 ) ;
131- assert_eq ! ( u8 :: from( NonceInstruction :: Close ) , 3 ) ;
114+ assert_eq ! ( u8 :: from( NonceInstruction :: Close ) , 2 ) ;
132115 }
133116
134117 #[ test]
0 commit comments