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
38
39
40
41
42
43
pub mod currency {
use primitives::TokenSymbol;
pub use primitives::{Balance, CurrencyId, CurrencyId::Token, DOT, IBTC, INTR};
pub const NATIVE_TOKEN_ID: TokenSymbol = INTR;
pub const NATIVE_CURRENCY_ID: CurrencyId = Token(NATIVE_TOKEN_ID);
pub const PARENT_CURRENCY_ID: CurrencyId = Token(DOT);
pub const WRAPPED_CURRENCY_ID: CurrencyId = Token(IBTC);
pub const UNITS: Balance = NATIVE_TOKEN_ID.one();
pub const DOLLARS: Balance = UNITS; pub const CENTS: Balance = DOLLARS / 100; pub const MILLICENTS: Balance = CENTS / 1_000; pub const fn deposit(items: u32, bytes: u32) -> Balance {
items as Balance * 20 * DOLLARS + (bytes as Balance) * 100 * MILLICENTS
}
}
pub mod time {
use btc_relay::TARGET_SPACING;
use primitives::{BlockNumber, Moment};
pub const MILLISECS_PER_BLOCK: u64 = 12000;
pub const SLOT_DURATION: Moment = MILLISECS_PER_BLOCK;
pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber);
pub const HOURS: BlockNumber = MINUTES * 60;
pub const DAYS: BlockNumber = HOURS * 24;
pub const WEEKS: BlockNumber = DAYS * 7;
pub const YEARS: BlockNumber = DAYS * 365;
pub const BITCOIN_SPACING_MS: u32 = TARGET_SPACING * 1000;
pub const BITCOIN_BLOCK_SPACING: BlockNumber = BITCOIN_SPACING_MS / MILLISECS_PER_BLOCK as BlockNumber;
}