Skip to content

Commit

Permalink
Clean up tests from runtime.block_on() and moving around Runtime
Browse files Browse the repository at this point in the history
…and `Handle` (paritytech#12941)
  • Loading branch information
dmitry-markin authored and ltfschoen committed Feb 22, 2023
1 parent 97ad514 commit 56829d0
Show file tree
Hide file tree
Showing 13 changed files with 987 additions and 1,139 deletions.
8 changes: 3 additions & 5 deletions client/beefy/src/aux_schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,16 @@ pub(crate) mod tests {
use super::*;
use crate::tests::BeefyTestNet;
use sc_network_test::TestNetFactory;
use tokio::runtime::Runtime;

// also used in tests.rs
pub fn verify_persisted_version<B: BlockT, BE: Backend<B>>(backend: &BE) -> bool {
let version: u32 = load_decode(backend, VERSION_KEY).unwrap().unwrap();
version == CURRENT_VERSION
}

#[test]
fn should_load_persistent_sanity_checks() {
let runtime = Runtime::new().unwrap();
let mut net = BeefyTestNet::new(runtime.handle().clone(), 1);
#[tokio::test]
async fn should_load_persistent_sanity_checks() {
let mut net = BeefyTestNet::new(1);
let backend = net.peer(0).client().as_backend();

// version not available in db -> None
Expand Down
Loading

0 comments on commit 56829d0

Please sign in to comment.