Skip to content

Commit 49fc5db

Browse files
committed
Use signer seeds on transfer
1 parent e04e599 commit 49fc5db

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

programs/system/src/lib.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,17 @@ pub mod instructions;
1414

1515
pinocchio_pubkey::declare_id!("11111111111111111111111111111111");
1616

17-
/// Create an account with a minimal balance to be rent-exempt.
17+
/// Create an account with a minimum balance to be rent-exempt.
18+
///
19+
/// When creating a PDA `account`, the PDA signer seeds must be provided
20+
/// via the `signers`.
1821
///
1922
/// The account will be funded by the `payer` if its current lamports
20-
/// are insufficient for rent-exemption.
23+
/// are insufficient for rent-exemption. The payer can be a PDA signer
24+
/// owned by the program and its signer seeds can be provided via the
25+
/// `signers`.
2126
#[inline(always)]
22-
pub fn create_account_with_minimal_balance(
27+
pub fn create_account_with_minimum_balance(
2328
account: &AccountInfo,
2429
space: usize,
2530
owner: &Pubkey,
@@ -54,7 +59,7 @@ pub fn create_account_with_minimal_balance(
5459
to: account,
5560
lamports: required_lamports,
5661
}
57-
.invoke()?;
62+
.invoke_signed(signers)?;
5863
}
5964

6065
// Assign the account to the specified owner.

0 commit comments

Comments
 (0)