Skip to content
This repository has been archived by the owner on Sep 22, 2022. It is now read-only.

Make primitives/currency to fit master #215

Open
wants to merge 1 commit into
base: feature/free-calls
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions primitives/src/currency.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use crate::Balance;

pub const UNITS: Balance = 100_000_000_000;
pub const DOLLARS: Balance = UNITS; // 100_000_000_000
pub const CENTS: Balance = DOLLARS / 100; // 1_000_000_000
pub const MILLICENTS: Balance = CENTS / 1_000; // 1_000_000
pub const UNITS: Balance = 10_000_000_000;
pub const DOLLARS: Balance = UNITS; // 10_000_000_000
pub const CENTS: Balance = DOLLARS / 100; // 100_000_000
pub const MILLICENTS: Balance = CENTS / 1_000; // 100_000

pub const fn deposit(items: u32, bytes: u32) -> Balance {
items as Balance * 15 * CENTS + (bytes as Balance) * 6 * CENTS
}
items as Balance * 20 * DOLLARS + (bytes as Balance) * 100 * MILLICENTS
}