Include tests for new updates of TxGraph

This commit is contained in:
rajarshimaitra
2023-04-08 21:02:33 +05:30
committed by 志宇
parent 10ab77c549
commit 001efdd1cb
2 changed files with 283 additions and 6 deletions

View File

@@ -67,6 +67,13 @@ impl LocalChain {
.map(|(&height, &hash)| BlockId { height, hash })
}
/// Get a block at the given height.
pub fn get_block(&self, height: u32) -> Option<BlockId> {
self.blocks
.get(&height)
.map(|&hash| BlockId { height, hash })
}
/// This is like the sparsechain's logic, expect we must guarantee that all invalidated heights
/// are to be re-filled.
pub fn determine_changeset(&self, update: &Self) -> Result<ChangeSet, UpdateNotConnectedError> {