Refactor RPC subscriptions account handling (#9888) (#9912)

automerge
This commit is contained in:
mergify[bot]
2020-05-07 01:14:58 -07:00
committed by GitHub
parent 9a5fc3513a
commit 558324b861
10 changed files with 464 additions and 277 deletions

View File

@@ -162,6 +162,24 @@ impl BlockCommitmentCache {
}
}
#[cfg(test)]
pub fn new_for_tests_with_blockstore_bank(
blockstore: Arc<Blockstore>,
bank: Arc<Bank>,
root: Slot,
) -> Self {
let mut block_commitment: HashMap<Slot, BlockCommitment> = HashMap::new();
block_commitment.insert(0, BlockCommitment::default());
Self {
block_commitment,
blockstore,
total_stake: 42,
largest_confirmed_root: root,
bank,
root,
}
}
#[cfg(test)]
pub(crate) fn set_get_largest_confirmed_root(&mut self, root: Slot) {
self.largest_confirmed_root = root;