1919#![ cfg_attr( not( feature = "std" ) , no_std) ]
2020#![ recursion_limit = "256" ]
2121
22- use authority_discovery_primitives:: { AuthorityId as EncodedAuthorityId , Signature as EncodedSignature } ;
23- use babe_primitives:: { AuthorityId as BabeId , AuthoritySignature as BabeSignature } ;
24- pub use balances:: Call as BalancesCall ;
25- use codec:: { Decode , Encode } ;
22+ /// Constant values used within the runtime.
23+ pub mod constants;
24+ /// Implementations of some helper traits passed into runtime modules as associated types.
25+ pub mod impls;
26+
2627pub use contracts:: Gas ;
27- use sr_api :: impl_runtime_apis ;
28+ pub use timestamp :: Call as TimestampCall ;
2829
29- //use grandpa::fg_primitives;
30- //use grandpa::{AuthorityId as GrandpaId, AuthorityWeight as GrandpaWeight};
31- //use im_online::sr25519::AuthorityId as ImOnlineId;
30+ pub use balances:: Call as BalancesCall ;
31+ pub use staking:: StakerStatus ;
3232
33+ use authority_discovery_primitives:: { AuthorityId as EncodedAuthorityId , Signature as EncodedSignature } ;
34+ use babe_primitives:: { AuthorityId as BabeId , AuthoritySignature as BabeSignature } ;
35+ use codec:: { Decode , Encode } ;
36+ use grandpa:: { fg_primitives, AuthorityList as GrandpaAuthorityList } ;
37+ use im_online:: sr25519:: AuthorityId as ImOnlineId ;
3338use node_primitives:: { AccountId , AccountIndex , Balance , BlockNumber , Hash , Index , Moment , Signature } ;
3439use rstd:: prelude:: * ;
35- use sr_primitives:: traits:: {
36- self , BlakeTwo256 , Block as BlockT , NumberFor , OpaqueKeys , SaturatedConversion , StaticLookup ,
40+ use sr_api:: impl_runtime_apis;
41+ use sr_primitives:: {
42+ create_runtime_str, generic, impl_opaque_keys,
43+ traits:: { self , BlakeTwo256 , Block as BlockT , NumberFor , OpaqueKeys , SaturatedConversion , StaticLookup } ,
44+ transaction_validity:: TransactionValidity ,
45+ weights:: Weight ,
46+ ApplyResult , Perbill ,
3747} ;
38- use sr_primitives:: transaction_validity:: TransactionValidity ;
39- use sr_primitives:: weights:: Weight ;
40- #[ cfg( any( feature = "std" , test) ) ]
41- pub use sr_primitives:: BuildStorage ;
42-
43- use sr_primitives:: { create_runtime_str, generic, impl_opaque_keys, ApplyResult , Perbill } ;
4448use substrate_primitives:: u32_trait:: { _1, _4} ;
45-
46- use support:: traits:: OnUnbalanced ;
47- pub use support:: StorageValue ;
49+ use substrate_primitives:: OpaqueMetadata ;
4850use support:: {
4951 construct_runtime, parameter_types,
50- traits:: { Currency , Randomness , SplitTwoWays } ,
52+ traits:: { Currency , OnUnbalanced , Randomness , SplitTwoWays } ,
5153} ;
52-
53- pub use timestamp :: Call as TimestampCall ;
54+ use system :: offchain :: TransactionSubmitter ;
55+ use transaction_payment_rpc_runtime_api :: RuntimeDispatchInfo ;
5456#[ cfg( any( feature = "std" , test) ) ]
5557use version:: NativeVersion ;
5658use version:: RuntimeVersion ;
59+ //use grandpa::fg_primitives;
60+ //use grandpa::{AuthorityId as GrandpaId, AuthorityWeight as GrandpaWeight};
61+ //use im_online::sr25519::AuthorityId as ImOnlineId;
5762
58- use grandpa:: fg_primitives;
59- use grandpa:: AuthorityList as GrandpaAuthorityList ;
60- use im_online:: sr25519:: AuthorityId as ImOnlineId ;
61- use substrate_primitives:: OpaqueMetadata ;
62- use system:: offchain:: TransactionSubmitter ;
63- use transaction_payment_rpc_runtime_api:: RuntimeDispatchInfo ;
64-
63+ use constants:: { currency:: * , time:: * } ;
6564use darwinia_support:: TimeStamp ;
66- use staking:: EraIndex ;
67- pub use staking:: StakerStatus ;
68-
69- /// Implementations of some helper traits passed into runtime modules as associated types.
70- pub mod impls;
7165use impls:: { Author , CurrencyToVoteHandler , LinearWeightToFee , TargetedFeeAdjustment } ;
72-
73- /// Constant values used within the runtime.
74- pub mod constants;
75- use constants:: time:: * ;
66+ use staking:: EraIndex ;
7667
7768// Make the WASM binary available.
7869#[ cfg( feature = "std" ) ]
@@ -96,12 +87,15 @@ pub fn native_version() -> NativeVersion {
9687 }
9788}
9889
99- pub const NANO : Balance = 1 ;
100- pub const MICRO : Balance = 1_000 * NANO ;
101- pub const MILLI : Balance = 1_000 * MICRO ;
102- pub const COIN : Balance = 1_000 * MILLI ;
103-
10490type NegativeImbalance = <Balances as Currency < AccountId > >:: NegativeImbalance ;
91+ type DealWithFees = SplitTwoWays <
92+ Balance ,
93+ NegativeImbalance ,
94+ _4 ,
95+ MockTreasury , // 4 parts (80%) goes to the treasury.
96+ _1 ,
97+ Author , // 1 part (20%) goes to the block author.
98+ > ;
10599
106100//pub struct Author;
107101//
@@ -118,20 +112,6 @@ impl OnUnbalanced<NegativeImbalance> for MockTreasury {
118112 }
119113}
120114
121- pub type DealWithFees = SplitTwoWays <
122- Balance ,
123- NegativeImbalance ,
124- _4 ,
125- MockTreasury , // 4 parts (80%) goes to the treasury.
126- _1 ,
127- Author , // 1 part (20%) goes to the block author.
128- > ;
129-
130- pub const SECS_PER_BLOCK : BlockNumber = 6 ;
131- pub const MINUTES : BlockNumber = 60 / SECS_PER_BLOCK ;
132- pub const HOURS : BlockNumber = MINUTES * 60 ;
133- pub const DAYS : BlockNumber = HOURS * 24 ;
134-
135115parameter_types ! {
136116 pub const BlockHashCount : BlockNumber = 250 ;
137117 pub const MaximumBlockWeight : Weight = 1_000_000_000 ;
@@ -171,8 +151,8 @@ impl indices::Trait for Runtime {
171151
172152parameter_types ! {
173153 pub const ExistentialDeposit : Balance = 1 * COIN ;
174- pub const TransferFee : Balance = 1 * MILLI ;
175- pub const CreationFee : Balance = 1 * MILLI ;
154+ pub const TransferFee : Balance = 1 * MICRO ;
155+ pub const CreationFee : Balance = 1 * MICRO ;
176156}
177157impl balances:: Trait for Runtime {
178158 type Balance = Balance ;
@@ -187,7 +167,7 @@ impl balances::Trait for Runtime {
187167}
188168
189169parameter_types ! {
190- pub const TransactionBaseFee : Balance = 1 * MILLI ;
170+ pub const TransactionBaseFee : Balance = 1 * MICRO ;
191171 pub const TransactionByteFee : Balance = 10 * MICRO ;
192172 // setting this to zero will disable the weight fee.
193173 pub const WeightFeeCoefficient : Balance = 1_000 ;
@@ -309,11 +289,11 @@ impl finality_tracker::Trait for Runtime {
309289}
310290
311291parameter_types ! {
312- pub const ContractTransferFee : Balance = 1 * MILLI ;
313- pub const ContractCreationFee : Balance = 1 * MILLI ;
314- pub const ContractTransactionBaseFee : Balance = 1 * MILLI ;
292+ pub const ContractTransferFee : Balance = 1 * MICRO ;
293+ pub const ContractCreationFee : Balance = 1 * MICRO ;
294+ pub const ContractTransactionBaseFee : Balance = 1 * MICRO ;
315295 pub const ContractTransactionByteFee : Balance = 10 * MICRO ;
316- pub const ContractFee : Balance = 1 * MILLI ;
296+ pub const ContractFee : Balance = 1 * MICRO ;
317297 pub const TombstoneDeposit : Balance = 1 * COIN ;
318298 pub const RentByteFee : Balance = 1 * COIN ;
319299 pub const RentDepositOffset : Balance = 1000 * COIN ;
0 commit comments