Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ jobs:
benchmark:
docker:
- image: debian:stable
resource_class: small
resource_class: large
environment:
- VERBOSE: "1"
steps:
Expand Down Expand Up @@ -492,6 +492,7 @@ jobs:
- VERBOSE: "1"
- RUSTFLAGS: -D warnings
- RUST_BACKTRACE: "1"
- WAIT_FOR_FINALIZE: "1"
steps:
- checkout
- attach_workspace:
Expand All @@ -512,21 +513,21 @@ jobs:
working_directory: ./integration
- run:
name: Run polymesh-api integration tests against the previous version.
command: cargo nextest run --features previous_release --locked
command: cargo nextest run --release --no-default-features --features previous_release --locked
working_directory: ./integration
no_output_timeout: 30m
- run:
name: Upgrade chain to current version.
command: cargo run --features previous_release --locked --bin tools -- upgrade_chain ../assets/ci-runtime/polymesh_runtime_develop.compact.compressed.wasm
command: cargo run --no-default-features --features previous_release --locked --bin tools -- upgrade_chain ../assets/ci-runtime/polymesh_runtime_develop.compact.compressed.wasm
working_directory: ./integration
no_output_timeout: 30m
- run:
name: Clear polymesh-api to force re-compile (chain metadata might have changed).
command: cargo clean -p polymesh-api
command: cargo clean -p polymesh-api && cargo clean --release -p polymesh-api
working_directory: ./integration
- run:
name: Run polymesh-api integration tests against the upgraded chain.
command: cargo nextest run --features current_release --locked
command: cargo nextest run --release --features current_release --locked
working_directory: ./integration
no_output_timeout: 30m
integration-test:
Expand All @@ -547,6 +548,9 @@ jobs:
--wasm-execution compiled \
--pool-limit 100000
background: true
- run:
name: Wait for chain build the genesis config and start producing blocks
command: sleep 15
- run:
name: install and build integration tests
command: yarn install && yarn build:types && yarn build
Expand Down
56 changes: 56 additions & 0 deletions .maintain/crate-weight-template.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// This file is part of the Polymesh distribution (https://github.com/PolymeshAssociation/Polymesh).
// Copyright (c) 2023 Polymesh

//! Autogenerated weights for {{pallet}}
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION {{version}}
//! DATE: {{date}}, STEPS: `{{cmd.steps}}`, REPEAT: {{cmd.repeat}}, LOW RANGE: `{{cmd.lowest_range_values}}`, HIGH RANGE: `{{cmd.highest_range_values}}`
//! EXECUTION: {{cmd.execution}}, WASM-EXECUTION: {{cmd.wasm_execution}}, CHAIN: {{cmd.chain}}, DB CACHE: {{cmd.db_cache}}
//! HOSTNAME: `{{hostname}}`, CPU: `{{cpuname}}`

// Executed Command:
{{#each args as |arg|~}}
// {{arg}}
{{/each}}

#![allow(unused_parens)]
#![allow(unused_imports)]

use polymesh_primitives::{RocksDbWeight as DbWeight, Weight};

/// Weights for {{pallet}} using the Substrate node and recommended hardware.
pub struct SubstrateWeight;
impl crate::WeightInfo for SubstrateWeight {
{{#each benchmarks as |benchmark|}}
{{#each benchmark.comments as |comment|}}
// {{comment}}
{{/each}}
{{#each benchmark.component_ranges as |range|}}
/// The range of component `{{range.name}}` is `[{{range.min}}, {{range.max}}]`.
{{/each}}
fn {{benchmark.name~}}
(
{{~#each benchmark.components as |c| ~}}
{{~#if (not c.is_used)}}_{{/if}}{{c.name}}: u32, {{/each~}}
) -> Weight {
// Minimum execution time: {{underscore benchmark.min_execution_time}} nanoseconds.
Weight::from_parts({{underscore benchmark.base_weight}}, 0)
{{#each benchmark.component_weight as |cw|}}
// Standard Error: {{underscore cw.error}}
.saturating_add(Weight::from_parts({{underscore cw.slope}}, 0).saturating_mul({{cw.name}}.into()))
{{/each}}
{{#if (ne benchmark.base_reads "0")}}
.saturating_add(DbWeight::get().reads({{benchmark.base_reads}}))
{{/if}}
{{#each benchmark.component_reads as |cr|}}
.saturating_add(DbWeight::get().reads(({{cr.slope}}_u64).saturating_mul({{cr.name}}.into())))
{{/each}}
{{#if (ne benchmark.base_writes "0")}}
.saturating_add(DbWeight::get().writes({{benchmark.base_writes}}))
{{/if}}
{{#each benchmark.component_writes as |cw|}}
.saturating_add(DbWeight::get().writes(({{cw.slope}}_u64).saturating_mul({{cw.name}}.into())))
{{/each}}
}
{{/each}}
}
18 changes: 2 additions & 16 deletions .maintain/frame-weight-template.hbs
Original file line number Diff line number Diff line change
@@ -1,19 +1,5 @@
// This file is part of Substrate.

// Copyright (C) 2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// This file is part of the Polymesh distribution (https://github.com/PolymeshAssociation/Polymesh).
// Copyright (c) 2023 Polymesh

//! Autogenerated weights for {{pallet}}
//!
Expand Down
Loading