-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathlib.rs
More file actions
37 lines (28 loc) · 1.39 KB
/
Copy pathlib.rs
File metadata and controls
37 lines (28 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#![cfg_attr(not(feature = "std"), no_std)]
pub mod currency {
use bp_core::Balance;
pub const SUPPLY_FACTOR: Balance = 1;
pub const UNITS: Balance = 1_000_000_000_000_000_000;
pub const BFC: Balance = UNITS; // 1_000_000_000_000_000_000
pub const MILLIBFC: Balance = BFC / 1_000; // 1_000_000_000_000_000
pub const MICROBFC: Balance = BFC / 1_000_000; // 1_000_000_000_000
pub const WEI: Balance = 1;
pub const GWEI: Balance = WEI * 1_000_000_000; // 1_000_000_000
pub const TRANSACTION_BYTE_FEE: Balance = 10 * SUPPLY_FACTOR * MICROBFC;
pub const STORAGE_BYTE_FEE: Balance = 1 * SUPPLY_FACTOR * MILLIBFC;
}
pub mod time {
use bp_core::BlockNumber;
/// This determines the average expected block time that we are targeting.
/// Blocks will be produced at a minimum duration defined by `SLOT_DURATION`.
/// `SLOT_DURATION` is picked up by `pallet_timestamp` which is in turn picked
/// up by `pallet_aura` to implement `fn slot_duration()`.
pub const MILLISECS_PER_BLOCK: u64 = 500;
/// Currently it is not possible to change the slot duration after the chain has started.
/// Attempting to do so will brick block production.
pub const SLOT_DURATION: u64 = MILLISECS_PER_BLOCK;
/// Time is measured by number of blocks.
pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber);
pub const HOURS: BlockNumber = 60 * MINUTES;
pub const DAYS: BlockNumber = 24 * HOURS;
}