From e0086e52d4a32d53a87dce284c5a88800b4ce5cc Mon Sep 17 00:00:00 2001 From: "linfeng.yuan" Date: Thu, 12 Sep 2024 15:53:20 +0800 Subject: [PATCH] fix cargo clippy --- src/epoch.rs | 2 +- src/height.rs | 2 +- src/index.rs | 4 +- src/runes.rs | 472 +++++++++++++++++++-------------------- src/runes/pile.rs | 4 +- src/runes/rune.rs | 8 +- src/runes/runestone.rs | 54 ++--- src/runes/varint.rs | 2 +- src/subcommand/server.rs | 32 +-- src/templates/rune.rs | 4 +- 10 files changed, 292 insertions(+), 292 deletions(-) diff --git a/src/epoch.rs b/src/epoch.rs index d8157897d8..9a96fc97dd 100644 --- a/src/epoch.rs +++ b/src/epoch.rs @@ -225,7 +225,7 @@ mod tests { assert_eq!(Epoch::from(Sat(1)), 0); assert_eq!(Epoch::from(Epoch(1).starting_sat()), 1); assert_eq!(Epoch::from(Epoch(1).starting_sat() + 1), 1); - assert_eq!(Epoch::from(Sat(u64::max_value())), 33); + assert_eq!(Epoch::from(Sat(u64::MAX)), 33); } #[test] diff --git a/src/height.rs b/src/height.rs index e96a66f8f4..b3a58529b1 100644 --- a/src/height.rs +++ b/src/height.rs @@ -106,7 +106,7 @@ mod tests { u64::from(SUBSIDY_HALVING_INTERVAL) * 5000000000 + 2500000000 ); assert_eq!( - Height(u32::max_value()).starting_sat(), + Height(u32::MAX).starting_sat(), *Epoch::STARTING_SATS.last().unwrap() ); } diff --git a/src/index.rs b/src/index.rs index 62c95e333a..d40d11ac6f 100644 --- a/src/index.rs +++ b/src/index.rs @@ -1215,7 +1215,7 @@ impl Index { }; self - .get_children_by_sequence_number_paginated(sequence_number, usize::max_value(), 0) + .get_children_by_sequence_number_paginated(sequence_number, usize::MAX, 0) .map(|(children, _more)| children) } @@ -4538,7 +4538,7 @@ mod tests { i, if i == 1 { 0 } else { 1 }, 0, - inscription("text/plain;charset=utf-8", &format!("hello {}", i)).to_witness(), + inscription("text/plain;charset=utf-8", format!("hello {}", i)).to_witness(), )], // for the first inscription use coinbase, otherwise use the previous tx ..Default::default() }); diff --git a/src/runes.rs b/src/runes.rs index ccc88be8bb..e8d1d8bbb8 100644 --- a/src/runes.rs +++ b/src/runes.rs @@ -44,7 +44,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -134,7 +134,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -161,12 +161,12 @@ mod tests { RuneEntry { etching: txid, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, )], - [(OutPoint { txid, vout: 0 }, vec![(id, u128::max_value())])], + [(OutPoint { txid, vout: 0 }, vec![(id, u128::MAX)])], ); } @@ -188,7 +188,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -218,7 +218,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -245,12 +245,12 @@ mod tests { RuneEntry { etching: txid, rune: Rune(block_two_minimum), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, )], - [(OutPoint { txid, vout: 0 }, vec![(id, u128::max_value())])], + [(OutPoint { txid, vout: 0 }, vec![(id, u128::MAX)])], ); } } @@ -268,7 +268,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -298,7 +298,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -325,12 +325,12 @@ mod tests { RuneEntry { etching: txid, rune: Rune(RESERVED - 1), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, )], - [(OutPoint { txid, vout: 0 }, vec![(id, u128::max_value())])], + [(OutPoint { txid, vout: 0 }, vec![(id, u128::MAX)])], ); } } @@ -348,7 +348,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -375,7 +375,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RESERVED), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -385,7 +385,7 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id0, u128::max_value())], + vec![(id0, u128::MAX)], )], ); @@ -397,7 +397,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -425,7 +425,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RESERVED), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -435,7 +435,7 @@ mod tests { RuneEntry { etching: txid1, rune: Rune(RESERVED + 1), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 4, number: 1, ..Default::default() @@ -448,14 +448,14 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id0, u128::max_value())], + vec![(id0, u128::MAX)], ), ( OutPoint { txid: txid1, vout: 0, }, - vec![(id1, u128::max_value())], + vec![(id1, u128::MAX)], ), ], ); @@ -473,7 +473,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -502,12 +502,12 @@ mod tests { rune: Rune(RUNE), etching: txid, divisibility: 1, - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, )], - [(OutPoint { txid, vout: 0 }, vec![(id, u128::max_value())])], + [(OutPoint { txid, vout: 0 }, vec![(id, u128::MAX)])], ); } @@ -524,12 +524,12 @@ mod tests { edicts: vec![ Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }, Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }, ], @@ -557,12 +557,12 @@ mod tests { RuneEntry { etching: txid, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, )], - [(OutPoint { txid, vout: 0 }, vec![(id, u128::max_value())])], + [(OutPoint { txid, vout: 0 }, vec![(id, u128::MAX)])], ); } @@ -579,12 +579,12 @@ mod tests { edicts: vec![ Edict { id: 0, - amount: u128::max_value() / 2, + amount: u128::MAX / 2, output: 0, }, Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }, ], @@ -612,13 +612,13 @@ mod tests { RuneEntry { etching: txid, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, symbol: None, timestamp: 2, ..Default::default() }, )], - [(OutPoint { txid, vout: 0 }, vec![(id, u128::max_value())])], + [(OutPoint { txid, vout: 0 }, vec![(id, u128::MAX)])], ); } @@ -793,7 +793,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -820,7 +820,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -830,7 +830,7 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id, u128::max_value())], + vec![(id, u128::MAX)], )], ); @@ -840,7 +840,7 @@ mod tests { Runestone { edicts: vec![Edict { id: id.into(), - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], ..Default::default() @@ -858,7 +858,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -868,7 +868,7 @@ mod tests { txid: txid1, vout: 0, }, - vec![(id, u128::max_value())], + vec![(id, u128::MAX)], )], ); } @@ -885,7 +885,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -933,7 +933,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -995,7 +995,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching::default()), @@ -1040,7 +1040,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -1067,7 +1067,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -1077,7 +1077,7 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id, u128::max_value())], + vec![(id, u128::MAX)], )], ); @@ -1099,10 +1099,10 @@ mod tests { [( id, RuneEntry { - burned: u128::max_value(), + burned: u128::MAX, etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -1123,7 +1123,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -1150,7 +1150,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -1160,7 +1160,7 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id, u128::max_value())], + vec![(id, u128::MAX)], )], ); @@ -1178,7 +1178,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -1188,7 +1188,7 @@ mod tests { txid: txid1, vout: 0, }, - vec![(id, u128::max_value())], + vec![(id, u128::MAX)], )], ); } @@ -1205,7 +1205,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -1232,7 +1232,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -1242,7 +1242,7 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id, u128::max_value())], + vec![(id, u128::MAX)], )], ); @@ -1261,9 +1261,9 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, - burned: u128::max_value(), + burned: u128::MAX, ..Default::default() }, )], @@ -1283,7 +1283,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -1310,7 +1310,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -1320,7 +1320,7 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id, u128::max_value())], + vec![(id, u128::MAX)], )], ); @@ -1345,7 +1345,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -1355,7 +1355,7 @@ mod tests { txid: txid1, vout: 1, }, - vec![(id, u128::max_value())], + vec![(id, u128::MAX)], )], ); } @@ -1372,7 +1372,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -1399,7 +1399,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -1409,7 +1409,7 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id, u128::max_value())], + vec![(id, u128::MAX)], )], ); @@ -1434,7 +1434,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -1444,7 +1444,7 @@ mod tests { txid: txid1, vout: 0, }, - vec![(id, u128::max_value())], + vec![(id, u128::MAX)], )], ); } @@ -1461,7 +1461,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -1488,7 +1488,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -1498,7 +1498,7 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id, u128::max_value())], + vec![(id, u128::MAX)], )], ); @@ -1523,8 +1523,8 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), - burned: u128::max_value(), + supply: u128::MAX, + burned: u128::MAX, timestamp: 2, ..Default::default() }, @@ -1546,7 +1546,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -1573,7 +1573,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -1583,7 +1583,7 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id, u128::max_value())], + vec![(id, u128::MAX)], )], ); @@ -1601,7 +1601,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -1611,7 +1611,7 @@ mod tests { txid: txid1, vout: 0, }, - vec![(id, u128::max_value())], + vec![(id, u128::MAX)], )], ); } @@ -1628,7 +1628,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -1655,12 +1655,12 @@ mod tests { RuneEntry { etching: txid, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, )], - [(OutPoint { txid, vout: 0 }, vec![(id, u128::max_value())])], + [(OutPoint { txid, vout: 0 }, vec![(id, u128::MAX)])], ); context.rpc_server.broadcast_tx(TransactionTemplate { @@ -1669,7 +1669,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -1691,12 +1691,12 @@ mod tests { RuneEntry { etching: txid, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, )], - [(OutPoint { txid, vout: 0 }, vec![(id, u128::max_value())])], + [(OutPoint { txid, vout: 0 }, vec![(id, u128::MAX)])], ); } @@ -1712,7 +1712,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -1739,7 +1739,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -1749,7 +1749,7 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id0, u128::max_value())], + vec![(id0, u128::MAX)], )], ); @@ -1759,7 +1759,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -1787,7 +1787,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -1797,7 +1797,7 @@ mod tests { RuneEntry { etching: txid1, rune: Rune(RUNE + 1), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 3, number: 1, ..Default::default() @@ -1810,14 +1810,14 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id0, u128::max_value())], + vec![(id0, u128::MAX)], ), ( OutPoint { txid: txid1, vout: 0, }, - vec![(id1, u128::max_value())], + vec![(id1, u128::MAX)], ), ], ); @@ -1836,7 +1836,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -1846,7 +1846,7 @@ mod tests { RuneEntry { etching: txid1, rune: Rune(RUNE + 1), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 3, number: 1, ..Default::default() @@ -1858,7 +1858,7 @@ mod tests { txid: txid2, vout: 0, }, - vec![(id0, u128::max_value()), (id1, u128::max_value())], + vec![(id0, u128::MAX), (id1, u128::MAX)], )], ); } @@ -1875,7 +1875,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -1902,7 +1902,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -1912,7 +1912,7 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id0, u128::max_value())], + vec![(id0, u128::MAX)], )], ); @@ -1922,7 +1922,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -1950,7 +1950,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -1960,7 +1960,7 @@ mod tests { RuneEntry { etching: txid1, rune: Rune(RUNE + 1), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 3, number: 1, ..Default::default() @@ -1973,14 +1973,14 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id0, u128::max_value())], + vec![(id0, u128::MAX)], ), ( OutPoint { txid: txid1, vout: 0, }, - vec![(id1, u128::max_value())], + vec![(id1, u128::MAX)], ), ], ); @@ -1999,7 +1999,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -2009,7 +2009,7 @@ mod tests { RuneEntry { etching: txid1, rune: Rune(RUNE + 1), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 3, number: 1, ..Default::default() @@ -2021,7 +2021,7 @@ mod tests { txid: txid2, vout: 0, }, - vec![(id0, u128::max_value()), (id1, u128::max_value())], + vec![(id0, u128::MAX), (id1, u128::MAX)], )], ); @@ -2033,12 +2033,12 @@ mod tests { edicts: vec![ Edict { id: id0.into(), - amount: u128::max_value() / 2, + amount: u128::MAX / 2, output: 1, }, Edict { id: id1.into(), - amount: u128::max_value() / 2, + amount: u128::MAX / 2, output: 1, }, ], @@ -2058,7 +2058,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -2068,7 +2068,7 @@ mod tests { RuneEntry { etching: txid1, rune: Rune(RUNE + 1), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 3, number: 1, ..Default::default() @@ -2082,8 +2082,8 @@ mod tests { vout: 0, }, vec![ - (id0, u128::max_value() / 2 + 1), - (id1, u128::max_value() / 2 + 1), + (id0, u128::MAX / 2 + 1), + (id1, u128::MAX / 2 + 1), ], ), ( @@ -2091,7 +2091,7 @@ mod tests { txid: txid3, vout: 1, }, - vec![(id0, u128::max_value() / 2), (id1, u128::max_value() / 2)], + vec![(id0, u128::MAX / 2), (id1, u128::MAX / 2)], ), ], ); @@ -2109,7 +2109,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -2136,7 +2136,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -2146,7 +2146,7 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id0, u128::max_value())], + vec![(id0, u128::MAX)], )], ); @@ -2156,7 +2156,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -2184,7 +2184,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -2194,7 +2194,7 @@ mod tests { RuneEntry { etching: txid1, rune: Rune(RUNE + 1), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 3, number: 1, ..Default::default() @@ -2207,14 +2207,14 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id0, u128::max_value())], + vec![(id0, u128::MAX)], ), ( OutPoint { txid: txid1, vout: 0, }, - vec![(id1, u128::max_value())], + vec![(id1, u128::MAX)], ), ], ); @@ -2226,12 +2226,12 @@ mod tests { edicts: vec![ Edict { id: id0.into(), - amount: u128::max_value(), + amount: u128::MAX, output: 0, }, Edict { id: id1.into(), - amount: u128::max_value(), + amount: u128::MAX, output: 0, }, ], @@ -2251,7 +2251,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -2261,7 +2261,7 @@ mod tests { RuneEntry { etching: txid1, rune: Rune(RUNE + 1), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 3, number: 1, ..Default::default() @@ -2273,7 +2273,7 @@ mod tests { txid: txid2, vout: 0, }, - vec![(id0, u128::max_value()), (id1, u128::max_value())], + vec![(id0, u128::MAX), (id1, u128::MAX)], )], ); } @@ -2291,7 +2291,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -2318,7 +2318,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -2328,7 +2328,7 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id, u128::max_value())], + vec![(id, u128::MAX)], )], ); @@ -2351,12 +2351,12 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, )], - [(OutPoint { txid, vout: 1 }, vec![(id, u128::max_value())])], + [(OutPoint { txid, vout: 1 }, vec![(id, u128::MAX)])], ); } @@ -2372,7 +2372,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -2397,7 +2397,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -2425,7 +2425,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 3, ..Default::default() }, @@ -2435,7 +2435,7 @@ mod tests { RuneEntry { etching: txid1, rune: Rune(RUNE + 1), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 3, number: 1, ..Default::default() @@ -2448,14 +2448,14 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id0, u128::max_value())], + vec![(id0, u128::MAX)], ), ( OutPoint { txid: txid1, vout: 0, }, - vec![(id1, u128::max_value())], + vec![(id1, u128::MAX)], ), ], ); @@ -2473,7 +2473,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -2500,7 +2500,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -2510,7 +2510,7 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id, u128::max_value())], + vec![(id, u128::MAX)], )], ); @@ -2526,7 +2526,7 @@ mod tests { }, Edict { id: id.into(), - amount: u128::max_value(), + amount: u128::MAX, output: 0, }, ], @@ -2545,7 +2545,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -2555,7 +2555,7 @@ mod tests { txid: txid1, vout: 0, }, - vec![(id, u128::max_value())], + vec![(id, u128::MAX)], )], ); } @@ -2572,7 +2572,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -2599,7 +2599,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -2609,7 +2609,7 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id0, u128::max_value())], + vec![(id0, u128::MAX)], )], ); @@ -2619,7 +2619,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -2647,7 +2647,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -2657,7 +2657,7 @@ mod tests { RuneEntry { etching: txid1, rune: Rune(RUNE + 1), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 3, number: 1, ..Default::default() @@ -2670,14 +2670,14 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id0, u128::max_value())], + vec![(id0, u128::MAX)], ), ( OutPoint { txid: txid1, vout: 0, }, - vec![(id1, u128::max_value())], + vec![(id1, u128::MAX)], ), ], ); @@ -2689,12 +2689,12 @@ mod tests { edicts: vec![ Edict { id: id0.into(), - amount: u128::max_value(), + amount: u128::MAX, output: 0, }, Edict { id: id1.into(), - amount: u128::max_value(), + amount: u128::MAX, output: 0, }, ], @@ -2714,7 +2714,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -2724,7 +2724,7 @@ mod tests { RuneEntry { etching: txid1, rune: Rune(RUNE + 1), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 3, number: 1, ..Default::default() @@ -2737,14 +2737,14 @@ mod tests { txid: txid1, vout: 0, }, - vec![(id1, u128::max_value())], + vec![(id1, u128::MAX)], ), ( OutPoint { txid: txid2, vout: 0, }, - vec![(id0, u128::max_value())], + vec![(id0, u128::MAX)], ), ], ); @@ -2762,7 +2762,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value() / 2, + amount: u128::MAX / 2, output: 0, }], etching: Some(Etching { @@ -2789,7 +2789,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value() / 2, + supply: u128::MAX / 2, timestamp: 2, ..Default::default() }, @@ -2799,7 +2799,7 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id, u128::max_value() / 2)], + vec![(id, u128::MAX / 2)], )], ); @@ -2809,7 +2809,7 @@ mod tests { Runestone { edicts: vec![Edict { id: id.into(), - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], ..Default::default() @@ -2827,7 +2827,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value() / 2, + supply: u128::MAX / 2, timestamp: 2, ..Default::default() }, @@ -2837,7 +2837,7 @@ mod tests { txid: txid1, vout: 0, }, - vec![(id, u128::max_value() / 2)], + vec![(id, u128::MAX / 2)], )], ); } @@ -2854,7 +2854,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 1, }], etching: Some(Etching { @@ -2879,10 +2879,10 @@ mod tests { [( id, RuneEntry { - burned: u128::max_value(), + burned: u128::MAX, etching: txid, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -2904,7 +2904,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -2931,12 +2931,12 @@ mod tests { RuneEntry { etching: txid, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, )], - [(OutPoint { txid, vout: 0 }, vec![(id, u128::max_value())])], + [(OutPoint { txid, vout: 0 }, vec![(id, u128::MAX)])], ); } @@ -2954,7 +2954,7 @@ mod tests { edicts: vec![ Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }, Edict { @@ -2987,12 +2987,12 @@ mod tests { RuneEntry { etching: txid, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, )], - [(OutPoint { txid, vout: 0 }, vec![(id, u128::max_value())])], + [(OutPoint { txid, vout: 0 }, vec![(id, u128::MAX)])], ); } @@ -3036,7 +3036,7 @@ mod tests { RuneEntry { etching: txid, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -3044,19 +3044,19 @@ mod tests { [ ( OutPoint { txid, vout: 0 }, - vec![(id, u128::max_value() / 4 + 1)], + vec![(id, u128::MAX / 4 + 1)], ), ( OutPoint { txid, vout: 1 }, - vec![(id, u128::max_value() / 4 + 1)], + vec![(id, u128::MAX / 4 + 1)], ), ( OutPoint { txid, vout: 2 }, - vec![(id, u128::max_value() / 4 + 1)], + vec![(id, u128::MAX / 4 + 1)], ), ( OutPoint { txid, vout: 3 }, - vec![(id, u128::max_value() / 4)], + vec![(id, u128::MAX / 4)], ), ], ); @@ -3109,7 +3109,7 @@ mod tests { RuneEntry { etching: txid, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -3117,19 +3117,19 @@ mod tests { [ ( OutPoint { txid, vout: 0 }, - vec![(id, 1000 + (u128::max_value() - 1000) / 4 + 1)], + vec![(id, 1000 + (u128::MAX - 1000) / 4 + 1)], ), ( OutPoint { txid, vout: 1 }, - vec![(id, (u128::max_value() - 1000) / 4 + 1)], + vec![(id, (u128::MAX - 1000) / 4 + 1)], ), ( OutPoint { txid, vout: 2 }, - vec![(id, (u128::max_value() - 1000) / 4 + 1)], + vec![(id, (u128::MAX - 1000) / 4 + 1)], ), ( OutPoint { txid, vout: 3 }, - vec![(id, (u128::max_value() - 1000) / 4)], + vec![(id, (u128::MAX - 1000) / 4)], ), ], ); @@ -3182,7 +3182,7 @@ mod tests { RuneEntry { etching: txid, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -3190,19 +3190,19 @@ mod tests { [ ( OutPoint { txid, vout: 0 }, - vec![(id, u128::max_value() / 4 + 1)], + vec![(id, u128::MAX / 4 + 1)], ), ( OutPoint { txid, vout: 1 }, - vec![(id, u128::max_value() / 4 + 1)], + vec![(id, u128::MAX / 4 + 1)], ), ( OutPoint { txid, vout: 2 }, - vec![(id, u128::max_value() / 4 + 1)], + vec![(id, u128::MAX / 4 + 1)], ), ( OutPoint { txid, vout: 3 }, - vec![(id, u128::max_value() / 4)], + vec![(id, u128::MAX / 4)], ), ], ); @@ -3276,7 +3276,7 @@ mod tests { edicts: vec![ Edict { id: 0, - amount: u128::max_value() - 3000, + amount: u128::MAX - 3000, output: 0, }, Edict { @@ -3309,7 +3309,7 @@ mod tests { RuneEntry { etching: txid, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -3317,7 +3317,7 @@ mod tests { [ ( OutPoint { txid, vout: 0 }, - vec![(id, u128::max_value() - 2000)], + vec![(id, u128::MAX - 2000)], ), (OutPoint { txid, vout: 1 }, vec![(id, 1000)]), (OutPoint { txid, vout: 2 }, vec![(id, 1000)]), @@ -3344,7 +3344,7 @@ mod tests { }, Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }, ], @@ -3372,7 +3372,7 @@ mod tests { RuneEntry { etching: txid, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -3380,7 +3380,7 @@ mod tests { [ ( OutPoint { txid, vout: 0 }, - vec![(id, u128::max_value() - 4000 + 1000)], + vec![(id, u128::MAX - 4000 + 1000)], ), (OutPoint { txid, vout: 1 }, vec![(id, 1000)]), (OutPoint { txid, vout: 2 }, vec![(id, 1000)]), @@ -3401,7 +3401,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -3428,7 +3428,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -3438,7 +3438,7 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id, u128::max_value())], + vec![(id, u128::MAX)], )], ); @@ -3467,7 +3467,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -3478,14 +3478,14 @@ mod tests { txid: txid1, vout: 0, }, - vec![(id, u128::max_value() / 2 + 1)], + vec![(id, u128::MAX / 2 + 1)], ), ( OutPoint { txid: txid1, vout: 1, }, - vec![(id, u128::max_value() / 2)], + vec![(id, u128::MAX / 2)], ), ], ); @@ -3503,7 +3503,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -3530,7 +3530,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -3540,7 +3540,7 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id, u128::max_value())], + vec![(id, u128::MAX)], )], ); @@ -3576,7 +3576,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -3587,14 +3587,14 @@ mod tests { txid: txid1, vout: 0, }, - vec![(id, 1000 + (u128::max_value() - 1000) / 2 + 1)], + vec![(id, 1000 + (u128::MAX - 1000) / 2 + 1)], ), ( OutPoint { txid: txid1, vout: 1, }, - vec![(id, (u128::max_value() - 1000) / 2)], + vec![(id, (u128::MAX - 1000) / 2)], ), ], ); @@ -3612,7 +3612,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -3639,7 +3639,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -3649,7 +3649,7 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id, u128::max_value())], + vec![(id, u128::MAX)], )], ); @@ -3685,7 +3685,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -3696,14 +3696,14 @@ mod tests { txid: txid1, vout: 0, }, - vec![(id, u128::max_value() / 2 + 1)], + vec![(id, u128::MAX / 2 + 1)], ), ( OutPoint { txid: txid1, vout: 1, }, - vec![(id, u128::max_value() / 2)], + vec![(id, u128::MAX / 2)], ), ], ); @@ -3721,7 +3721,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -3748,7 +3748,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -3758,7 +3758,7 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id, u128::max_value())], + vec![(id, u128::MAX)], )], ); @@ -3787,7 +3787,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -3798,7 +3798,7 @@ mod tests { txid: txid1, vout: 0, }, - vec![(id, u128::max_value() - 1000)], + vec![(id, u128::MAX - 1000)], ), ( OutPoint { @@ -3823,7 +3823,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -3850,7 +3850,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -3860,7 +3860,7 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id, u128::max_value())], + vec![(id, u128::MAX)], )], ); @@ -3872,7 +3872,7 @@ mod tests { edicts: vec![ Edict { id: id.into(), - amount: u128::max_value() - 2000, + amount: u128::MAX - 2000, output: 0, }, Edict { @@ -3896,7 +3896,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -3907,7 +3907,7 @@ mod tests { txid: txid1, vout: 0, }, - vec![(id, u128::max_value() - 2000 + 1000)], + vec![(id, u128::MAX - 2000 + 1000)], ), ( OutPoint { @@ -3932,7 +3932,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -3959,7 +3959,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -3969,7 +3969,7 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id, u128::max_value())], + vec![(id, u128::MAX)], )], ); @@ -3986,7 +3986,7 @@ mod tests { }, Edict { id: id.into(), - amount: u128::max_value(), + amount: u128::MAX, output: 0, }, ], @@ -4005,7 +4005,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -4016,7 +4016,7 @@ mod tests { txid: txid1, vout: 0, }, - vec![(id, u128::max_value() - 4000 + 1000)], + vec![(id, u128::MAX - 4000 + 1000)], ), ( OutPoint { @@ -4055,7 +4055,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -4083,13 +4083,13 @@ mod tests { RuneEntry { etching: txid, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, symbol: Some('$'), timestamp: 2, ..Default::default() }, )], - [(OutPoint { txid, vout: 0 }, vec![(id, u128::max_value())])], + [(OutPoint { txid, vout: 0 }, vec![(id, u128::MAX)])], ); } @@ -4132,12 +4132,12 @@ mod tests { RuneEntry { etching: txid, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, )], - [(OutPoint { txid, vout: 0 }, vec![(id, u128::max_value())])], + [(OutPoint { txid, vout: 0 }, vec![(id, u128::MAX)])], ); } @@ -4153,7 +4153,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -4180,7 +4180,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -4190,7 +4190,7 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id, u128::max_value())], + vec![(id, u128::MAX)], )], ); @@ -4219,7 +4219,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -4229,7 +4229,7 @@ mod tests { txid: txid1, vout: 1, }, - vec![(id, u128::max_value())], + vec![(id, u128::MAX)], )], ); } @@ -4237,7 +4237,7 @@ mod tests { #[test] fn max_limit() { MAX_LIMIT - .checked_mul(u128::from(u16::max_value()) * 144 * 365 * 1_000_000_000) + .checked_mul(u128::from(u16::MAX) * 144 * 365 * 1_000_000_000) .unwrap(); } diff --git a/src/runes/pile.rs b/src/runes/pile.rs index 4ba6822514..13eec8cdda 100644 --- a/src/runes/pile.rs +++ b/src/runes/pile.rs @@ -122,7 +122,7 @@ mod tests { ); assert_eq!( Pile { - amount: u128::max_value(), + amount: u128::MAX, divisibility: 18, symbol: None, } @@ -131,7 +131,7 @@ mod tests { ); assert_eq!( Pile { - amount: u128::max_value(), + amount: u128::MAX, divisibility: MAX_DIVISIBILITY, symbol: None, } diff --git a/src/runes/rune.rs b/src/runes/rune.rs index 5be13c15fe..aeaa2ebb6f 100644 --- a/src/runes/rune.rs +++ b/src/runes/rune.rs @@ -183,9 +183,9 @@ mod tests { case(27, "AB"); case(51, "AZ"); case(52, "BA"); - case(u128::max_value() - 2, "BCGDENLQRQWDSLRUGSNLBTMFIJAT"); - case(u128::max_value() - 1, "BCGDENLQRQWDSLRUGSNLBTMFIJAU"); - case(u128::max_value(), "BCGDENLQRQWDSLRUGSNLBTMFIJAV"); + case(u128::MAX - 2, "BCGDENLQRQWDSLRUGSNLBTMFIJAT"); + case(u128::MAX - 1, "BCGDENLQRQWDSLRUGSNLBTMFIJAU"); + case(u128::MAX, "BCGDENLQRQWDSLRUGSNLBTMFIJAV"); } #[test] @@ -217,7 +217,7 @@ mod tests { case(END - 1, "A"); case(END, "A"); case(END + 1, "A"); - case(u32::max_value(), "A"); + case(u32::MAX, "A"); case(START + INTERVAL * 00 - 1, "AAAAAAAAAAAAA"); case(START + INTERVAL * 00 + 0, "ZZYZXBRKWXVA"); diff --git a/src/runes/runestone.rs b/src/runes/runestone.rs index e1cf9aa63e..085b44f16e 100644 --- a/src/runes/runestone.rs +++ b/src/runes/runestone.rs @@ -962,7 +962,7 @@ mod tests { #[test] fn id_deltas_saturate_to_max() { assert_eq!( - decipher(&[TAG_BODY, 1, 2, 3, u128::max_value(), 5, 6]), + decipher(&[TAG_BODY, 1, 2, 3, u128::MAX, 5, 6]), Runestone { edicts: vec![ Edict { @@ -971,7 +971,7 @@ mod tests { output: 3, }, Edict { - id: u128::max_value(), + id: u128::MAX, amount: 5, output: 6, }, @@ -1157,7 +1157,7 @@ mod tests { case( Vec::new(), Some(Etching { - rune: Some(Rune(u128::max_value())), + rune: Some(Rune(u128::MAX)), ..Default::default() }), 24, @@ -1175,7 +1175,7 @@ mod tests { }], Some(Etching { divisibility: MAX_DIVISIBILITY, - rune: Some(Rune(u128::max_value())), + rune: Some(Rune(u128::MAX)), ..Default::default() }), 30, @@ -1183,7 +1183,7 @@ mod tests { case( vec![Edict { - amount: u128::max_value(), + amount: u128::MAX, id: RuneId { height: 0, index: 0, @@ -1193,7 +1193,7 @@ mod tests { }], Some(Etching { divisibility: MAX_DIVISIBILITY, - rune: Some(Rune(u128::max_value())), + rune: Some(Rune(u128::MAX)), ..Default::default() }), 48, @@ -1204,7 +1204,7 @@ mod tests { amount: 0, id: RuneId { height: 1_000_000, - index: u16::max_value(), + index: u16::MAX, } .into(), output: 0, @@ -1225,10 +1225,10 @@ mod tests { case( vec![Edict { - amount: u128::max_value(), + amount: u128::MAX, id: RuneId { height: 1_000_000, - index: u16::max_value(), + index: u16::MAX, } .into(), output: 0, @@ -1240,19 +1240,19 @@ mod tests { case( vec![ Edict { - amount: u128::max_value(), + amount: u128::MAX, id: RuneId { height: 1_000_000, - index: u16::max_value(), + index: u16::MAX, } .into(), output: 0, }, Edict { - amount: u128::max_value(), + amount: u128::MAX, id: RuneId { height: 1_000_000, - index: u16::max_value(), + index: u16::MAX, } .into(), output: 0, @@ -1265,28 +1265,28 @@ mod tests { case( vec![ Edict { - amount: u128::max_value(), + amount: u128::MAX, id: RuneId { height: 1_000_000, - index: u16::max_value(), + index: u16::MAX, } .into(), output: 0, }, Edict { - amount: u128::max_value(), + amount: u128::MAX, id: RuneId { height: 1_000_000, - index: u16::max_value(), + index: u16::MAX, } .into(), output: 0, }, Edict { - amount: u128::max_value(), + amount: u128::MAX, id: RuneId { height: 1_000_000, - index: u16::max_value(), + index: u16::MAX, } .into(), output: 0, @@ -1299,10 +1299,10 @@ mod tests { case( vec![ Edict { - amount: u64::max_value().into(), + amount: u64::MAX.into(), id: RuneId { height: 1_000_000, - index: u16::max_value(), + index: u16::MAX, } .into(), output: 0, @@ -1316,10 +1316,10 @@ mod tests { case( vec![ Edict { - amount: u64::max_value().into(), + amount: u64::MAX.into(), id: RuneId { height: 1_000_000, - index: u16::max_value(), + index: u16::MAX, } .into(), output: 0, @@ -1333,10 +1333,10 @@ mod tests { case( vec![ Edict { - amount: u64::max_value().into(), + amount: u64::MAX.into(), id: RuneId { height: 0, - index: u16::max_value(), + index: u16::MAX, } .into(), output: 0, @@ -1353,7 +1353,7 @@ mod tests { amount: 1_000_000_000_000_000_000, id: RuneId { height: 1_000_000, - index: u16::max_value(), + index: u16::MAX, } .into(), output: 0, @@ -1372,7 +1372,7 @@ mod tests { TAG_FLAGS, FLAG_ETCH, TAG_TERM, - u128::from(u64::max_value()) + 1, + u128::from(u64::MAX) + 1, ]), Runestone { etching: Some(Etching::default()), diff --git a/src/runes/varint.rs b/src/runes/varint.rs index 0a9ff7a90e..438673a836 100644 --- a/src/runes/varint.rs +++ b/src/runes/varint.rs @@ -48,7 +48,7 @@ mod tests { #[test] fn u128_max_round_trips_successfully() { - let n = u128::max_value(); + let n = u128::MAX; let encoded = encode(n); let (decoded, length) = decode(&encoded); assert_eq!(decoded, n); diff --git a/src/subcommand/server.rs b/src/subcommand/server.rs index 955981a160..0e77c06e65 100644 --- a/src/subcommand/server.rs +++ b/src/subcommand/server.rs @@ -2236,7 +2236,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -2282,7 +2282,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -2310,7 +2310,7 @@ mod tests { RuneEntry { etching: txid, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() } @@ -2319,7 +2319,7 @@ mod tests { assert_eq!( server.index.get_rune_balances().unwrap(), - [(OutPoint { txid, vout: 0 }, vec![(id, u128::max_value())])] + [(OutPoint { txid, vout: 0 }, vec![(id, u128::MAX)])] ); server.assert_response_regex( @@ -2349,7 +2349,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -2378,7 +2378,7 @@ mod tests { RuneEntry { etching: txid, rune, - supply: u128::max_value(), + supply: u128::MAX, symbol: Some('%'), timestamp: 2, ..Default::default() @@ -2388,7 +2388,7 @@ mod tests { assert_eq!( server.index.get_rune_balances().unwrap(), - [(OutPoint { txid, vout: 0 }, vec![(id, u128::max_value())])] + [(OutPoint { txid, vout: 0 }, vec![(id, u128::MAX)])] ); server.assert_response_regex( @@ -2457,7 +2457,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -2487,7 +2487,7 @@ mod tests { RuneEntry { etching: txid, rune, - supply: u128::max_value(), + supply: u128::MAX, symbol: Some('%'), timestamp: 2, spacers: 1, @@ -2498,7 +2498,7 @@ mod tests { assert_eq!( server.index.get_rune_balances().unwrap(), - [(OutPoint { txid, vout: 0 }, vec![(id, u128::max_value())])] + [(OutPoint { txid, vout: 0 }, vec![(id, u128::MAX)])] ); server.assert_response_regex( @@ -2556,7 +2556,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -2584,7 +2584,7 @@ mod tests { RuneEntry { etching: txid, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() } @@ -2593,7 +2593,7 @@ mod tests { assert_eq!( server.index.get_rune_balances().unwrap(), - [(OutPoint { txid, vout: 0 }, vec![(id, u128::max_value())])] + [(OutPoint { txid, vout: 0 }, vec![(id, u128::MAX)])] ); server.assert_response_regex( @@ -2622,7 +2622,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -2652,7 +2652,7 @@ mod tests { divisibility: 1, etching: txid, rune, - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() } @@ -2663,7 +2663,7 @@ mod tests { assert_eq!( server.index.get_rune_balances().unwrap(), - [(output, vec![(id, u128::max_value())])] + [(output, vec![(id, u128::MAX)])] ); server.assert_response_regex( diff --git a/src/templates/rune.rs b/src/templates/rune.rs index 78a688a66a..35b89912f0 100644 --- a/src/templates/rune.rs +++ b/src/templates/rune.rs @@ -32,7 +32,7 @@ mod tests { limit: Some(1000000001), mints: 100, number: 25, - rune: Rune(u128::max_value()), + rune: Rune(u128::MAX), spacers: 1, supply: 123456789123456789, symbol: Some('%'), @@ -98,7 +98,7 @@ mod tests { limit: None, mints: 0, number: 25, - rune: Rune(u128::max_value()), + rune: Rune(u128::MAX), spacers: 1, supply: 123456789123456789, symbol: Some('%'),