Set proper count value for account stores (#4797)

* set count values for store accounts

* Use AppendVecId type
This commit is contained in:
Sathish
2019-06-25 07:21:45 -07:00
committed by Michael Vines
parent 74a06e4230
commit 9e7f618cff
5 changed files with 50 additions and 35 deletions

View File

@@ -1,21 +1,18 @@
use hashbrown::HashMap;
use log::*;
use serde::{Deserialize, Serialize};
use solana_sdk::pubkey::Pubkey;
use std::collections;
use std::collections::HashSet;
pub type Fork = u64;
#[derive(Debug, Default, Deserialize, Serialize)]
#[derive(Debug, Default)]
pub struct AccountsIndex<T> {
#[serde(skip)]
pub account_maps: HashMap<Pubkey, Vec<(Fork, T)>>,
pub roots: HashSet<Fork>,
//This value that needs to be stored to recover the index from AppendVec
#[serde(skip)]
pub last_root: Fork,
}