Skip to content

Commit

Permalink
fix: remove redundant UNIT definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
peterwht authored and evilrobot-01 committed Feb 24, 2024
1 parent f8fca97 commit a2e77bd
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions runtime/src/contracts_config.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::{
Balance, Balances, BalancesCall, Perbill, Runtime, RuntimeCall,
RuntimeEvent, RuntimeHoldReason, Timestamp,
Balance, Balances, BalancesCall, MILLIUNIT, Perbill, Runtime, RuntimeCall,
RuntimeEvent, RuntimeHoldReason, Timestamp, UNIT
};
use frame_support::{
parameter_types,
Expand All @@ -16,10 +16,6 @@ impl frame_support::traits::Contains<RuntimeCall> for AllowBalancesCall {
}
}

// Unit = the base number of indivisible units for balances
const UNIT: Balance = 1_000_000_000_000;
const MILLIUNIT: Balance = 1_000_000_000;

const fn deposit(items: u32, bytes: u32) -> Balance {
(items as Balance * UNIT + (bytes as Balance) * (5 * MILLIUNIT / 100)) / 10
}
Expand Down

0 comments on commit a2e77bd

Please sign in to comment.