Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Update to latest Claims weight #1079

Closed
wants to merge 1 commit into from
Closed
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
12 changes: 7 additions & 5 deletions runtime/common/src/claims.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ use sp_std::prelude::*;
use sp_io::{hashing::keccak_256, crypto::secp256k1_ecdsa_recover};
use frame_support::{decl_event, decl_storage, decl_module, decl_error};
use frame_support::traits::{Currency, Get, VestingSchedule};
use frame_support::weights::constants::WEIGHT_PER_MICROS;
use system::{ensure_root, ensure_none};
use codec::{Encode, Decode};
#[cfg(feature = "std")]
Expand Down Expand Up @@ -183,12 +184,13 @@ decl_module! {
///
/// Total Complexity: O(1)
/// ----------------------------
/// Base Weight: 622.6 µs
/// Base Weight: 279.4 µs
/// + Validate Unsigned Weight (184.9 µs)
/// DB Weight:
/// - Read: Claims, Total, Claims Vesting, Vesting Vesting, Balance Lock, Account
/// - Write: Vesting Vesting, Account, Balance Lock, Total, Claim, Claims Vesting
/// </weight>
#[weight = T::DbWeight::get().reads_writes(6, 6) + 650_000_000]
#[weight = T::DbWeight::get().reads_writes(6, 6) + (280 + 200) * WEIGHT_PER_MICROS]
fn claim(origin, dest: T::AccountId, ethereum_signature: EcdsaSignature) {
ensure_none(origin)?;

Expand Down Expand Up @@ -235,12 +237,12 @@ decl_module! {
///
/// Total Complexity: O(1)
/// ---------------------
/// Base Weight: 25.64 µs
/// Base Weight: 9.954 µs
/// DB Weight:
/// - Reads: Total
/// - Writes: Total, Claims, Vesting
/// </weight>
#[weight = T::DbWeight::get().reads_writes(1, 3) + 25_000_000]
#[weight = T::DbWeight::get().reads_writes(1, 3) + 10 * WEIGHT_PER_MICROS]
fn mint_claim(origin,
who: EthereumAddress,
value: BalanceOf<T>,
Expand Down Expand Up @@ -303,7 +305,7 @@ impl<T: Trait> sp_runtime::traits::ValidateUnsigned for Module<T> {

match call {
// <weight>
// Base Weight: 370 µs
// Base Weight: 184.9 µs
// DB Weight: 1 Read (Claims)
// </weight>
Call::claim(account, ethereum_signature) => {
Expand Down