No longer allow create-account to add funds to an existing account (#10192)
automerge
This commit is contained in:
@ -208,8 +208,13 @@ pub fn split(
|
||||
split_stake_pubkey: &Pubkey,
|
||||
) -> Vec<Instruction> {
|
||||
vec![
|
||||
system_instruction::allocate(split_stake_pubkey, std::mem::size_of::<StakeState>() as u64),
|
||||
system_instruction::assign(split_stake_pubkey, &id()),
|
||||
system_instruction::create_account(
|
||||
authorized_pubkey, // Sending 0, so any signer will suffice
|
||||
split_stake_pubkey,
|
||||
0,
|
||||
std::mem::size_of::<StakeState>() as u64,
|
||||
&id(),
|
||||
),
|
||||
_split(
|
||||
stake_pubkey,
|
||||
authorized_pubkey,
|
||||
@ -228,10 +233,12 @@ pub fn split_with_seed(
|
||||
seed: &str, // seed
|
||||
) -> Vec<Instruction> {
|
||||
vec![
|
||||
system_instruction::allocate_with_seed(
|
||||
system_instruction::create_account_with_seed(
|
||||
authorized_pubkey, // Sending 0, so any signer will suffice
|
||||
split_stake_pubkey,
|
||||
base,
|
||||
seed,
|
||||
0,
|
||||
std::mem::size_of::<StakeState>() as u64,
|
||||
&id(),
|
||||
),
|
||||
@ -489,7 +496,7 @@ mod tests {
|
||||
&Pubkey::default(),
|
||||
100,
|
||||
&Pubkey::default()
|
||||
)[2]
|
||||
)[1]
|
||||
),
|
||||
Err(InstructionError::InvalidAccountData),
|
||||
);
|
||||
|
Reference in New Issue
Block a user