refactor function to store into account after data is finished (#15710)

This commit is contained in:
Jeff Washington (jwash) 2021-03-05 11:02:35 -06:00 committed by GitHub
parent 9448540ea6
commit 13b9bb6790
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 7 deletions

View File

@ -163,14 +163,13 @@ impl Accounts {
} }
fn construct_instructions_account(message: &Message) -> Account { fn construct_instructions_account(message: &Message) -> Account {
let mut account = Account { let mut data = message.serialize_instructions();
data: message.serialize_instructions(),
..Account::default()
};
// add room for current instruction index. // add room for current instruction index.
account.data.resize(account.data.len() + 2, 0); data.resize(data.len() + 2, 0);
account Account {
data,
..Account::default()
}
} }
fn load_transaction( fn load_transaction(