mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-04-28 03:00:18 -04:00
drk: replaced rest hardcoded balance base10 decimals with the const
This commit is contained in:
@@ -111,10 +111,10 @@ impl fmt::Display for DaoParams {
|
||||
"DAO Parameters",
|
||||
"==============",
|
||||
"Proposer limit",
|
||||
encode_base10(self.proposer_limit, 8),
|
||||
encode_base10(self.proposer_limit, BALANCE_BASE10_DECIMALS),
|
||||
self.proposer_limit,
|
||||
"Quorum",
|
||||
encode_base10(self.quorum, 8),
|
||||
encode_base10(self.quorum, BALANCE_BASE10_DECIMALS),
|
||||
self.quorum,
|
||||
"Approval ratio",
|
||||
self.approval_ratio_quot as f64 / self.approval_ratio_base as f64,
|
||||
|
||||
@@ -771,7 +771,11 @@ async fn realmain(args: Args, ex: Arc<smol::Executor<'static>>) -> Result<()> {
|
||||
coin.1,
|
||||
coin.0.note.token_id,
|
||||
aliases,
|
||||
format!("{} ({})", coin.0.note.value, encode_base10(coin.0.note.value, 8)),
|
||||
format!(
|
||||
"{} ({})",
|
||||
coin.0.note.value,
|
||||
encode_base10(coin.0.note.value, BALANCE_BASE10_DECIMALS)
|
||||
),
|
||||
spend_hook,
|
||||
user_data
|
||||
]);
|
||||
|
||||
@@ -41,7 +41,7 @@ use darkfi_sdk::{
|
||||
};
|
||||
use darkfi_serial::{deserialize, serialize, Encodable};
|
||||
|
||||
use crate::{error::WalletDbResult, Drk};
|
||||
use crate::{error::WalletDbResult, money::BALANCE_BASE10_DECIMALS, Drk};
|
||||
|
||||
impl Drk {
|
||||
/// Import a token mint authority into the wallet
|
||||
@@ -111,7 +111,7 @@ impl Drk {
|
||||
let spend_hook = pallas::Base::zero();
|
||||
let user_data = pallas::Base::zero();
|
||||
|
||||
let amount = decode_base10(amount, 8, false)?;
|
||||
let amount = decode_base10(amount, BALANCE_BASE10_DECIMALS, false)?;
|
||||
|
||||
let mut tokens = self.list_tokens().await?;
|
||||
tokens.retain(|x| x.0 == token_id);
|
||||
|
||||
Reference in New Issue
Block a user