mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-30 14:17:56 +00:00
Renames of Trait to Config in README.md, weight templates and few minor ones (#7636)
* manual rename * renamse in README.md * fix template
This commit is contained in:
committed by
GitHub
parent
35efc8e4b0
commit
15b0dece54
@@ -189,12 +189,12 @@ mod tests {
|
||||
#[test]
|
||||
fn encode_decode_roundtrip() {
|
||||
use codec::{Decode, Encode};
|
||||
use super::super::super::Config as SessionTrait;
|
||||
use super::super::Config as HistoricalTrait;
|
||||
use super::super::super::Config as SessionConfig;
|
||||
use super::super::Config as HistoricalConfig;
|
||||
|
||||
let sample = (
|
||||
22u32 as <Test as SessionTrait>::ValidatorId,
|
||||
7_777_777 as <Test as HistoricalTrait>::FullIdentification);
|
||||
22u32 as <Test as SessionConfig>::ValidatorId,
|
||||
7_777_777 as <Test as HistoricalConfig>::FullIdentification);
|
||||
|
||||
let encoded = sample.encode();
|
||||
let decoded = Decode::decode(&mut encoded.as_slice()).expect("Must decode");
|
||||
|
||||
@@ -20,9 +20,9 @@
|
||||
use codec::Encode;
|
||||
use sp_runtime::traits::Convert;
|
||||
|
||||
use super::super::Config as SessionTrait;
|
||||
use super::super::Config as SessionConfig;
|
||||
use super::super::{Module as SessionModule, SessionIndex};
|
||||
use super::Config as HistoricalTrait;
|
||||
use super::Config as HistoricalConfig;
|
||||
|
||||
use super::shared;
|
||||
use sp_std::prelude::*;
|
||||
@@ -35,14 +35,14 @@ use sp_std::prelude::*;
|
||||
/// `on_initialize(..)` or `on_finalization(..)`.
|
||||
/// **Must** be called during the session, which validator-set is to be stored for further
|
||||
/// off-chain processing. Otherwise the `FullIdentification` might not be available.
|
||||
pub fn store_session_validator_set_to_offchain<T: HistoricalTrait + SessionTrait>(
|
||||
pub fn store_session_validator_set_to_offchain<T: HistoricalConfig + SessionConfig>(
|
||||
session_index: SessionIndex,
|
||||
) {
|
||||
let encoded_validator_list = <SessionModule<T>>::validators()
|
||||
.into_iter()
|
||||
.filter_map(|validator_id: <T as SessionTrait>::ValidatorId| {
|
||||
.filter_map(|validator_id: <T as SessionConfig>::ValidatorId| {
|
||||
let full_identification =
|
||||
<<T as HistoricalTrait>::FullIdentificationOf>::convert(validator_id.clone());
|
||||
<<T as HistoricalConfig>::FullIdentificationOf>::convert(validator_id.clone());
|
||||
full_identification.map(|full_identification| (validator_id, full_identification))
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
@@ -57,6 +57,6 @@ pub fn store_session_validator_set_to_offchain<T: HistoricalTrait + SessionTrait
|
||||
///
|
||||
/// See [`fn store_session_validator_set_...(..)`](Self::store_session_validator_set_to_offchain)
|
||||
/// for further information and restrictions.
|
||||
pub fn store_current_session_validator_set_to_offchain<T: HistoricalTrait + SessionTrait>() {
|
||||
pub fn store_current_session_validator_set_to_offchain<T: HistoricalConfig + SessionConfig>() {
|
||||
store_session_validator_set_to_offchain::<T>(<SessionModule<T>>::current_index());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user