Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change currency units #901

Merged
merged 4 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ At the moment this project **does not** adhere to
- Move TSS mnemonic out of keystore [#853](https://github.com/entropyxyz/entropy-core/pull/853)
- Prepare test CLI for use in Programs repo ([#856](https://github.com/entropyxyz/entropy-core/pull/856))
- Replace timestamp with block number ([#866](https://github.com/entropyxyz/entropy-core/pull/866))
- Change currency units ([#901](https://github.com/entropyxyz/entropy-core/pull/901))

## [0.1.0](https://github.com/entropyxyz/entropy-core/compare/release/v0.0.12...release/v0.1.0) - 2024-05-20

Expand Down
Binary file modified crates/client/entropy_metadata.scale
Binary file not shown.
4 changes: 2 additions & 2 deletions crates/shared/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ lazy_static! {

pub const SIGNING_PARTY_SIZE: usize = 2;

// min balance 12 decimal chain = 0.1
pub const MIN_BALANCE: u128 = 10000000000;
// min balance 10 decimal chain = 1
pub const MIN_BALANCE: u128 = 10_000_000_000;

// 6 seconds a block this is one day
/// The amount of blocks before a tx request is pruned from the kvdb
Expand Down
2 changes: 2 additions & 0 deletions node/cli/src/chain_spec/dev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ pub fn development_config() -> ChainSpec {
.with_name("Development")
.with_id("dev")
.with_chain_type(ChainType::Development)
.with_properties(crate::chain_spec::entropy_properties())
.with_genesis_config_patch(development_genesis_config(
vec![
crate::chain_spec::authority_keys_from_seed("Alice"),
Expand All @@ -67,6 +68,7 @@ pub fn devnet_local_config() -> crate::chain_spec::ChainSpec {
ChainSpec::builder(wasm_binary_unwrap(), Default::default())
.with_name("Devnet Local")
.with_id("devnet_local")
.with_properties(crate::chain_spec::entropy_properties())
.with_chain_type(ChainType::Development)
.with_genesis_config_patch(development_genesis_config(
vec![
Expand Down
8 changes: 5 additions & 3 deletions runtime/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@
pub mod currency {
use crate::Balance;

pub const MILLICENTS: Balance = 1_000_000_000;
pub const CENTS: Balance = 1_000 * MILLICENTS; // assume this is worth about a cent.
pub const DOLLARS: Balance = 100 * CENTS;
pub const UNITS: Balance = 10_000_000_000;
pub const DOLLARS: Balance = UNITS; // 10_000_000_000
pub const GRAND: Balance = DOLLARS * 1_000; // 10_000_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
Expand Down