move Account to solana-sdk (#13198)

This commit is contained in:
Jack May
2020-10-28 22:01:07 -07:00
committed by GitHub
parent d5e439037b
commit c458d4b213
38 changed files with 460 additions and 459 deletions

View File

@ -1,7 +1,10 @@
#![feature(test)]
extern crate test;
use solana_sdk::{slot_history::SlotHistory, sysvar::Sysvar};
use solana_sdk::{
account::{create_account, from_account},
slot_history::SlotHistory,
};
use test::Bencher;
#[bench]
@ -9,8 +12,8 @@ fn bench_to_from_account(b: &mut Bencher) {
let mut slot_history = SlotHistory::default();
b.iter(|| {
let account = slot_history.create_account(0);
slot_history = SlotHistory::from_account(&account).unwrap();
let account = create_account(&slot_history, 0);
slot_history = from_account::<SlotHistory>(&account).unwrap();
});
}