Skip to content

Commit 229c301

Browse files
committed
Remove unnecessary invoke_signed
1 parent 55ecb47 commit 229c301

File tree

1 file changed

+5
-16
lines changed

1 file changed

+5
-16
lines changed

programs/system/src/instructions/initialize_nonce_account.rs

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
use pinocchio::{
22
account_info::AccountInfo,
3-
instruction::{AccountMeta, Instruction, Signer},
4-
program::invoke_signed,
3+
cpi::invoke,
4+
instruction::{AccountMeta, Instruction},
55
pubkey::Pubkey,
66
ProgramResult,
77
};
88

99
/// Drive state of Uninitialized nonce account to Initialized, setting the nonce value.
1010
///
11-
/// The `Pubkey` parameter specifies the entity authorized to execute nonce
12-
/// instruction on the account
13-
///
1411
/// No signatures are required to execute this instruction, enabling derived
1512
/// nonce account addresses.
1613
///
@@ -28,21 +25,14 @@ pub struct InitializeNonceAccount<'a, 'b> {
2825
/// Rent sysvar.
2926
pub rent_sysvar: &'a AccountInfo,
3027

31-
/// Lamports to withdraw.
32-
///
33-
/// The account balance must be left above the rent exempt reserve
34-
/// or at zero.
28+
/// Indicates the entity authorized to execute nonce
29+
/// instruction on the account
3530
pub authority: &'b Pubkey,
3631
}
3732

3833
impl InitializeNonceAccount<'_, '_> {
3934
#[inline(always)]
4035
pub fn invoke(&self) -> ProgramResult {
41-
self.invoke_signed(&[])
42-
}
43-
44-
#[inline(always)]
45-
pub fn invoke_signed(&self, signers: &[Signer]) -> ProgramResult {
4636
// account metadata
4737
let account_metas: [AccountMeta; 3] = [
4838
AccountMeta::writable(self.account.key()),
@@ -63,14 +53,13 @@ impl InitializeNonceAccount<'_, '_> {
6353
data: &instruction_data,
6454
};
6555

66-
invoke_signed(
56+
invoke(
6757
&instruction,
6858
&[
6959
self.account,
7060
self.recent_blockhashes_sysvar,
7161
self.rent_sysvar,
7262
],
73-
signers,
7463
)
7564
}
7665
}

0 commit comments

Comments
 (0)