1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
//! Autogenerated weights for pallet_xdns
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0
//! DATE: 2021-09-19, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128

// Executed Command:
// ./target/release/circuit
// benchmark
// --chain
// dev
// --execution
// wasm
// --wasm-execution
// compiled
// --pallet
// pallet_xdns
// --extrinsic
// *
// --steps
// 50
// --repeat
// 20
// --raw
// --template=../benchmarking/frame-weight-template.hbs
// --output
// .

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

use frame_support::{
    traits::Get,
    weights::{constants::RocksDbWeight, Weight},
};
use sp_std::marker::PhantomData;

/// Weight functions needed for pallet_xdns.
pub trait WeightInfo {
    fn register_gateway() -> Weight;
    fn set_owner() -> Weight;
    fn set_operational() -> Weight;
    fn submit_headers() -> Weight;
}

/// Weights for pallet_xdns using the Substrate node and recommended hardware.
pub struct SubstrateWeight<T>(PhantomData<T>);

impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
    fn register_gateway() -> Weight {
        Weight::from_parts(72_795_000_u64, 0u64)
            .saturating_add(T::DbWeight::get().reads(2_u64))
            .saturating_add(T::DbWeight::get().writes(1_u64))
    }

    fn set_owner() -> Weight {
        Weight::from_parts(73_255_000_u64, 0u64)
            .saturating_add(T::DbWeight::get().reads(1_u64))
            .saturating_add(T::DbWeight::get().writes(1_u64))
    }

    fn set_operational() -> Weight {
        Weight::from_parts(58_912_000_u64, 0u64)
            .saturating_add(T::DbWeight::get().reads(1_u64))
            .saturating_add(T::DbWeight::get().writes(1_u64))
    }

    fn submit_headers() -> Weight {
        Weight::from_parts(25_265_000_u64, 0u64).saturating_add(T::DbWeight::get().reads(1_u64))
    }
}

// For backwards compatibility and tests
impl WeightInfo for () {
    fn register_gateway() -> Weight {
        Weight::from_parts(72_795_000_u64, 0u64)
            .saturating_add(RocksDbWeight::get().reads(2_u64))
            .saturating_add(RocksDbWeight::get().writes(1_u64))
    }

    fn set_owner() -> Weight {
        Weight::from_parts(73_255_000_u64, 0u64)
            .saturating_add(RocksDbWeight::get().reads(1_u64))
            .saturating_add(RocksDbWeight::get().writes(1_u64))
    }

    fn set_operational() -> Weight {
        Weight::from_parts(58_912_000_u64, 0u64)
            .saturating_add(RocksDbWeight::get().reads(1_u64))
            .saturating_add(RocksDbWeight::get().writes(1_u64))
    }

    fn submit_headers() -> Weight {
        Weight::from_parts(25_265_000_u64, 0u64).saturating_add(RocksDbWeight::get().reads(1_u64))
    }
}