Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
stringhandler committed Dec 19, 2024
1 parent c108dde commit 6ca4c36
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,8 @@ mod prepare_new_block {
fn it_errors_for_genesis_block() {
let db = setup();
let genesis = db.fetch_block(0, true).unwrap();
let template = NewBlockTemplate::from_block(genesis.block().clone(), Difficulty::min(), 5000 * T).unwrap();
let template =
NewBlockTemplate::from_block(genesis.block().clone(), Difficulty::min(), 5000 * T, true).unwrap();
let err = db.prepare_new_block(template).unwrap_err();
assert!(matches!(err, ChainStorageError::InvalidArguments { .. }));
}
Expand All @@ -452,7 +453,7 @@ mod prepare_new_block {
let genesis = db.fetch_block(0, true).unwrap();
let next_block = BlockHeader::from_previous(genesis.header());
let mut template =
NewBlockTemplate::from_block(next_block.into_builder().build(), Difficulty::min(), 5000 * T).unwrap();
NewBlockTemplate::from_block(next_block.into_builder().build(), Difficulty::min(), 5000 * T, true).unwrap();
// This would cause a panic if the sanity checks were not there
template.header.height = 100;
let err = db.prepare_new_block(template.clone()).unwrap_err();
Expand All @@ -468,7 +469,7 @@ mod prepare_new_block {
let genesis = db.fetch_block(0, true).unwrap();
let next_block = BlockHeader::from_previous(genesis.header());
let template =
NewBlockTemplate::from_block(next_block.into_builder().build(), Difficulty::min(), 5000 * T).unwrap();
NewBlockTemplate::from_block(next_block.into_builder().build(), Difficulty::min(), 5000 * T, true).unwrap();
let block = db.prepare_new_block(template).unwrap();
assert_eq!(block.header.height, 1);
}
Expand Down

0 comments on commit 6ca4c36

Please sign in to comment.