Skip to content
This repository was archived by the owner on Mar 13, 2023. It is now read-only.

Commit dd4fa03

Browse files
aurexavxiaoch05
andauthored
Update Substrate (#977)
* Anchor `darwinia-v0.11.7` * Bump Denpendencies * Anchor `darwinia-v0.11.7` * Resolve Dependencies * Downgrade `kvdb-rocksdb` * Companion for Substrate#9163 * Companion for Substrate#9090 * Companion for Substrate#9228 * Companion for Substrate#9266 * Companion for Substrate#9276 * Companion for Substrate#9351 * Companion for Substrate#9367 * Companion for Substrate#9384 * Companion for Substrate#9315 * Companion for Substrate#9395 * Bump Ethereum Part.1 * Companion for Substrate#9411 * Companion for Substrate#9414 * Companion for Substrate#9165 * Companion for Substrate#9319 * Companion for Substrate#9502 * Companion for Substrate#9471 * Companion for Substrate#9514 * Bump Ethereum Part.2 * Bump `ethash` * update ethabi usage * type fix * rmv warning * Bump Ethereum Part.3 * Bump Ethereum Part.4 * update kton ethabi * Bump Ethereum Part.5 * Bump `kvdb-rocksdb` * Companion for Substrate#9319 Part.2 * Bump Ethereum Part.6 * Format * Companion for Substrate#9227 * Companion for Substrate#9514 Part.2 * Companion for Substrate#9414 Part.2 * Suppress Warning * Bump Ethereum Part.7 * Companion for Substrate#9491 * Companion for Substrate#9227 Part.2 * Fix Compile * Disable Extension for Current Version * Fix Compile * Fix Test * Merge & Fix Compile * Suppress Warning * Fix Test * repair ethabi func * Fix Test * Format * Update License * Use `EthereumBlockV0` * Add TODO * Set `constant` * Try Fix CI Co-authored-by: xiaocheng <[email protected]>
1 parent 4d018c8 commit dd4fa03

140 files changed

Lines changed: 1880 additions & 1784 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 52 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,33 @@
1-
// This file is part of Substrate.
2-
3-
// Copyright (C) 2020 Parity Technologies (UK) Ltd.
4-
// SPDX-License-Identifier: Apache-2.0
5-
6-
// Licensed under the Apache License, Version 2.0 (the "License");
7-
// you may not use this file except in compliance with the License.
8-
// You may obtain a copy of the License at
1+
// This file is part of Darwinia.
2+
//
3+
// Copyright (C) 2018-2021 Darwinia Network
4+
// SPDX-License-Identifier: GPL-3.0
95
//
10-
// http://www.apache.org/licenses/LICENSE-2.0
6+
// Darwinia is free software: you can redistribute it and/or modify
7+
// it under the terms of the GNU General Public License as published by
8+
// the Free Software Foundation, either version 3 of the License, or
9+
// (at your option) any later version.
1110
//
12-
// Unless required by applicable law or agreed to in writing, software
13-
// distributed under the License is distributed on an "AS IS" BASIS,
14-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15-
// See the License for the specific language governing permissions and
16-
// limitations under the License.
11+
// Darwinia is distributed in the hope that it will be useful,
12+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
// GNU General Public License for more details.
15+
//
16+
// You should have received a copy of the GNU General Public License
17+
// along with Darwinia. If not, see <https://www.gnu.org/licenses/>.
1718

1819
//! Autogenerated weights for {{pallet}}
1920
//!
2021
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION {{version}}
21-
//! DATE: {{date}}, STEPS: {{cmd.steps}}, REPEAT: {{cmd.repeat}}, LOW RANGE: {{cmd.lowest_range_values}}, HIGH RANGE: {{cmd.highest_range_values}}
22+
//! DATE: {{date}}, STEPS: `{{cmd.steps}}`, REPEAT: {{cmd.repeat}}, LOW RANGE: `{{cmd.lowest_range_values}}`, HIGH RANGE: `{{cmd.highest_range_values}}`
2223
//! EXECUTION: {{cmd.execution}}, WASM-EXECUTION: {{cmd.wasm_execution}}, CHAIN: {{cmd.chain}}, DB CACHE: {{cmd.db_cache}}
2324

2425
// Executed Command:
2526
{{#each args as |arg|~}}
2627
// {{arg}}
2728
{{/each}}
2829

30+
#![cfg_attr(rustfmt, rustfmt_skip)]
2931
#![allow(unused_parens)]
3032
#![allow(unused_imports)]
3133

@@ -34,69 +36,80 @@ use sp_std::marker::PhantomData;
3436

3537
/// Weight functions needed for {{pallet}}.
3638
pub trait WeightInfo {
37-
{{#each benchmarks as |benchmark| ~}}
39+
{{~#each benchmarks as |benchmark|}}
3840
fn {{benchmark.name~}}
3941
(
4042
{{~#each benchmark.components as |c| ~}}
4143
{{c.name}}: u32, {{/each~}}
4244
) -> Weight;
43-
{{/each}}
45+
{{~/each}}
4446
}
4547

4648
/// Weights for {{pallet}} using the Substrate node and recommended hardware.
4749
pub struct SubstrateWeight<T>(PhantomData<T>);
50+
{{~#if (eq pallet "frame_system")}}
51+
impl<T: crate::Config> WeightInfo for SubstrateWeight<T> {
52+
{{~else}}
4853
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
49-
{{#each benchmarks as |benchmark| ~}}
54+
{{~/if}}
55+
{{~#each benchmarks as |benchmark|}}
56+
{{~#each benchmark.comments as |comment|}}
57+
// {{comment}}
58+
{{~/each}}
5059
fn {{benchmark.name~}}
5160
(
5261
{{~#each benchmark.components as |c| ~}}
5362
{{~#if (not c.is_used)}}_{{/if}}{{c.name}}: u32, {{/each~}}
5463
) -> Weight {
5564
({{underscore benchmark.base_weight}} as Weight)
56-
{{#each benchmark.component_weight as |cw| ~}}
65+
{{~#each benchmark.component_weight as |cw|}}
5766
// Standard Error: {{underscore cw.error}}
5867
.saturating_add(({{underscore cw.slope}} as Weight).saturating_mul({{cw.name}} as Weight))
59-
{{/each}}
60-
{{~#if (ne benchmark.base_reads "0") ~}}
68+
{{~/each}}
69+
{{~#if (ne benchmark.base_reads "0")}}
6170
.saturating_add(T::DbWeight::get().reads({{benchmark.base_reads}} as Weight))
62-
{{/if}}
63-
{{~#each benchmark.component_reads as |cr| ~}}
71+
{{~/if}}
72+
{{~#each benchmark.component_reads as |cr|}}
6473
.saturating_add(T::DbWeight::get().reads(({{cr.slope}} as Weight).saturating_mul({{cr.name}} as Weight)))
65-
{{/each}}
66-
{{~#if (ne benchmark.base_writes "0") ~}}
74+
{{~/each}}
75+
{{~#if (ne benchmark.base_writes "0")}}
6776
.saturating_add(T::DbWeight::get().writes({{benchmark.base_writes}} as Weight))
68-
{{/if}}
69-
{{~#each benchmark.component_writes as |cw| ~}}
77+
{{~/if}}
78+
{{~#each benchmark.component_writes as |cw|}}
7079
.saturating_add(T::DbWeight::get().writes(({{cw.slope}} as Weight).saturating_mul({{cw.name}} as Weight)))
7180
{{~/each}}
7281
}
73-
{{/each}}
82+
{{~/each}}
7483
}
7584

7685
// For backwards compatibility and tests
7786
impl WeightInfo for () {
78-
{{#each benchmarks as |benchmark| ~}}
87+
{{~#each benchmarks as |benchmark|}}
88+
{{~#each benchmark.comments as |comment|}}
89+
// {{comment}}
90+
{{~/each}}
7991
fn {{benchmark.name~}}
8092
(
8193
{{~#each benchmark.components as |c| ~}}
8294
{{~#if (not c.is_used)}}_{{/if}}{{c.name}}: u32, {{/each~}}
8395
) -> Weight {
8496
({{underscore benchmark.base_weight}} as Weight)
85-
{{#each benchmark.component_weight as |cw| ~}}
97+
{{~#each benchmark.component_weight as |cw|}}
98+
// Standard Error: {{underscore cw.error}}
8699
.saturating_add(({{underscore cw.slope}} as Weight).saturating_mul({{cw.name}} as Weight))
87-
{{/each}}
88-
{{~#if (ne benchmark.base_reads "0") ~}}
100+
{{~/each}}
101+
{{~#if (ne benchmark.base_reads "0")}}
89102
.saturating_add(RocksDbWeight::get().reads({{benchmark.base_reads}} as Weight))
90-
{{/if}}
91-
{{~#each benchmark.component_reads as |cr| ~}}
103+
{{~/if}}
104+
{{~#each benchmark.component_reads as |cr|}}
92105
.saturating_add(RocksDbWeight::get().reads(({{cr.slope}} as Weight).saturating_mul({{cr.name}} as Weight)))
93-
{{/each}}
94-
{{~#if (ne benchmark.base_writes "0") ~}}
106+
{{~/each}}
107+
{{~#if (ne benchmark.base_writes "0")}}
95108
.saturating_add(RocksDbWeight::get().writes({{benchmark.base_writes}} as Weight))
96-
{{/if}}
97-
{{~#each benchmark.component_writes as |cw| ~}}
109+
{{~/if}}
110+
{{~#each benchmark.component_writes as |cw|}}
98111
.saturating_add(RocksDbWeight::get().writes(({{cw.slope}} as Weight).saturating_mul({{cw.name}} as Weight)))
99112
{{~/each}}
100113
}
101-
{{/each}}
114+
{{~/each}}
102115
}

0 commit comments

Comments
 (0)