@@ -13,17 +13,17 @@ use static_assertions::const_assert;
13
13
use sp_api:: impl_runtime_apis;
14
14
use sp_consensus_aura:: sr25519:: AuthorityId as AuraId ;
15
15
use sp_core:: { crypto:: KeyTypeId , OpaqueMetadata } ;
16
- use sp_runtime:: traits:: {
17
- BlakeTwo256 , Block as BlockT , DispatchInfoOf , IdentityLookup , NumberFor , Saturating ,
18
- SignedExtension ,
19
- } ;
20
16
use sp_runtime:: {
21
17
create_runtime_str, generic, impl_opaque_keys,
18
+ traits:: {
19
+ BlakeTwo256 , Block as BlockT , DispatchInfoOf , IdentityLookup , NumberFor , Saturating ,
20
+ SignedExtension ,
21
+ } ,
22
22
transaction_validity:: {
23
23
InvalidTransaction , TransactionSource , TransactionValidity , TransactionValidityError ,
24
24
ValidTransaction ,
25
25
} ,
26
- ApplyExtrinsicResult ,
26
+ ApplyExtrinsicResult , FixedPointNumber , Perbill , Permill , Perquintill ,
27
27
} ;
28
28
use sp_std:: { collections:: btree_map:: BTreeMap , prelude:: * } ;
29
29
#[ cfg( feature = "std" ) ]
@@ -32,7 +32,7 @@ use sp_version::RuntimeVersion;
32
32
33
33
#[ cfg( any( feature = "std" , test) ) ]
34
34
pub use sp_runtime:: BuildStorage ;
35
- pub use sp_runtime :: { Perbill , Permill } ;
35
+
36
36
// A few exports that help ease life for downstream crates.
37
37
pub use frame_support:: {
38
38
construct_runtime, parameter_types,
@@ -65,6 +65,7 @@ pub use xpallet_bridge_bitcoin::{
65
65
pub use xpallet_contracts:: Schedule as ContractsSchedule ;
66
66
pub use xpallet_contracts_primitives:: XRC20Selector ;
67
67
pub use xpallet_protocol:: * ;
68
+ pub use xpallet_transaction_payment:: { Multiplier , TargetedFeeAdjustment } ;
68
69
69
70
impl_opaque_keys ! {
70
71
pub struct SessionKeys {
@@ -300,13 +301,17 @@ impl xpallet_contracts::Trait for Runtime {
300
301
}
301
302
302
303
parameter_types ! {
303
- pub const TransactionByteFee : Balance = 1 ;
304
+ pub const TransactionByteFee : Balance = 1 ; // TODO change in future
305
+ pub const TargetBlockFullness : Perquintill = Perquintill :: from_percent( 25 ) ;
306
+ pub AdjustmentVariable : Multiplier = Multiplier :: saturating_from_rational( 1 , 100_000 ) ;
307
+ pub MinimumMultiplier : Multiplier = Multiplier :: saturating_from_rational( 1 , 1_000_000_000u128 ) ;
304
308
}
305
309
306
310
impl xpallet_transaction_payment:: Trait for Runtime {
307
311
type TransactionByteFee = TransactionByteFee ;
308
312
type WeightToFee = IdentityFee < Balance > ;
309
- type FeeMultiplierUpdate = ( ) ;
313
+ type FeeMultiplierUpdate =
314
+ TargetedFeeAdjustment < Self , TargetBlockFullness , AdjustmentVariable , MinimumMultiplier > ;
310
315
}
311
316
312
317
construct_runtime ! (
0 commit comments