Companion for #13683 (#6944)

* Companion for #13683

* Wraps trait is not required

* update lockfile for {"substrate"}

---------

Co-authored-by: parity-processbot <>
This commit is contained in:
Davide Galassi
2023-03-24 15:43:21 +01:00
committed by GitHub
parent bd209c2d70
commit 260d073658
14 changed files with 228 additions and 247 deletions
+1 -1
View File
@@ -34,7 +34,7 @@ use polkadot_primitives::{
CandidateDescriptor, CollatorId, GroupRotationInfo, HeadData, PersistedValidationData,
PvfExecTimeoutKind, ScheduledCore,
};
use sp_application_crypto::AppKey;
use sp_application_crypto::AppCrypto;
use sp_keyring::Sr25519Keyring;
use sp_keystore::Keystore;
use sp_tracing as _;
@@ -45,7 +45,7 @@ use polkadot_node_subsystem::{
use polkadot_node_subsystem_util::TimeoutExt;
use sc_keystore::LocalKeystore;
use sp_application_crypto::AppKey;
use sp_application_crypto::AppCrypto;
use sp_core::{sr25519::Pair, testing::TaskExecutor, Pair as PairT};
use sp_keyring::Sr25519Keyring;
use sp_keystore::{Keystore, KeystorePtr};
@@ -562,18 +562,18 @@ impl TestState {
let validator_id = self.validators[index.0 as usize].public();
let payload = ApprovalVote(candidate_hash).signing_payload(session);
let signature =
Keystore::sign_with(&*keystore, ValidatorId::ID, &validator_id.into(), &payload[..])
.ok()
.flatten()
.unwrap();
let signature = keystore
.sr25519_sign(ValidatorId::ID, &validator_id, &payload)
.ok()
.flatten()
.unwrap();
SignedDisputeStatement::new_unchecked_from_trusted_source(
DisputeStatement::Valid(ValidDisputeStatementKind::ApprovalChecking),
candidate_hash,
session,
validator_id.into(),
signature.try_into().unwrap(),
signature.into(),
)
}
+1 -1
View File
@@ -57,7 +57,7 @@ pub fn scheduled_core(id: u32) -> ScheduledCore {
mod select_availability_bitfields {
use super::{super::*, default_bitvec, occupied_core};
use polkadot_primitives::{ScheduledCore, SigningContext, ValidatorId, ValidatorIndex};
use sp_application_crypto::AppKey;
use sp_application_crypto::AppCrypto;
use sp_keystore::{testing::MemoryKeystore, Keystore, KeystorePtr};
use std::sync::Arc;
+1 -1
View File
@@ -29,7 +29,7 @@ use polkadot_primitives::{
BlockNumber, Hash, Header, PvfCheckStatement, SessionIndex, ValidationCode, ValidationCodeHash,
ValidatorId,
};
use sp_application_crypto::AppKey;
use sp_application_crypto::AppCrypto;
use sp_core::testing::TaskExecutor;
use sp_keyring::Sr25519Keyring;
use sp_keystore::Keystore;