Skip to content

Commit

Permalink
Add tests for the new block & genesis existence functions
Browse files Browse the repository at this point in the history
  • Loading branch information
cronokirby committed Jan 28, 2025
1 parent 15b2d55 commit e4da51d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ mod test {
let height = in_block.height();
let storage = Storage::new(None, Some(CHAIN_ID)).await?;
storage.put_block(&in_block).await?;
assert!(storage.block_does_exist(height).await?);
let out_block = storage.get_block(height).await?;
assert_eq!(out_block, Some(in_block));
let last_height = storage.last_height().await?;
Expand Down Expand Up @@ -379,6 +380,7 @@ mod test {
let storage = Storage::new(None, Some(CHAIN_ID)).await?;
let genesis = Genesis::test_value();
storage.put_genesis(&genesis).await?;
assert!(storage.genesis_does_exist(genesis.initial_height()).await?);
let out = storage
.get_genesis(genesis.initial_height())
.await?
Expand Down

0 comments on commit e4da51d

Please sign in to comment.