diff --git a/crates/ordinals/src/epoch.rs b/crates/ordinals/src/epoch.rs index 9e7b861ee9..43d0b872dc 100644 --- a/crates/ordinals/src/epoch.rs +++ b/crates/ordinals/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] @@ -237,6 +237,6 @@ mod tests { #[test] fn first_post_subsidy() { assert_eq!(Epoch::FIRST_POST_SUBSIDY.subsidy(), 0); - assert!((Epoch(Epoch::FIRST_POST_SUBSIDY.0 - 1)).subsidy() > 0); + assert!(Epoch(Epoch::FIRST_POST_SUBSIDY.0 - 1).subsidy() > 0); } } diff --git a/crates/ordinals/src/height.rs b/crates/ordinals/src/height.rs index ffae6b5bb2..0aaa38921e 100644 --- a/crates/ordinals/src/height.rs +++ b/crates/ordinals/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/crates/test-bitcoincore-rpc/src/lib.rs b/crates/test-bitcoincore-rpc/src/lib.rs index 840067e274..c5b11244b4 100644 --- a/crates/test-bitcoincore-rpc/src/lib.rs +++ b/crates/test-bitcoincore-rpc/src/lib.rs @@ -139,7 +139,7 @@ pub struct TransactionTemplate<'a> { #[derive(Serialize, Deserialize)] pub struct JsonOutPoint { - txid: bitcoin::Txid, + txid: Txid, vout: u32, } diff --git a/crates/test-bitcoincore-rpc/src/server.rs b/crates/test-bitcoincore-rpc/src/server.rs index 9cc80a6034..94b93a698a 100644 --- a/crates/test-bitcoincore-rpc/src/server.rs +++ b/crates/test-bitcoincore-rpc/src/server.rs @@ -180,7 +180,7 @@ impl Api for Server { .utxos .get(&OutPoint { txid, vout }) .map(|&value| GetTxOutResult { - bestblock: bitcoin::BlockHash::all_zeros(), + bestblock: BlockHash::all_zeros(), confirmations: 0, value, script_pub_key: GetRawTransactionResultVoutScriptPubKey { @@ -651,7 +651,7 @@ impl Api for Server { &self, _label: Option, _address_type: Option, - ) -> Result { + ) -> Result { let secp256k1 = Secp256k1::new(); let key_pair = KeyPair::new(&secp256k1, &mut rand::thread_rng()); let (public_key, _parity) = XOnlyPublicKey::from_keypair(&key_pair); diff --git a/src/decimal.rs b/src/decimal.rs index 051ed907fd..b20593bfe3 100644 --- a/src/decimal.rs +++ b/src/decimal.rs @@ -25,7 +25,7 @@ impl Decimal { } impl Display for Decimal { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { let magnitude = 10u128.pow(self.scale.into()); let integer = self.value / magnitude; diff --git a/src/index.rs b/src/index.rs index 1f553dcaef..2b43d64406 100644 --- a/src/index.rs +++ b/src/index.rs @@ -1050,7 +1050,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) } @@ -1909,7 +1909,7 @@ impl Index { Some(sat) => { if self.index_sats { // unbound inscriptions should not be assigned to a sat - assert!(satpoint.outpoint != unbound_outpoint()); + assert_ne!(satpoint.outpoint, unbound_outpoint()); assert!(rtx .open_multimap_table(SAT_TO_SEQUENCE_NUMBER) @@ -1937,7 +1937,7 @@ impl Index { } None => { if self.index_sats { - assert!(satpoint.outpoint == unbound_outpoint()) + assert_eq!(satpoint.outpoint, unbound_outpoint()) } } } diff --git a/src/index/entry.rs b/src/index/entry.rs index 11f7e8c829..91923082fe 100644 --- a/src/index/entry.rs +++ b/src/index/entry.rs @@ -326,7 +326,7 @@ impl Entry for OutPoint { type Value = OutPointValue; fn load(value: Self::Value) -> Self { - Decodable::consensus_decode(&mut io::Cursor::new(value)).unwrap() + Decodable::consensus_decode(&mut Cursor::new(value)).unwrap() } fn store(self) -> Self::Value { @@ -342,7 +342,7 @@ impl Entry for SatPoint { type Value = SatPointValue; fn load(value: Self::Value) -> Self { - Decodable::consensus_decode(&mut io::Cursor::new(value)).unwrap() + Decodable::consensus_decode(&mut Cursor::new(value)).unwrap() } fn store(self) -> Self::Value { diff --git a/src/index/fetcher.rs b/src/index/fetcher.rs index 46d160da4b..d65485e26c 100644 --- a/src/index/fetcher.rs +++ b/src/index/fetcher.rs @@ -79,10 +79,7 @@ impl Fetcher { log::info!("failed to fetch raw transactions, retrying: {}", error); - tokio::time::sleep(tokio::time::Duration::from_millis( - 100 * u64::pow(2, retries), - )) - .await; + tokio::time::sleep(Duration::from_millis(100 * u64::pow(2, retries))).await; retries += 1; continue; } @@ -113,7 +110,7 @@ impl Fetcher { .map_err(|e| anyhow!("Result for batched JSON-RPC response not valid hex: {e}")) }) .and_then(|hex| { - bitcoin::consensus::deserialize(&hex).map_err(|e| { + consensus::deserialize(&hex).map_err(|e| { anyhow!("Result for batched JSON-RPC response not valid bitcoin tx: {e}") }) }) diff --git a/src/index/reorg.rs b/src/index/reorg.rs index e9db3471e7..9337103f96 100644 --- a/src/index/reorg.rs +++ b/src/index/reorg.rs @@ -6,8 +6,8 @@ pub(crate) enum ReorgError { Unrecoverable, } -impl fmt::Display for ReorgError { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { +impl Display for ReorgError { + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { match self { ReorgError::Recoverable { height, depth } => { write!(f, "{depth} block deep reorg detected at height {height}") diff --git a/src/index/updater.rs b/src/index/updater.rs index db5c120939..ace80b31fb 100644 --- a/src/index/updater.rs +++ b/src/index/updater.rs @@ -257,7 +257,7 @@ impl<'index> Updater<'_> { // else runs a request, we keep this to 12. const PARALLEL_REQUESTS: usize = 12; - std::thread::spawn(move || { + thread::spawn(move || { let rt = tokio::runtime::Builder::new_multi_thread() .enable_all() .build() diff --git a/src/index/updater/rune_updater.rs b/src/index/updater/rune_updater.rs index b6217b5e40..6bed6f14a6 100644 --- a/src/index/updater/rune_updater.rs +++ b/src/index/updater/rune_updater.rs @@ -124,7 +124,7 @@ impl<'a, 'db, 'tx> RuneUpdater<'a, 'db, 'tx> { mint.limit.unwrap_or(runes::MAX_LIMIT) } } else { - u128::max_value() + u128::MAX }, divisibility: etching.divisibility, id: u128::from(self.height) << 16 | u128::from(index), @@ -307,7 +307,7 @@ impl<'a, 'db, 'tx> RuneUpdater<'a, 'db, 'tx> { mint.limit.unwrap_or(runes::MAX_LIMIT) } } else { - u128::max_value() + u128::MAX } - balance, symbol, timestamp: self.timestamp, diff --git a/src/inscriptions/envelope.rs b/src/inscriptions/envelope.rs index 76836f7733..0ef863c831 100644 --- a/src/inscriptions/envelope.rs +++ b/src/inscriptions/envelope.rs @@ -283,11 +283,11 @@ mod tests { #[test] fn ignore_key_path_spends() { assert_eq!( - parse(&[Witness::from_slice(&[bitcoin::script::Builder::new() - .push_opcode(bitcoin::opcodes::OP_FALSE) - .push_opcode(bitcoin::opcodes::all::OP_IF) + parse(&[Witness::from_slice(&[script::Builder::new() + .push_opcode(opcodes::OP_FALSE) + .push_opcode(opcodes::all::OP_IF) .push_slice(PROTOCOL_ID) - .push_opcode(bitcoin::opcodes::all::OP_ENDIF) + .push_opcode(opcodes::all::OP_ENDIF) .into_script() .into_bytes()])]), Vec::new() @@ -298,11 +298,11 @@ mod tests { fn ignore_key_path_spends_with_annex() { assert_eq!( parse(&[Witness::from_slice(&[ - bitcoin::script::Builder::new() - .push_opcode(bitcoin::opcodes::OP_FALSE) - .push_opcode(bitcoin::opcodes::all::OP_IF) + script::Builder::new() + .push_opcode(opcodes::OP_FALSE) + .push_opcode(opcodes::all::OP_IF) .push_slice(PROTOCOL_ID) - .push_opcode(bitcoin::opcodes::all::OP_ENDIF) + .push_opcode(opcodes::all::OP_ENDIF) .into_script() .into_bytes(), vec![0x50] @@ -315,11 +315,11 @@ mod tests { fn parse_from_tapscript() { assert_eq!( parse(&[Witness::from_slice(&[ - bitcoin::script::Builder::new() - .push_opcode(bitcoin::opcodes::OP_FALSE) - .push_opcode(bitcoin::opcodes::all::OP_IF) + script::Builder::new() + .push_opcode(opcodes::OP_FALSE) + .push_opcode(opcodes::all::OP_IF) .push_slice(PROTOCOL_ID) - .push_opcode(bitcoin::opcodes::all::OP_ENDIF) + .push_opcode(opcodes::all::OP_ENDIF) .into_script() .into_bytes(), Vec::new() @@ -332,11 +332,11 @@ mod tests { #[test] fn ignore_unparsable_scripts() { - let mut script_bytes = bitcoin::script::Builder::new() - .push_opcode(bitcoin::opcodes::OP_FALSE) - .push_opcode(bitcoin::opcodes::all::OP_IF) + let mut script_bytes = script::Builder::new() + .push_opcode(opcodes::OP_FALSE) + .push_opcode(opcodes::all::OP_IF) .push_slice(PROTOCOL_ID) - .push_opcode(bitcoin::opcodes::all::OP_ENDIF) + .push_opcode(opcodes::all::OP_ENDIF) .into_script() .into_bytes(); script_bytes.push(0x01); diff --git a/src/inscriptions/media.rs b/src/inscriptions/media.rs index de41de2571..f61833e99a 100644 --- a/src/inscriptions/media.rs +++ b/src/inscriptions/media.rs @@ -38,11 +38,11 @@ impl Display for Language { f, "{}", match self { - Self::Css => "css", - Self::JavaScript => "javascript", - Self::Json => "json", - Self::Python => "python", - Self::Yaml => "yaml", + Css => "css", + JavaScript => "javascript", + Json => "json", + Python => "python", + Yaml => "yaml", } ) } @@ -60,8 +60,8 @@ impl Display for ImageRendering { f, "{}", match self { - Self::Auto => "auto", - Self::Pixelated => "pixelated", + Auto => "auto", + Pixelated => "pixelated", } ) } diff --git a/src/lib.rs b/src/lib.rs index ba7410dd55..97bd255953 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -126,7 +126,7 @@ type Result = std::result::Result; static SHUTTING_DOWN: AtomicBool = AtomicBool::new(false); static LISTENERS: Mutex> = Mutex::new(Vec::new()); -static INDEXER: Mutex>> = Mutex::new(Option::None); +static INDEXER: Mutex>> = Mutex::new(None); const TARGET_POSTAGE: Amount = Amount::from_sat(10_000); @@ -186,7 +186,7 @@ fn unbound_outpoint() -> OutPoint { } } -pub fn parse_ord_server_args(args: &str) -> (Options, crate::subcommand::server::Server) { +pub fn parse_ord_server_args(args: &str) -> (Options, subcommand::server::Server) { match Arguments::try_parse_from(args.split_whitespace()) { Ok(arguments) => match arguments.subcommand { Subcommand::Server(server) => (arguments.options, server), diff --git a/src/outgoing.rs b/src/outgoing.rs index 63927e3dd8..108b565b43 100644 --- a/src/outgoing.rs +++ b/src/outgoing.rs @@ -9,7 +9,7 @@ pub enum Outgoing { } impl Display for Outgoing { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { match self { Self::Amount(amount) => write!(f, "{}", amount.to_string().to_lowercase()), Self::InscriptionId(inscription_id) => inscription_id.fmt(f), diff --git a/src/runes.rs b/src/runes.rs index 3ee6a73400..39c101d7ac 100644 --- a/src/runes.rs +++ b/src/runes.rs @@ -50,7 +50,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -140,7 +140,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -167,12 +167,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)])], ); } @@ -194,7 +194,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -224,7 +224,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -251,12 +251,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)])], ); } } @@ -274,7 +274,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -304,7 +304,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -331,12 +331,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)])], ); } } @@ -354,7 +354,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -381,7 +381,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RESERVED), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -391,7 +391,7 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id0, u128::max_value())], + vec![(id0, u128::MAX)], )], ); @@ -403,7 +403,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -431,7 +431,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RESERVED), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -441,7 +441,7 @@ mod tests { RuneEntry { etching: txid1, rune: Rune(RESERVED + 1), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 4, number: 1, ..Default::default() @@ -454,14 +454,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)], ), ], ); @@ -479,7 +479,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -508,12 +508,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)])], ); } @@ -530,12 +530,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, }, ], @@ -563,12 +563,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)])], ); } @@ -585,12 +585,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, }, ], @@ -618,13 +618,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)])], ); } @@ -799,7 +799,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -826,7 +826,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -836,7 +836,7 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id, u128::max_value())], + vec![(id, u128::MAX)], )], ); @@ -846,7 +846,7 @@ mod tests { Runestone { edicts: vec![Edict { id: id.into(), - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], ..Default::default() @@ -864,7 +864,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -874,7 +874,7 @@ mod tests { txid: txid1, vout: 0, }, - vec![(id, u128::max_value())], + vec![(id, u128::MAX)], )], ); } @@ -891,7 +891,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -939,7 +939,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -1001,7 +1001,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching::default()), @@ -1046,7 +1046,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -1073,7 +1073,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -1083,7 +1083,7 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id, u128::max_value())], + vec![(id, u128::MAX)], )], ); @@ -1105,10 +1105,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() }, @@ -1129,7 +1129,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -1156,7 +1156,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -1166,7 +1166,7 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id, u128::max_value())], + vec![(id, u128::MAX)], )], ); @@ -1184,7 +1184,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -1194,7 +1194,7 @@ mod tests { txid: txid1, vout: 0, }, - vec![(id, u128::max_value())], + vec![(id, u128::MAX)], )], ); } @@ -1211,7 +1211,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -1238,7 +1238,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -1248,7 +1248,7 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id, u128::max_value())], + vec![(id, u128::MAX)], )], ); @@ -1267,9 +1267,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() }, )], @@ -1289,7 +1289,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -1316,7 +1316,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -1326,7 +1326,7 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id, u128::max_value())], + vec![(id, u128::MAX)], )], ); @@ -1351,7 +1351,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -1361,7 +1361,7 @@ mod tests { txid: txid1, vout: 1, }, - vec![(id, u128::max_value())], + vec![(id, u128::MAX)], )], ); } @@ -1378,7 +1378,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -1405,7 +1405,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -1415,7 +1415,7 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id, u128::max_value())], + vec![(id, u128::MAX)], )], ); @@ -1440,7 +1440,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -1450,7 +1450,7 @@ mod tests { txid: txid1, vout: 0, }, - vec![(id, u128::max_value())], + vec![(id, u128::MAX)], )], ); } @@ -1467,7 +1467,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -1494,7 +1494,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -1504,7 +1504,7 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id, u128::max_value())], + vec![(id, u128::MAX)], )], ); @@ -1529,8 +1529,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() }, @@ -1552,7 +1552,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -1579,7 +1579,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -1589,7 +1589,7 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id, u128::max_value())], + vec![(id, u128::MAX)], )], ); @@ -1607,7 +1607,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -1617,7 +1617,7 @@ mod tests { txid: txid1, vout: 0, }, - vec![(id, u128::max_value())], + vec![(id, u128::MAX)], )], ); } @@ -1634,7 +1634,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -1661,12 +1661,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 { @@ -1675,7 +1675,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -1697,12 +1697,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)])], ); } @@ -1718,7 +1718,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -1745,7 +1745,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -1755,7 +1755,7 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id0, u128::max_value())], + vec![(id0, u128::MAX)], )], ); @@ -1765,7 +1765,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -1793,7 +1793,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -1803,7 +1803,7 @@ mod tests { RuneEntry { etching: txid1, rune: Rune(RUNE + 1), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 3, number: 1, ..Default::default() @@ -1816,14 +1816,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)], ), ], ); @@ -1842,7 +1842,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -1852,7 +1852,7 @@ mod tests { RuneEntry { etching: txid1, rune: Rune(RUNE + 1), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 3, number: 1, ..Default::default() @@ -1864,7 +1864,7 @@ mod tests { txid: txid2, vout: 0, }, - vec![(id0, u128::max_value()), (id1, u128::max_value())], + vec![(id0, u128::MAX), (id1, u128::MAX)], )], ); } @@ -1881,7 +1881,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -1908,7 +1908,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -1918,7 +1918,7 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id0, u128::max_value())], + vec![(id0, u128::MAX)], )], ); @@ -1928,7 +1928,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -1956,7 +1956,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -1966,7 +1966,7 @@ mod tests { RuneEntry { etching: txid1, rune: Rune(RUNE + 1), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 3, number: 1, ..Default::default() @@ -1979,14 +1979,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)], ), ], ); @@ -2005,7 +2005,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -2015,7 +2015,7 @@ mod tests { RuneEntry { etching: txid1, rune: Rune(RUNE + 1), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 3, number: 1, ..Default::default() @@ -2027,7 +2027,7 @@ mod tests { txid: txid2, vout: 0, }, - vec![(id0, u128::max_value()), (id1, u128::max_value())], + vec![(id0, u128::MAX), (id1, u128::MAX)], )], ); @@ -2039,12 +2039,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, }, ], @@ -2064,7 +2064,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -2074,7 +2074,7 @@ mod tests { RuneEntry { etching: txid1, rune: Rune(RUNE + 1), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 3, number: 1, ..Default::default() @@ -2087,17 +2087,14 @@ mod tests { txid: txid3, vout: 0, }, - vec![ - (id0, u128::max_value() / 2 + 1), - (id1, u128::max_value() / 2 + 1), - ], + vec![(id0, u128::MAX / 2 + 1), (id1, u128::MAX / 2 + 1)], ), ( OutPoint { txid: txid3, vout: 1, }, - vec![(id0, u128::max_value() / 2), (id1, u128::max_value() / 2)], + vec![(id0, u128::MAX / 2), (id1, u128::MAX / 2)], ), ], ); @@ -2115,7 +2112,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -2142,7 +2139,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -2152,7 +2149,7 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id0, u128::max_value())], + vec![(id0, u128::MAX)], )], ); @@ -2162,7 +2159,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -2190,7 +2187,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -2200,7 +2197,7 @@ mod tests { RuneEntry { etching: txid1, rune: Rune(RUNE + 1), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 3, number: 1, ..Default::default() @@ -2213,14 +2210,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)], ), ], ); @@ -2232,12 +2229,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, }, ], @@ -2257,7 +2254,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -2267,7 +2264,7 @@ mod tests { RuneEntry { etching: txid1, rune: Rune(RUNE + 1), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 3, number: 1, ..Default::default() @@ -2279,7 +2276,7 @@ mod tests { txid: txid2, vout: 0, }, - vec![(id0, u128::max_value()), (id1, u128::max_value())], + vec![(id0, u128::MAX), (id1, u128::MAX)], )], ); } @@ -2297,7 +2294,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -2324,7 +2321,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -2334,7 +2331,7 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id, u128::max_value())], + vec![(id, u128::MAX)], )], ); @@ -2357,12 +2354,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)])], ); } @@ -2378,7 +2375,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -2403,7 +2400,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -2431,7 +2428,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 3, ..Default::default() }, @@ -2441,7 +2438,7 @@ mod tests { RuneEntry { etching: txid1, rune: Rune(RUNE + 1), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 3, number: 1, ..Default::default() @@ -2454,14 +2451,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)], ), ], ); @@ -2479,7 +2476,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -2506,7 +2503,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -2516,7 +2513,7 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id, u128::max_value())], + vec![(id, u128::MAX)], )], ); @@ -2532,7 +2529,7 @@ mod tests { }, Edict { id: id.into(), - amount: u128::max_value(), + amount: u128::MAX, output: 0, }, ], @@ -2551,7 +2548,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -2561,7 +2558,7 @@ mod tests { txid: txid1, vout: 0, }, - vec![(id, u128::max_value())], + vec![(id, u128::MAX)], )], ); } @@ -2578,7 +2575,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -2605,7 +2602,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -2615,7 +2612,7 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id0, u128::max_value())], + vec![(id0, u128::MAX)], )], ); @@ -2625,7 +2622,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -2653,7 +2650,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -2663,7 +2660,7 @@ mod tests { RuneEntry { etching: txid1, rune: Rune(RUNE + 1), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 3, number: 1, ..Default::default() @@ -2676,14 +2673,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)], ), ], ); @@ -2695,12 +2692,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, }, ], @@ -2720,7 +2717,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -2730,7 +2727,7 @@ mod tests { RuneEntry { etching: txid1, rune: Rune(RUNE + 1), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 3, number: 1, ..Default::default() @@ -2743,14 +2740,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)], ), ], ); @@ -2768,7 +2765,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value() / 2, + amount: u128::MAX / 2, output: 0, }], etching: Some(Etching { @@ -2795,7 +2792,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value() / 2, + supply: u128::MAX / 2, timestamp: 2, ..Default::default() }, @@ -2805,7 +2802,7 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id, u128::max_value() / 2)], + vec![(id, u128::MAX / 2)], )], ); @@ -2815,7 +2812,7 @@ mod tests { Runestone { edicts: vec![Edict { id: id.into(), - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], ..Default::default() @@ -2833,7 +2830,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value() / 2, + supply: u128::MAX / 2, timestamp: 2, ..Default::default() }, @@ -2843,7 +2840,7 @@ mod tests { txid: txid1, vout: 0, }, - vec![(id, u128::max_value() / 2)], + vec![(id, u128::MAX / 2)], )], ); } @@ -2860,7 +2857,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 1, }], etching: Some(Etching { @@ -2885,10 +2882,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() }, @@ -2910,7 +2907,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -2937,12 +2934,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)])], ); } @@ -2960,7 +2957,7 @@ mod tests { edicts: vec![ Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }, Edict { @@ -2993,12 +2990,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)])], ); } @@ -3042,28 +3039,16 @@ 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() / 4 + 1)], - ), - ( - OutPoint { txid, vout: 1 }, - vec![(id, u128::max_value() / 4 + 1)], - ), - ( - OutPoint { txid, vout: 2 }, - vec![(id, u128::max_value() / 4 + 1)], - ), - ( - OutPoint { txid, vout: 3 }, - vec![(id, u128::max_value() / 4)], - ), + (OutPoint { txid, vout: 0 }, vec![(id, u128::MAX / 4 + 1)]), + (OutPoint { txid, vout: 1 }, vec![(id, u128::MAX / 4 + 1)]), + (OutPoint { txid, vout: 2 }, vec![(id, u128::MAX / 4 + 1)]), + (OutPoint { txid, vout: 3 }, vec![(id, u128::MAX / 4)]), ], ); } @@ -3115,7 +3100,7 @@ mod tests { RuneEntry { etching: txid, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -3123,19 +3108,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)], ), ], ); @@ -3188,28 +3173,16 @@ 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() / 4 + 1)], - ), - ( - OutPoint { txid, vout: 1 }, - vec![(id, u128::max_value() / 4 + 1)], - ), - ( - OutPoint { txid, vout: 2 }, - vec![(id, u128::max_value() / 4 + 1)], - ), - ( - OutPoint { txid, vout: 3 }, - vec![(id, u128::max_value() / 4)], - ), + (OutPoint { txid, vout: 0 }, vec![(id, u128::MAX / 4 + 1)]), + (OutPoint { txid, vout: 1 }, vec![(id, u128::MAX / 4 + 1)]), + (OutPoint { txid, vout: 2 }, vec![(id, u128::MAX / 4 + 1)]), + (OutPoint { txid, vout: 3 }, vec![(id, u128::MAX / 4)]), ], ); } @@ -3282,7 +3255,7 @@ mod tests { edicts: vec![ Edict { id: 0, - amount: u128::max_value() - 3000, + amount: u128::MAX - 3000, output: 0, }, Edict { @@ -3315,16 +3288,13 @@ 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() - 2000)], - ), + (OutPoint { txid, vout: 0 }, vec![(id, u128::MAX - 2000)]), (OutPoint { txid, vout: 1 }, vec![(id, 1000)]), (OutPoint { txid, vout: 2 }, vec![(id, 1000)]), ], @@ -3350,7 +3320,7 @@ mod tests { }, Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }, ], @@ -3378,7 +3348,7 @@ mod tests { RuneEntry { etching: txid, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -3386,7 +3356,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)]), @@ -3407,7 +3377,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -3434,7 +3404,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -3444,7 +3414,7 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id, u128::max_value())], + vec![(id, u128::MAX)], )], ); @@ -3473,7 +3443,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -3484,14 +3454,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)], ), ], ); @@ -3509,7 +3479,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -3536,7 +3506,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -3546,7 +3516,7 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id, u128::max_value())], + vec![(id, u128::MAX)], )], ); @@ -3582,7 +3552,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -3593,14 +3563,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)], ), ], ); @@ -3618,7 +3588,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -3645,7 +3615,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -3655,7 +3625,7 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id, u128::max_value())], + vec![(id, u128::MAX)], )], ); @@ -3691,7 +3661,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -3702,14 +3672,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)], ), ], ); @@ -3727,7 +3697,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -3754,7 +3724,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -3764,7 +3734,7 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id, u128::max_value())], + vec![(id, u128::MAX)], )], ); @@ -3793,7 +3763,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -3804,7 +3774,7 @@ mod tests { txid: txid1, vout: 0, }, - vec![(id, u128::max_value() - 1000)], + vec![(id, u128::MAX - 1000)], ), ( OutPoint { @@ -3829,7 +3799,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -3856,7 +3826,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -3866,7 +3836,7 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id, u128::max_value())], + vec![(id, u128::MAX)], )], ); @@ -3878,7 +3848,7 @@ mod tests { edicts: vec![ Edict { id: id.into(), - amount: u128::max_value() - 2000, + amount: u128::MAX - 2000, output: 0, }, Edict { @@ -3902,7 +3872,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -3913,7 +3883,7 @@ mod tests { txid: txid1, vout: 0, }, - vec![(id, u128::max_value() - 2000 + 1000)], + vec![(id, u128::MAX - 2000 + 1000)], ), ( OutPoint { @@ -3938,7 +3908,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -3965,7 +3935,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -3975,7 +3945,7 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id, u128::max_value())], + vec![(id, u128::MAX)], )], ); @@ -3992,7 +3962,7 @@ mod tests { }, Edict { id: id.into(), - amount: u128::max_value(), + amount: u128::MAX, output: 0, }, ], @@ -4011,7 +3981,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -4022,7 +3992,7 @@ mod tests { txid: txid1, vout: 0, }, - vec![(id, u128::max_value() - 4000 + 1000)], + vec![(id, u128::MAX - 4000 + 1000)], ), ( OutPoint { @@ -4061,7 +4031,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -4089,13 +4059,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)])], ); } @@ -4138,12 +4108,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)])], ); } @@ -4159,7 +4129,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -4186,7 +4156,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -4196,7 +4166,7 @@ mod tests { txid: txid0, vout: 0, }, - vec![(id, u128::max_value())], + vec![(id, u128::MAX)], )], ); @@ -4225,7 +4195,7 @@ mod tests { RuneEntry { etching: txid0, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() }, @@ -4235,7 +4205,7 @@ mod tests { txid: txid1, vout: 1, }, - vec![(id, u128::max_value())], + vec![(id, u128::MAX)], )], ); } @@ -4243,7 +4213,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 a4a1e7c852..fbf429bec5 100644 --- a/src/runes/pile.rs +++ b/src/runes/pile.rs @@ -123,7 +123,7 @@ mod tests { ); assert_eq!( Pile { - amount: u128::max_value(), + amount: u128::MAX, divisibility: 18, symbol: None, } @@ -132,7 +132,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 4f2acbd81f..04bbc3e00e 100644 --- a/src/runes/rune.rs +++ b/src/runes/rune.rs @@ -95,7 +95,7 @@ impl<'de> Deserialize<'de> for Rune { impl Display for Rune { fn fmt(&self, f: &mut Formatter) -> fmt::Result { let mut n = self.0; - if n == u128::max_value() { + if n == u128::MAX { return write!(f, "BCGDENLQRQWDSLRUGSNLBTMFIJAV"); } @@ -120,7 +120,7 @@ impl Display for Rune { } impl FromStr for Rune { - type Err = crate::Error; + type Err = Error; fn from_str(s: &str) -> crate::Result { let mut x = 0u128; @@ -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/rune_id.rs b/src/runes/rune_id.rs index e31fb696c0..2ba260207f 100644 --- a/src/runes/rune_id.rs +++ b/src/runes/rune_id.rs @@ -30,7 +30,7 @@ impl Display for RuneId { } impl FromStr for RuneId { - type Err = crate::Error; + type Err = Error; fn from_str(s: &str) -> Result { let (height, index) = s diff --git a/src/runes/runestone.rs b/src/runes/runestone.rs index b3e770a97d..7bbf0c0578 100644 --- a/src/runes/runestone.rs +++ b/src/runes/runestone.rs @@ -197,8 +197,8 @@ impl Runestone { .push_opcode(opcodes::all::OP_RETURN) .push_slice(b"RUNE_TEST"); - for chunk in payload.chunks(bitcoin::blockdata::constants::MAX_SCRIPT_ELEMENT_SIZE) { - let push: &bitcoin::script::PushBytes = chunk.try_into().unwrap(); + for chunk in payload.chunks(MAX_SCRIPT_ELEMENT_SIZE) { + let push: &script::PushBytes = chunk.try_into().unwrap(); builder = builder.push_slice(push); } @@ -1058,7 +1058,7 @@ mod tests { #[test] fn id_deltas_saturate_to_max() { assert_eq!( - decipher(&[Tag::Body.into(), 1, 2, 3, u128::max_value(), 5, 6]), + decipher(&[Tag::Body.into(), 1, 2, 3, u128::MAX, 5, 6]), Runestone { edicts: vec![ Edict { @@ -1067,7 +1067,7 @@ mod tests { output: 3, }, Edict { - id: u128::max_value(), + id: u128::MAX, amount: 5, output: 6, }, @@ -1270,7 +1270,7 @@ mod tests { case( Vec::new(), Some(Etching { - rune: Some(Rune(u128::max_value())), + rune: Some(Rune(u128::MAX)), ..Default::default() }), 24, @@ -1288,7 +1288,7 @@ mod tests { }], Some(Etching { divisibility: MAX_DIVISIBILITY, - rune: Some(Rune(u128::max_value())), + rune: Some(Rune(u128::MAX)), ..Default::default() }), 30, @@ -1296,7 +1296,7 @@ mod tests { case( vec![Edict { - amount: u128::max_value(), + amount: u128::MAX, id: RuneId { height: 0, index: 0, @@ -1306,7 +1306,7 @@ mod tests { }], Some(Etching { divisibility: MAX_DIVISIBILITY, - rune: Some(Rune(u128::max_value())), + rune: Some(Rune(u128::MAX)), ..Default::default() }), 48, @@ -1317,7 +1317,7 @@ mod tests { amount: 0, id: RuneId { height: 1_000_000, - index: u16::max_value(), + index: u16::MAX, } .into(), output: 0, @@ -1338,10 +1338,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, @@ -1353,19 +1353,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, @@ -1378,28 +1378,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, @@ -1412,10 +1412,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, @@ -1429,10 +1429,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, @@ -1446,10 +1446,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, @@ -1466,7 +1466,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, @@ -1485,7 +1485,7 @@ mod tests { Tag::Flags.into(), Flag::Etch.mask(), Tag::Term.into(), - 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 abfaf33910..aa5aea4114 100644 --- a/src/subcommand/server.rs +++ b/src/subcommand/server.rs @@ -1761,7 +1761,7 @@ mod tests { fn new_with_regtest() -> Self { Self::new_server( test_bitcoincore_rpc::builder() - .network(bitcoin::network::constants::Network::Regtest) + .network(Network::Regtest) .build(), None, &["--chain", "regtest"], @@ -1772,7 +1772,7 @@ mod tests { fn new_with_regtest_with_json_api() -> Self { Self::new_server( test_bitcoincore_rpc::builder() - .network(bitcoin::network::constants::Network::Regtest) + .network(Network::Regtest) .build(), None, &["--chain", "regtest"], @@ -1783,7 +1783,7 @@ mod tests { fn new_with_regtest_with_index_sats() -> Self { Self::new_server( test_bitcoincore_rpc::builder() - .network(bitcoin::Network::Regtest) + .network(Network::Regtest) .build(), None, &["--chain", "regtest", "--index-sats"], @@ -1794,7 +1794,7 @@ mod tests { fn new_with_regtest_with_index_runes() -> Self { Self::new_server( test_bitcoincore_rpc::builder() - .network(bitcoin::Network::Regtest) + .network(Network::Regtest) .build(), None, &["--chain", "regtest", "--index-runes"], @@ -1904,7 +1904,7 @@ mod tests { let response = client .get(self.join_url(path.as_ref())) - .header(reqwest::header::ACCEPT, "application/json") + .header(header::ACCEPT, "application/json") .send() .unwrap(); @@ -1968,7 +1968,7 @@ mod tests { assert_eq!(response.headers().get(header::LOCATION).unwrap(), location); } - fn mine_blocks(&self, n: u64) -> Vec { + fn mine_blocks(&self, n: u64) -> Vec { let blocks = self.bitcoin_rpc_server.mine_blocks(n); self.index.update().unwrap(); blocks @@ -2272,7 +2272,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -2314,7 +2314,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -2355,7 +2355,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -2383,7 +2383,7 @@ mod tests { RuneEntry { etching: txid, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() } @@ -2392,7 +2392,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( @@ -2422,7 +2422,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -2451,7 +2451,7 @@ mod tests { RuneEntry { etching: txid, rune, - supply: u128::max_value(), + supply: u128::MAX, symbol: Some('%'), timestamp: 2, ..Default::default() @@ -2461,7 +2461,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( @@ -2530,7 +2530,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -2560,7 +2560,7 @@ mod tests { RuneEntry { etching: txid, rune, - supply: u128::max_value(), + supply: u128::MAX, symbol: Some('%'), timestamp: 2, spacers: 1, @@ -2571,7 +2571,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( @@ -2629,7 +2629,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -2657,7 +2657,7 @@ mod tests { RuneEntry { etching: txid, rune: Rune(RUNE), - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() } @@ -2666,7 +2666,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( @@ -2695,7 +2695,7 @@ mod tests { Runestone { edicts: vec![Edict { id: 0, - amount: u128::max_value(), + amount: u128::MAX, output: 0, }], etching: Some(Etching { @@ -2725,7 +2725,7 @@ mod tests { divisibility: 1, etching: txid, rune, - supply: u128::max_value(), + supply: u128::MAX, timestamp: 2, ..Default::default() } @@ -2736,7 +2736,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/preview.rs b/src/templates/preview.rs index 481969a4ff..4dd9e5f21c 100644 --- a/src/templates/preview.rs +++ b/src/templates/preview.rs @@ -1,51 +1,51 @@ use super::*; -#[derive(boilerplate::Boilerplate)] +#[derive(Boilerplate)] pub(crate) struct PreviewAudioHtml { pub(crate) inscription_id: InscriptionId, } -#[derive(boilerplate::Boilerplate)] +#[derive(Boilerplate)] pub(crate) struct PreviewCodeHtml { pub(crate) inscription_id: InscriptionId, pub(crate) language: media::Language, } -#[derive(boilerplate::Boilerplate)] +#[derive(Boilerplate)] pub(crate) struct PreviewFontHtml { pub(crate) inscription_id: InscriptionId, } -#[derive(boilerplate::Boilerplate)] +#[derive(Boilerplate)] pub(crate) struct PreviewImageHtml { pub(crate) image_rendering: ImageRendering, pub(crate) inscription_id: InscriptionId, } -#[derive(boilerplate::Boilerplate)] +#[derive(Boilerplate)] pub(crate) struct PreviewMarkdownHtml { pub(crate) inscription_id: InscriptionId, } -#[derive(boilerplate::Boilerplate)] +#[derive(Boilerplate)] pub(crate) struct PreviewModelHtml { pub(crate) inscription_id: InscriptionId, } -#[derive(boilerplate::Boilerplate)] +#[derive(Boilerplate)] pub(crate) struct PreviewPdfHtml { pub(crate) inscription_id: InscriptionId, } -#[derive(boilerplate::Boilerplate)] +#[derive(Boilerplate)] pub(crate) struct PreviewTextHtml { pub(crate) inscription_id: InscriptionId, } -#[derive(boilerplate::Boilerplate)] +#[derive(Boilerplate)] pub(crate) struct PreviewUnknownHtml; -#[derive(boilerplate::Boilerplate)] +#[derive(Boilerplate)] pub(crate) struct PreviewVideoHtml { pub(crate) inscription_id: InscriptionId, } diff --git a/src/templates/rune.rs b/src/templates/rune.rs index 2138b14e54..94282e0acf 100644 --- a/src/templates/rune.rs +++ b/src/templates/rune.rs @@ -32,7 +32,7 @@ mod tests { limit: Some(1000000001), deadline: Some(7), }), - rune: Rune(u128::max_value()), + rune: Rune(u128::MAX), spacers: 1, supply: 123456789123456789, symbol: Some('%'), @@ -101,7 +101,7 @@ mod tests { etching: Txid::all_zeros(), mints: 0, number: 25, - rune: Rune(u128::max_value()), + rune: Rune(u128::MAX), spacers: 1, supply: 123456789123456789, symbol: Some('%'), @@ -157,7 +157,7 @@ mod tests { etching: Txid::all_zeros(), mints: 0, number: 25, - rune: Rune(u128::max_value()), + rune: Rune(u128::MAX), spacers: 1, supply: 123456789123456789, symbol: Some('%'), diff --git a/src/wallet/inscribe/batch.rs b/src/wallet/inscribe/batch.rs index f20d8a9766..76b82b0337 100644 --- a/src/wallet/inscribe/batch.rs +++ b/src/wallet/inscribe/batch.rs @@ -130,7 +130,7 @@ impl Batch { reveal: Txid, total_fees: u64, inscriptions: Vec, - ) -> super::Output { + ) -> Output { let mut inscriptions_output = Vec::new(); for index in 0..inscriptions.len() { let index = u32::try_from(index).unwrap(); @@ -172,7 +172,7 @@ impl Batch { }); } - super::Output { + Output { commit, reveal, total_fees, diff --git a/src/wallet/transaction_builder.rs b/src/wallet/transaction_builder.rs index 3ba052508c..9945b8f3c7 100644 --- a/src/wallet/transaction_builder.rs +++ b/src/wallet/transaction_builder.rs @@ -61,8 +61,8 @@ pub enum Target { ExactPostage(Amount), } -impl fmt::Display for Error { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { +impl Display for Error { + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { match self { Error::Dust { output_value, diff --git a/tests/index.rs b/tests/index.rs index 5d44449cac..815bb90dd4 100644 --- a/tests/index.rs +++ b/tests/index.rs @@ -102,7 +102,7 @@ fn export_inscription_number_to_id_tsv() { .temp_dir(Arc::new(temp_dir)) .run_and_extract_file("foo.tsv"); - let entries: std::collections::BTreeMap = tsv + let entries: BTreeMap = tsv .lines() .filter(|line| !line.is_empty() && !line.starts_with('#')) .map(|line| {