@@ -30,7 +30,7 @@ use frame_support::{
30
30
storage,
31
31
} ;
32
32
use sp_core:: H256 ;
33
- use sp_runtime:: { Perbill , traits:: { BlakeTwo256 , IdentityLookup } , testing:: Header } ;
33
+ use sp_runtime:: { traits:: { BlakeTwo256 , IdentityLookup } , testing:: Header } ;
34
34
use crate as utility;
35
35
36
36
// example module to test behaviors.
@@ -93,12 +93,14 @@ impl_outer_dispatch! {
93
93
pub struct Test ;
94
94
parameter_types ! {
95
95
pub const BlockHashCount : u64 = 250 ;
96
- pub const MaximumBlockWeight : Weight = Weight :: max_value( ) ;
97
- pub const MaximumBlockLength : u32 = 2 * 1024 ;
98
- pub const AvailableBlockRatio : Perbill = Perbill :: one( ) ;
96
+ pub BlockWeights : frame_system:: limits:: BlockWeights =
97
+ frame_system:: limits:: BlockWeights :: simple_max( Weight :: max_value( ) ) ;
99
98
}
100
99
impl frame_system:: Config for Test {
101
100
type BaseCallFilter = TestBaseCallFilter ;
101
+ type BlockWeights = BlockWeights ;
102
+ type BlockLength = ( ) ;
103
+ type DbWeight = ( ) ;
102
104
type Origin = Origin ;
103
105
type Index = u64 ;
104
106
type BlockNumber = u64 ;
@@ -110,13 +112,6 @@ impl frame_system::Config for Test {
110
112
type Header = Header ;
111
113
type Event = TestEvent ;
112
114
type BlockHashCount = BlockHashCount ;
113
- type MaximumBlockWeight = MaximumBlockWeight ;
114
- type DbWeight = ( ) ;
115
- type BlockExecutionWeight = ( ) ;
116
- type ExtrinsicBaseWeight = ( ) ;
117
- type MaximumExtrinsicWeight = MaximumBlockWeight ;
118
- type MaximumBlockLength = MaximumBlockLength ;
119
- type AvailableBlockRatio = AvailableBlockRatio ;
120
115
type Version = ( ) ;
121
116
type PalletInfo = ( ) ;
122
117
type AccountData = pallet_balances:: AccountData < u64 > ;
@@ -350,6 +345,7 @@ fn batch_early_exit_works() {
350
345
351
346
#[ test]
352
347
fn batch_weight_calculation_doesnt_overflow ( ) {
348
+ use sp_runtime:: Perbill ;
353
349
new_test_ext ( ) . execute_with ( || {
354
350
let big_call = Call :: System ( SystemCall :: fill_block ( Perbill :: from_percent ( 50 ) ) ) ;
355
351
assert_eq ! ( big_call. get_dispatch_info( ) . weight, Weight :: max_value( ) / 2 ) ;
0 commit comments