From 5bd56bb367ec0b01ecca04498b3974ab67bf3189 Mon Sep 17 00:00:00 2001 From: Andrei Sandu Date: Wed, 12 Jan 2022 10:49:15 +0000 Subject: [PATCH] Fix tests Signed-off-by: Andrei Sandu --- Cargo.lock | 1 + node/core/chain-selection/Cargo.toml | 1 + node/core/chain-selection/src/tests.rs | 3 +++ 3 files changed, 5 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index b4a0662695ed..550265cd2a11 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6385,6 +6385,7 @@ dependencies = [ "polkadot-node-subsystem-test-helpers", "polkadot-node-subsystem-util", "polkadot-primitives", + "sc-keystore", "sp-core", "sp-keystore", "thiserror", diff --git a/node/core/chain-selection/Cargo.toml b/node/core/chain-selection/Cargo.toml index ea963552a6ca..189cd187f45f 100644 --- a/node/core/chain-selection/Cargo.toml +++ b/node/core/chain-selection/Cargo.toml @@ -24,3 +24,4 @@ sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } parking_lot = "0.11" assert_matches = "1" kvdb-memorydb = "0.10.0" +sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/node/core/chain-selection/src/tests.rs b/node/core/chain-selection/src/tests.rs index 396e11520733..fc22366bb5b3 100644 --- a/node/core/chain-selection/src/tests.rs +++ b/node/core/chain-selection/src/tests.rs @@ -33,6 +33,7 @@ use assert_matches::assert_matches; use futures::channel::oneshot; use parity_scale_codec::Encode; use parking_lot::Mutex; +use sc_keystore::LocalKeystore; use sp_core::testing::TaskExecutor; use polkadot_node_subsystem::{ @@ -234,6 +235,7 @@ fn test_harness>( ) { let pool = TaskExecutor::new(); let (context, virtual_overseer) = test_helpers::make_subsystem_context(pool); + let keystore = Arc::new(LocalKeystore::in_memory()) as SyncCryptoStorePtr; let backend = TestBackend::default(); let clock = TestClock::new(0); @@ -242,6 +244,7 @@ fn test_harness>( backend.clone(), StagnantCheckInterval::new(TEST_STAGNANT_INTERVAL), Box::new(clock.clone()), + keystore, ); let test_fut = test(backend, clock, virtual_overseer);