Skip to content

Commit

Permalink
Added test for lock for verify_and_execute_block
Browse files Browse the repository at this point in the history
  • Loading branch information
xgreenx committed Jan 19, 2023
1 parent 6d427a6 commit 0040195
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions crates/services/importer/src/importer/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -560,3 +560,16 @@ where

importer.verify_and_execute_block(sealed_block).map(|_| ())
}

#[test]
fn verify_and_execute_allowed_when_locked() {
let importer = Importer::new(
Default::default(),
MockDatabase::default(),
executor(ok(ex_result(13, 0)), MockDatabase::default()),
verifier(ok(())),
);

let _guard = importer.lock();
assert!(importer.verify_and_execute_block(poa_block(13)).is_ok());
}

0 comments on commit 0040195

Please sign in to comment.