Add SystemInstruction::CreateAccount support to CPI (#11649)
This commit is contained in:
@ -63,7 +63,7 @@ impl PreAccount {
|
||||
|
||||
// An account not assigned to the program cannot have its balance decrease.
|
||||
if *program_id != self.owner // line coverage used to get branch coverage
|
||||
&& self.lamports > post.lamports
|
||||
&& self.lamports > post.lamports
|
||||
{
|
||||
return Err(InstructionError::ExternalAccountLamportSpend);
|
||||
}
|
||||
@ -127,6 +127,7 @@ impl PreAccount {
|
||||
|
||||
pub fn update(&mut self, account: &Account) {
|
||||
self.lamports = account.lamports;
|
||||
self.owner = account.owner;
|
||||
if self.data.len() != account.data.len() {
|
||||
// Only system account can change data size, copy with alloc
|
||||
self.data = account.data.clone();
|
||||
|
Reference in New Issue
Block a user