Skip to content

Commit b3eb8fb

Browse files
Introduce BlockExecutionWeight and ExtrinsicBaseWeight (#5722)
* Introduce `BlockExectionWeight` and `ExtrinsicBaseWeight` * Add new traits everywhere * Missed one update * fix tests * Update `check_weight` logic * introduce `max_extrinsic_weight` function * fix + add tests * format nits * remove println * make test a bit more clear * Remove minimum weight * newlines left over from find/replace * Fix test, improve clarity * Fix executor tests * Extrinsic base weight same as old `MINIMUM_WEIGHT` * fix example test * Expose constants * Add test for full block with operational and normal * Initiate test environment with `BlockExecutionWeight` weight * format nit * Update frame/system/src/lib.rs Co-Authored-By: Kian Paimani <[email protected]> * Replace `TransactionBaseFee` with `ExtrinsicBaseWeight` (#5761) * Replace `TransactionBaseFee` with `ExtrinsicBaseFee` * Fix stuff * Fix and make tests better * Forgot to update this test * Fix priority number in test * Remove minimum weight from merge * Fix weight in contracts * remove `TransactionBaseFee` from contract tests * Let `register_extra_weight_unchecked` go past `MaximumBlockWeight` * address feedback Co-authored-by: Kian Paimani <[email protected]>
1 parent 934c5a5 commit b3eb8fb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub use crate::backend::{Account, Log, Vicinity, Backend};
2525

2626
use sp_std::{vec::Vec, marker::PhantomData};
2727
use frame_support::{ensure, decl_module, decl_storage, decl_event, decl_error};
28-
use frame_support::weights::{Weight, MINIMUM_WEIGHT, DispatchClass, FunctionOf, Pays};
28+
use frame_support::weights::{Weight, DispatchClass, FunctionOf, Pays};
2929
use frame_support::traits::{Currency, WithdrawReason, ExistenceRequirement, Get};
3030
use frame_system::{self as system, ensure_signed};
3131
use sp_runtime::ModuleId;
@@ -188,11 +188,11 @@ decl_module! {
188188
type Error = Error<T>;
189189

190190
fn deposit_event() = default;
191-
191+
192192
const ModuleId: ModuleId = T::ModuleId::get();
193193

194194
/// Deposit balance from currency/balances module into EVM.
195-
#[weight = MINIMUM_WEIGHT]
195+
#[weight = 0]
196196
fn deposit_balance(origin, value: BalanceOf<T>) {
197197
let sender = ensure_signed(origin)?;
198198

@@ -213,7 +213,7 @@ decl_module! {
213213
}
214214

215215
/// Withdraw balance from EVM into currency/balances module.
216-
#[weight = MINIMUM_WEIGHT]
216+
#[weight = 0]
217217
fn withdraw_balance(origin, value: BalanceOf<T>) {
218218
let sender = ensure_signed(origin)?;
219219
let address = T::ConvertAccountId::convert_account_id(&sender);

0 commit comments

Comments
 (0)