Boot storage program from the SDK
This commit is contained in:
@ -15,6 +15,7 @@ serde = "1.0.89"
|
||||
serde_derive = "1.0.89"
|
||||
solana-logger = { path = "../../logger", version = "0.12.0" }
|
||||
solana-sdk = { path = "../../sdk", version = "0.12.0" }
|
||||
solana-storage-api = { path = "../storage_api", version = "0.12.0" }
|
||||
|
||||
[dev-dependencies]
|
||||
solana-runtime = { path = "../../runtime", version = "0.12.0" }
|
||||
|
@ -9,7 +9,7 @@ use solana_sdk::account::KeyedAccount;
|
||||
use solana_sdk::native_program::ProgramError;
|
||||
use solana_sdk::pubkey::Pubkey;
|
||||
use solana_sdk::solana_entrypoint;
|
||||
use solana_sdk::storage_program::*;
|
||||
use solana_storage_api::*;
|
||||
|
||||
pub const TOTAL_VALIDATOR_REWARDS: u64 = 1000;
|
||||
pub const TOTAL_REPLICATOR_REWARDS: u64 = 1000;
|
||||
@ -180,9 +180,8 @@ mod test {
|
||||
use solana_sdk::account::{create_keyed_accounts, Account};
|
||||
use solana_sdk::hash::Hash;
|
||||
use solana_sdk::signature::{Keypair, KeypairUtil, Signature};
|
||||
use solana_sdk::storage_program::ProofStatus;
|
||||
use solana_sdk::storage_program::StorageTransaction;
|
||||
use solana_sdk::transaction::{Instruction, Transaction};
|
||||
use solana_storage_api::{ProofStatus, StorageTransaction};
|
||||
|
||||
fn test_transaction(
|
||||
tx: &Transaction,
|
||||
|
@ -5,16 +5,15 @@ use solana_sdk::genesis_block::GenesisBlock;
|
||||
use solana_sdk::hash::{hash, Hash};
|
||||
use solana_sdk::pubkey::Pubkey;
|
||||
use solana_sdk::signature::{Keypair, KeypairUtil};
|
||||
use solana_sdk::storage_program;
|
||||
use solana_sdk::storage_program::{StorageTransaction, ENTRIES_PER_SEGMENT};
|
||||
use solana_sdk::system_transaction::SystemTransaction;
|
||||
use solana_storage_api::{StorageTransaction, ENTRIES_PER_SEGMENT};
|
||||
|
||||
fn get_storage_entry_height(bank: &Bank, account: Pubkey) -> u64 {
|
||||
match bank.get_account(&account) {
|
||||
Some(storage_system_account) => {
|
||||
let state = deserialize(&storage_system_account.userdata);
|
||||
if let Ok(state) = state {
|
||||
let state: storage_program::StorageProgramState = state;
|
||||
let state: solana_storage_api::StorageProgramState = state;
|
||||
return state.entry_height;
|
||||
}
|
||||
}
|
||||
@ -29,7 +28,7 @@ fn get_storage_blockhash(bank: &Bank, account: Pubkey) -> Hash {
|
||||
if let Some(storage_system_account) = bank.get_account(&account) {
|
||||
let state = deserialize(&storage_system_account.userdata);
|
||||
if let Ok(state) = state {
|
||||
let state: storage_program::StorageProgramState = state;
|
||||
let state: solana_storage_api::StorageProgramState = state;
|
||||
return state.hash;
|
||||
}
|
||||
}
|
||||
@ -63,7 +62,7 @@ fn test_bank_storage() {
|
||||
blockhash,
|
||||
1,
|
||||
4 * 1024,
|
||||
storage_program::id(),
|
||||
solana_storage_api::id(),
|
||||
0,
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user