This repository was archived by the owner on Mar 13, 2023. It is now read-only.
File tree 2 files changed +4
-13
lines changed
bin/node/runtime/pangolin/src/pallets
2 files changed +4
-13
lines changed Original file line number Diff line number Diff line change @@ -72,24 +72,14 @@ where
72
72
}
73
73
}
74
74
75
- pub struct DarwiniaGasWeightMapping ;
76
- impl GasWeightMapping for DarwiniaGasWeightMapping {
77
- fn gas_to_weight ( gas : u64 ) -> Weight {
78
- gas * 1_000 as Weight
79
- }
80
- fn weight_to_gas ( weight : Weight ) -> u64 {
81
- weight / 1_000
82
- }
83
- }
84
-
85
75
frame_support:: parameter_types! {
86
76
pub const ChainId : u64 = 43 ;
87
77
pub BlockGasLimit : U256 = u32 :: max_value( ) . into( ) ;
88
78
}
89
79
90
80
impl Config for Runtime {
91
81
type FeeCalculator = dvm_dynamic_fee:: Pallet < Self > ;
92
- type GasWeightMapping = DarwiniaGasWeightMapping ;
82
+ type GasWeightMapping = ( ) ;
93
83
type CallOrigin = EnsureAddressTruncated < Self :: AccountId > ;
94
84
type AddressMapping = ConcatAddressMapping < Self :: AccountId > ;
95
85
type FindAuthor = EthereumFindAuthor < Babe > ;
Original file line number Diff line number Diff line change @@ -448,12 +448,13 @@ pub trait GasWeightMapping {
448
448
fn gas_to_weight ( gas : u64 ) -> Weight ;
449
449
fn weight_to_gas ( weight : Weight ) -> u64 ;
450
450
}
451
+ // The radio of gas to weight comes from benchmark test
451
452
impl GasWeightMapping for ( ) {
452
453
fn gas_to_weight ( gas : u64 ) -> Weight {
453
- gas as Weight
454
+ gas * 16_000 as Weight
454
455
}
455
456
fn weight_to_gas ( weight : Weight ) -> u64 {
456
- weight
457
+ weight / 16_000
457
458
}
458
459
}
459
460
You can’t perform that action at this time.
0 commit comments