Update Substrate Dependency (#566)

* Update `sp-io` dependency

* Rename Trait to Config

* RustFmt

* Bump `sp-io` again

* Use new frame_system weight types in Rialto and Millau runtimes

* Update test Runtimes to use new weight types

* Bump `sp-io` again

* Update to not-the latest first.

* Update benchmarks.

* Another Trai.

* Move new weight types into runtime primitive crates

This allows us to check limits for extrinsics from other parts
of the codebase without pulling in the entire chain runtime.

* Remove leftover comments

* Move new functions to a better location

* Small formatting fixes

* Add actual documentation to new weight config types

* Decrease maximum block weight of Millau chain

* Decreease maximum block length of Millau chain

Co-authored-by: Tomasz Drwięga <tomasz@parity.io>
This commit is contained in:
Hernando Castano
2020-12-16 04:52:53 -05:00
committed by Bastian Köcher
parent 8a5b51a944
commit ee655b1057
31 changed files with 328 additions and 293 deletions
@@ -31,7 +31,7 @@ pub const WORST_MESSAGE_SIZE_FACTOR: u32 = 1000;
const SEED: u32 = 0;
/// Module we're benchmarking here.
pub struct Module<T: Trait<I>, I: crate::Instance>(crate::Module<T, I>);
pub struct Module<T: Config<I>, I: crate::Instance>(crate::Module<T, I>);
/// Benchmark-specific message parameters.
pub struct MessageParams<ThisAccountId> {
@@ -44,7 +44,7 @@ pub struct MessageParams<ThisAccountId> {
}
/// Trait that must be implemented by runtime.
pub trait Trait<I: Instance>: crate::Trait<I> {
pub trait Config<I: Instance>: crate::Config<I> {
/// Create given account and give it enough balance for test purposes.
fn endow_account(account: &Self::AccountId);
/// Prepare message to send over lane.
@@ -83,7 +83,7 @@ fn bench_lane_id() -> LaneId {
*b"test"
}
fn send_regular_message<T: Trait<I>, I: Instance>() {
fn send_regular_message<T: Config<I>, I: Instance>() {
let mut outbound_lane = crate::outbound_lane::<T, I>(bench_lane_id());
outbound_lane.send_message(MessageData {
payload: vec![],
@@ -91,7 +91,7 @@ fn send_regular_message<T: Trait<I>, I: Instance>() {
});
}
fn confirm_message_delivery<T: Trait<I>, I: Instance>(nonce: MessageNonce) {
fn confirm_message_delivery<T: Config<I>, I: Instance>(nonce: MessageNonce) {
let mut outbound_lane = crate::outbound_lane::<T, I>(bench_lane_id());
assert!(outbound_lane.confirm_delivery(nonce).is_some());
}