Skip to content

Commit

Permalink
Merge rust-bitcoin#3742: Test all the valid denomination forms
Browse files Browse the repository at this point in the history
edfdd57 Test all the valid denomination forms (Tobin C. Harding)

Pull request description:

  Exhaustively ...

ACKs for top commit:
  apoelstra:
    ACK edfdd57; successfully ran local tests

Tree-SHA512: 76d078988b68f68cf8d4f18439b94cfef6b8b222596aa0b64e5270797c1d7d0f15b6376fb81d1655638e2617c33747d8a5623d3f52db0c95061723a3e36ce7de
  • Loading branch information
apoelstra committed Dec 13, 2024
2 parents 7977231 + edfdd57 commit c560a6e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions units/src/amount/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -920,10 +920,10 @@ fn checked_sum_amounts() {

#[test]
fn denomination_string_acceptable_forms() {
// Non-exhaustive list of valid forms.
// Exhaustive list of valid forms.
let valid = [
"BTC", "btc", "mBTC", "mbtc", "uBTC", "ubtc", "SATOSHI", "satoshi", "SATOSHIS", "satoshis",
"SAT", "sat", "SATS", "sats", "bit", "bits",
"BTC", "btc", "cBTC", "cbtc", "mBTC", "mbtc", "uBTC", "ubtc", "bit", "bits", "BIT", "BITS",
"SATOSHI", "satoshi", "SATOSHIS", "satoshis", "SAT", "sat", "SATS", "sats",
];
for denom in valid.iter() {
assert!(denom.parse::<Denomination>().is_ok());
Expand Down

0 comments on commit c560a6e

Please sign in to comment.