From 7796656eead42b60f40f795da3e128207b515db2 Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Fri, 8 May 2020 14:48:23 +0200 Subject: [PATCH] Update claims.rs --- runtime/common/src/claims.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/runtime/common/src/claims.rs b/runtime/common/src/claims.rs index 87b11fd0f5bc..729f72aded8f 100644 --- a/runtime/common/src/claims.rs +++ b/runtime/common/src/claims.rs @@ -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")] @@ -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 = 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)?; @@ -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 = 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, @@ -303,7 +305,7 @@ impl sp_runtime::traits::ValidateUnsigned for Module { match call { // - // Base Weight: 370 µs + // Base Weight: 184.9 µs // DB Weight: 1 Read (Claims) // Call::claim(account, ethereum_signature) => {