Skip to content

Commit

Permalink
Merge branch 'master' into dn-reply-data
Browse files Browse the repository at this point in the history
  • Loading branch information
breathx committed Jul 19, 2022
2 parents 93e5202 + 0e26161 commit bbbc634
Show file tree
Hide file tree
Showing 7 changed files with 836 additions and 749 deletions.
32 changes: 32 additions & 0 deletions .maintain/gear-weight-template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ use sp_std::marker::PhantomData;

/// Weight functions needed for {{pallet}}.
pub trait WeightInfo {
fn allocation_cost() -> Weight;
fn grow_cost() -> Weight;
fn initial_cost() -> Weight;
fn load_cost() -> Weight;
{{#each benchmarks as |benchmark|}}
fn {{benchmark.name~}}
(
Expand All @@ -51,6 +55,20 @@ impl<T: crate::Config> WeightInfo for GearWeight<T> {
{{else}}
impl<T: frame_system::Config> WeightInfo for GearWeight<T> {
{{/if}}
fn allocation_cost() -> Weight {
// To be changed with the proper value.
T::DbWeight::get().writes(1 as Weight)
}
fn grow_cost() -> Weight {
// To be changed with the proper value.
T::DbWeight::get().writes(1 as Weight)
}
fn initial_cost() -> Weight {
T::DbWeight::get().writes(1 as Weight)
}
fn load_cost() -> Weight {
T::DbWeight::get().reads(1 as Weight)
}
{{#each benchmarks as |benchmark|}}
fn {{benchmark.name~}}
(
Expand Down Expand Up @@ -80,6 +98,20 @@ impl<T: frame_system::Config> WeightInfo for GearWeight<T> {

// For backwards compatibility and tests
impl WeightInfo for () {
fn allocation_cost() -> Weight {
// To be changed with the proper value.
RocksDbWeight::get().writes(1 as Weight)
}
fn grow_cost() -> Weight {
// To be changed with the proper value.
RocksDbWeight::get().writes(1 as Weight)
}
fn initial_cost() -> Weight {
RocksDbWeight::get().writes(1 as Weight)
}
fn load_cost() -> Weight {
RocksDbWeight::get().reads(1 as Weight)
}
{{#each benchmarks as |benchmark|}}
fn {{benchmark.name~}}
(
Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gear-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ derive_more = "0.99"
env_logger = "0.9"
colored = "2.0.0"
regex = "^1.6"
serde_yaml = "0.8.25"
serde_yaml = "0.8.26"
hex = "0.4.2"
serde = { version = "*", features = ["derive"] }
serde_json = "*"
Expand Down
Loading

0 comments on commit bbbc634

Please sign in to comment.