From c09ea2c314b83a42eff304f0d2f674f1c5577ed4 Mon Sep 17 00:00:00 2001 From: "Jeff Washington (jwash)" <75863576+jeffwashington@users.noreply.github.com> Date: Mon, 15 Mar 2021 19:27:17 -0500 Subject: [PATCH] More AccountSharedData construction (#15844) * one more AccountSharedData construction * one more construct --- core/src/consensus.rs | 6 +++--- sdk/src/native_loader.rs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/src/consensus.rs b/core/src/consensus.rs index 31c4e3bf36..0dab72c1b6 100644 --- a/core/src/consensus.rs +++ b/core/src/consensus.rs @@ -1575,11 +1575,11 @@ pub mod test { fn gen_stakes(stake_votes: &[(u64, &[u64])]) -> Vec<(Pubkey, (u64, ArcVoteAccount))> { let mut stakes = vec![]; for (lamports, votes) in stake_votes { - let mut account = AccountSharedData { + let mut account = AccountSharedData::from(Account { data: vec![0; VoteState::size_of()], lamports: *lamports, - ..AccountSharedData::default() - }; + ..Account::default() + }); let mut vote_state = VoteState::default(); for slot in *votes { vote_state.process_slot_vote_unchecked(*slot); diff --git a/sdk/src/native_loader.rs b/sdk/src/native_loader.rs index 60f32c1481..d6e974c3c5 100644 --- a/sdk/src/native_loader.rs +++ b/sdk/src/native_loader.rs @@ -1,14 +1,14 @@ -use crate::account::AccountSharedData; +use crate::account::{Account, AccountSharedData}; crate::declare_id!("NativeLoader1111111111111111111111111111111"); /// Create an executable account with the given shared object name. pub fn create_loadable_account(name: &str, lamports: u64) -> AccountSharedData { - AccountSharedData { + AccountSharedData::from(Account { lamports, owner: id(), data: name.as_bytes().to_vec(), executable: true, rent_epoch: 0, - } + }) }