File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -100,14 +100,14 @@ mod tests {
100100 fee:: WeightToFee ,
101101 } ;
102102 use crate :: weights:: ExtrinsicBaseWeight ;
103- use frame_support:: weights:: WeightToFeePolynomial ;
103+ use frame_support:: weights:: WeightToFee as WeightToFeeT ;
104104 use runtime_common:: MAXIMUM_BLOCK_WEIGHT ;
105105
106106 #[ test]
107107 // Test that the fee for `MAXIMUM_BLOCK_WEIGHT` of weight has sane bounds.
108108 fn full_block_fee_is_correct ( ) {
109109 // A full block should cost between 1,000 and 10,000 CENTS.
110- let full_block = WeightToFee :: calc ( & MAXIMUM_BLOCK_WEIGHT ) ;
110+ let full_block = WeightToFee :: weight_to_fee ( & MAXIMUM_BLOCK_WEIGHT ) ;
111111 assert ! ( full_block >= 1_000 * CENTS ) ;
112112 assert ! ( full_block <= 10_000 * CENTS ) ;
113113 }
@@ -117,7 +117,7 @@ mod tests {
117117 fn extrinsic_base_fee_is_correct ( ) {
118118 // `ExtrinsicBaseWeight` should cost 1/10 of a CENT
119119 println ! ( "Base: {}" , ExtrinsicBaseWeight :: get( ) ) ;
120- let x = WeightToFee :: calc ( & ExtrinsicBaseWeight :: get ( ) ) ;
120+ let x = WeightToFee :: weight_to_fee ( & ExtrinsicBaseWeight :: get ( ) ) ;
121121 let y = CENTS / 10 ;
122122 assert ! ( x. max( y) - x. min( y) < MILLICENTS ) ;
123123 }
Original file line number Diff line number Diff line change 1717//! Tests for the Kusama Runtime Configuration
1818
1919use crate :: * ;
20- use frame_support:: weights:: { GetDispatchInfo , WeightToFeePolynomial } ;
20+ use frame_support:: weights:: { GetDispatchInfo , WeightToFee as WeightToFeeT } ;
2121use keyring:: Sr25519Keyring :: Charlie ;
2222use pallet_transaction_payment:: Multiplier ;
2323use parity_scale_codec:: Encode ;
@@ -68,7 +68,7 @@ fn payout_weight_portion() {
6868#[ ignore]
6969fn block_cost ( ) {
7070 let max_block_weight = BlockWeights :: get ( ) . max_block ;
71- let raw_fee = WeightToFee :: calc ( & max_block_weight) ;
71+ let raw_fee = WeightToFee :: weight_to_fee ( & max_block_weight) ;
7272
7373 println ! (
7474 "Full Block weight == {} // WeightToFee(full_block) == {} plank" ,
Original file line number Diff line number Diff line change @@ -102,14 +102,14 @@ mod tests {
102102 fee:: WeightToFee ,
103103 } ;
104104 use crate :: weights:: ExtrinsicBaseWeight ;
105- use frame_support:: weights:: WeightToFeePolynomial ;
105+ use frame_support:: weights:: WeightToFee as WeightToFeeT ;
106106 use runtime_common:: MAXIMUM_BLOCK_WEIGHT ;
107107
108108 #[ test]
109109 // Test that the fee for `MAXIMUM_BLOCK_WEIGHT` of weight has sane bounds.
110110 fn full_block_fee_is_correct ( ) {
111111 // A full block should cost between 10 and 100 DOLLARS.
112- let full_block = WeightToFee :: calc ( & MAXIMUM_BLOCK_WEIGHT ) ;
112+ let full_block = WeightToFee :: weight_to_fee ( & MAXIMUM_BLOCK_WEIGHT ) ;
113113 assert ! ( full_block >= 10 * DOLLARS ) ;
114114 assert ! ( full_block <= 100 * DOLLARS ) ;
115115 }
@@ -119,7 +119,7 @@ mod tests {
119119 fn extrinsic_base_fee_is_correct ( ) {
120120 // `ExtrinsicBaseWeight` should cost 1/10 of a CENT
121121 println ! ( "Base: {}" , ExtrinsicBaseWeight :: get( ) ) ;
122- let x = WeightToFee :: calc ( & ExtrinsicBaseWeight :: get ( ) ) ;
122+ let x = WeightToFee :: weight_to_fee ( & ExtrinsicBaseWeight :: get ( ) ) ;
123123 let y = CENTS / 10 ;
124124 assert ! ( x. max( y) - x. min( y) < MILLICENTS ) ;
125125 }
Original file line number Diff line number Diff line change @@ -2009,7 +2009,7 @@ sp_api::impl_runtime_apis! {
20092009#[ cfg( test) ]
20102010mod test_fees {
20112011 use super :: * ;
2012- use frame_support:: weights:: { GetDispatchInfo , WeightToFeePolynomial } ;
2012+ use frame_support:: weights:: { GetDispatchInfo , WeightToFee as WeightToFeeT } ;
20132013 use keyring:: Sr25519Keyring :: Charlie ;
20142014 use pallet_transaction_payment:: Multiplier ;
20152015 use runtime_common:: MinimumMultiplier ;
@@ -2038,7 +2038,7 @@ mod test_fees {
20382038 #[ ignore]
20392039 fn block_cost ( ) {
20402040 let max_block_weight = BlockWeights :: get ( ) . max_block ;
2041- let raw_fee = WeightToFee :: calc ( & max_block_weight) ;
2041+ let raw_fee = WeightToFee :: weight_to_fee ( & max_block_weight) ;
20422042
20432043 println ! (
20442044 "Full Block weight == {} // WeightToFee(full_block) == {} plank" ,
Original file line number Diff line number Diff line change @@ -100,14 +100,14 @@ mod tests {
100100 fee:: WeightToFee ,
101101 } ;
102102 use crate :: weights:: ExtrinsicBaseWeight ;
103- use frame_support:: weights:: WeightToFeePolynomial ;
103+ use frame_support:: weights:: WeightToFee as WeightToFeeT ;
104104 use runtime_common:: MAXIMUM_BLOCK_WEIGHT ;
105105
106106 #[ test]
107107 // Test that the fee for `MAXIMUM_BLOCK_WEIGHT` of weight has sane bounds.
108108 fn full_block_fee_is_correct ( ) {
109109 // A full block should cost between 10 and 100 DOLLARS.
110- let full_block = WeightToFee :: calc ( & MAXIMUM_BLOCK_WEIGHT ) ;
110+ let full_block = WeightToFee :: weight_to_fee ( & MAXIMUM_BLOCK_WEIGHT ) ;
111111 assert ! ( full_block >= 10 * DOLLARS ) ;
112112 assert ! ( full_block <= 100 * DOLLARS ) ;
113113 }
@@ -117,7 +117,7 @@ mod tests {
117117 fn extrinsic_base_fee_is_correct ( ) {
118118 // `ExtrinsicBaseWeight` should cost 1/10 of a CENT
119119 println ! ( "Base: {}" , ExtrinsicBaseWeight :: get( ) ) ;
120- let x = WeightToFee :: calc ( & ExtrinsicBaseWeight :: get ( ) ) ;
120+ let x = WeightToFee :: weight_to_fee ( & ExtrinsicBaseWeight :: get ( ) ) ;
121121 let y = CENTS / 10 ;
122122 assert ! ( x. max( y) - x. min( y) < MILLICENTS ) ;
123123 }
Original file line number Diff line number Diff line change @@ -100,14 +100,14 @@ mod tests {
100100 fee:: WeightToFee ,
101101 } ;
102102 use crate :: weights:: ExtrinsicBaseWeight ;
103- use frame_support:: weights:: WeightToFeePolynomial ;
103+ use frame_support:: weights:: WeightToFee as WeightToFeeT ;
104104 use runtime_common:: MAXIMUM_BLOCK_WEIGHT ;
105105
106106 #[ test]
107107 // Test that the fee for `MAXIMUM_BLOCK_WEIGHT` of weight has sane bounds.
108108 fn full_block_fee_is_correct ( ) {
109109 // A full block should cost between 10 and 100 UNITS.
110- let full_block = WeightToFee :: calc ( & MAXIMUM_BLOCK_WEIGHT ) ;
110+ let full_block = WeightToFee :: weight_to_fee ( & MAXIMUM_BLOCK_WEIGHT ) ;
111111 assert ! ( full_block >= 10 * UNITS ) ;
112112 assert ! ( full_block <= 100 * UNITS ) ;
113113 }
@@ -117,7 +117,7 @@ mod tests {
117117 fn extrinsic_base_fee_is_correct ( ) {
118118 // `ExtrinsicBaseWeight` should cost 1/10 of a CENT
119119 println ! ( "Base: {}" , ExtrinsicBaseWeight :: get( ) ) ;
120- let x = WeightToFee :: calc ( & ExtrinsicBaseWeight :: get ( ) ) ;
120+ let x = WeightToFee :: weight_to_fee ( & ExtrinsicBaseWeight :: get ( ) ) ;
121121 let y = CENTS / 10 ;
122122 assert ! ( x. max( y) - x. min( y) < MILLICENTS ) ;
123123 }
You can’t perform that action at this time.
0 commit comments