Add storage space constant (#4366)

automerge
This commit is contained in:
Sagar Dhawan
2019-05-21 11:07:13 -07:00
committed by Grimes
parent f877fb8c8f
commit c9ba9e4eb7
6 changed files with 27 additions and 31 deletions

View File

@@ -1,12 +1,12 @@
use crate::id;
use crate::storage_contract::CheckedProof;
use crate::storage_contract::{CheckedProof, STORAGE_ACCOUNT_SPACE};
use serde_derive::{Deserialize, Serialize};
use solana_sdk::hash::Hash;
use solana_sdk::instruction::{AccountMeta, Instruction};
use solana_sdk::pubkey::Pubkey;
use solana_sdk::signature::Signature;
use solana_sdk::system_instruction;
// TODO maybe split this into StorageReplicator and StorageValidator
#[derive(Serialize, Deserialize, Debug, Clone)]
pub enum StorageInstruction {
SubmitMiningProof {
@@ -27,6 +27,10 @@ pub enum StorageInstruction {
},
}
pub fn create_account(from: &Pubkey, to: &Pubkey, lamports: u64) -> Instruction {
system_instruction::create_account(&from, to, lamports, STORAGE_ACCOUNT_SPACE, &id())
}
pub fn mining_proof(
from_pubkey: &Pubkey,
sha_state: Hash,