Update Storage Program to support multiple accounts
This commit is contained in:
@@ -3,11 +3,17 @@ use solana_sdk::hash::Hash;
|
||||
use solana_sdk::pubkey::Pubkey;
|
||||
use solana_sdk::signature::Signature;
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
|
||||
pub enum ProofStatus {
|
||||
Skipped,
|
||||
Valid,
|
||||
NotValid,
|
||||
Skipped,
|
||||
}
|
||||
|
||||
impl Default for ProofStatus {
|
||||
fn default() -> Self {
|
||||
ProofStatus::Skipped
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Serialize, Deserialize, Clone)]
|
||||
@@ -15,6 +21,7 @@ pub struct ProofInfo {
|
||||
pub id: Pubkey,
|
||||
pub signature: Signature,
|
||||
pub sha_state: Hash,
|
||||
pub status: ProofStatus,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Serialize, Deserialize, Clone)]
|
||||
@@ -23,14 +30,19 @@ pub struct ValidationInfo {
|
||||
pub proof_mask: Vec<ProofStatus>,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Serialize, Deserialize)]
|
||||
pub struct StorageContract {
|
||||
pub entry_height: u64,
|
||||
pub hash: Hash,
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub enum StorageContract {
|
||||
//don't move this
|
||||
Default,
|
||||
|
||||
pub proofs: Vec<Vec<ProofInfo>>,
|
||||
pub previous_proofs: Vec<Vec<ProofInfo>>,
|
||||
|
||||
pub lockout_validations: Vec<Vec<ValidationInfo>>,
|
||||
pub reward_validations: Vec<Vec<ValidationInfo>>,
|
||||
ValidatorStorage {
|
||||
entry_height: u64,
|
||||
hash: Hash,
|
||||
lockout_validations: Vec<Vec<ProofInfo>>,
|
||||
reward_validations: Vec<Vec<ProofInfo>>,
|
||||
},
|
||||
ReplicatorStorage {
|
||||
proofs: Vec<ProofInfo>,
|
||||
reward_validations: Vec<Vec<ProofInfo>>,
|
||||
},
|
||||
}
|
||||
|
Reference in New Issue
Block a user