Use from_int_btc function for const context
This commit is contained in:
parent
f93e67977a
commit
9f7449b572
|
@ -49,7 +49,7 @@ const UTXO_1: P2trUtxo = P2trUtxo {
|
||||||
script_pubkey: UTXO_SCRIPT_PUBKEY,
|
script_pubkey: UTXO_SCRIPT_PUBKEY,
|
||||||
pubkey: UTXO_PUBKEY,
|
pubkey: UTXO_PUBKEY,
|
||||||
master_fingerprint: UTXO_MASTER_FINGERPRINT,
|
master_fingerprint: UTXO_MASTER_FINGERPRINT,
|
||||||
amount_in_sats: Amount::from_sat(50 * 100_000_000), // 50 BTC
|
amount_in_sats: Amount::from_int_btc(50),
|
||||||
derivation_path: BIP86_DERIVATION_PATH,
|
derivation_path: BIP86_DERIVATION_PATH,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ const UTXO_2: P2trUtxo = P2trUtxo {
|
||||||
script_pubkey: UTXO_SCRIPT_PUBKEY,
|
script_pubkey: UTXO_SCRIPT_PUBKEY,
|
||||||
pubkey: UTXO_PUBKEY,
|
pubkey: UTXO_PUBKEY,
|
||||||
master_fingerprint: UTXO_MASTER_FINGERPRINT,
|
master_fingerprint: UTXO_MASTER_FINGERPRINT,
|
||||||
amount_in_sats: Amount::from_sat(50 * 100_000_000), // 50 BTC
|
amount_in_sats: Amount::from_int_btc(50),
|
||||||
derivation_path: BIP86_DERIVATION_PATH,
|
derivation_path: BIP86_DERIVATION_PATH,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ const UTXO_3: P2trUtxo = P2trUtxo {
|
||||||
script_pubkey: UTXO_SCRIPT_PUBKEY,
|
script_pubkey: UTXO_SCRIPT_PUBKEY,
|
||||||
pubkey: UTXO_PUBKEY,
|
pubkey: UTXO_PUBKEY,
|
||||||
master_fingerprint: UTXO_MASTER_FINGERPRINT,
|
master_fingerprint: UTXO_MASTER_FINGERPRINT,
|
||||||
amount_in_sats: Amount::from_sat(50 * 100_000_000), // 50 BTC
|
amount_in_sats: Amount::from_int_btc(50),
|
||||||
derivation_path: BIP86_DERIVATION_PATH,
|
derivation_path: BIP86_DERIVATION_PATH,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -502,9 +502,9 @@ impl Amount {
|
||||||
/// Exactly one satoshi.
|
/// Exactly one satoshi.
|
||||||
pub const ONE_SAT: Amount = Amount(1);
|
pub const ONE_SAT: Amount = Amount(1);
|
||||||
/// Exactly one bitcoin.
|
/// Exactly one bitcoin.
|
||||||
pub const ONE_BTC: Amount = Amount(100_000_000);
|
pub const ONE_BTC: Amount = Self::from_int_btc(1);
|
||||||
/// The maximum value allowed as an amount. Useful for sanity checking.
|
/// The maximum value allowed as an amount. Useful for sanity checking.
|
||||||
pub const MAX_MONEY: Amount = Amount(21_000_000 * 100_000_000);
|
pub const MAX_MONEY: Amount = Self::from_int_btc(21_000_000);
|
||||||
/// The minimum value of an amount.
|
/// The minimum value of an amount.
|
||||||
pub const MIN: Amount = Amount::ZERO;
|
pub const MIN: Amount = Amount::ZERO;
|
||||||
/// The maximum value of an amount.
|
/// The maximum value of an amount.
|
||||||
|
|
Loading…
Reference in New Issue