diff --git a/src/index.rs b/src/index.rs index 21e5a7939f..0a51087968 100644 --- a/src/index.rs +++ b/src/index.rs @@ -2124,7 +2124,7 @@ mod tests { let inscription = inscription("text/plain;charset=utf-8", "hello"); let template = TransactionTemplate { inputs: &[(1, 0, 0, inscription.to_witness())], - ..Default::default() + ..default() }; { @@ -2175,7 +2175,7 @@ mod tests { let inscription = inscription("text/plain;charset=utf-8", "hello"); let template = TransactionTemplate { inputs: &[(1, 0, 0, inscription.to_witness())], - ..Default::default() + ..default() }; { @@ -2255,7 +2255,7 @@ mod tests { inputs: &[(1, 0, 0, Default::default())], outputs: 2, fee: 0, - ..Default::default() + ..default() }; let txid = context.rpc_server.broadcast_tx(split_coinbase_output); @@ -2280,7 +2280,7 @@ mod tests { let merge_coinbase_outputs = TransactionTemplate { inputs: &[(1, 0, 0, Default::default()), (2, 0, 0, Default::default())], fee: 0, - ..Default::default() + ..default() }; let txid = context.rpc_server.broadcast_tx(merge_coinbase_outputs); @@ -2304,7 +2304,7 @@ mod tests { inputs: &[(1, 0, 0, Default::default())], outputs: 2, fee: 10, - ..Default::default() + ..default() }; let txid = context.rpc_server.broadcast_tx(fee_paying_tx); let coinbase_txid = context.mine_blocks(1)[0].txdata[0].txid(); @@ -2337,12 +2337,12 @@ mod tests { let first_fee_paying_tx = TransactionTemplate { inputs: &[(1, 0, 0, Default::default())], fee: 10, - ..Default::default() + ..default() }; let second_fee_paying_tx = TransactionTemplate { inputs: &[(2, 0, 0, Default::default())], fee: 10, - ..Default::default() + ..default() }; context.rpc_server.broadcast_tx(first_fee_paying_tx); context.rpc_server.broadcast_tx(second_fee_paying_tx); @@ -2371,7 +2371,7 @@ mod tests { let no_value_output = TransactionTemplate { inputs: &[(1, 0, 0, Default::default())], fee: 50 * COIN_VALUE, - ..Default::default() + ..default() }; let txid = context.rpc_server.broadcast_tx(no_value_output); context.mine_blocks(1); @@ -2390,7 +2390,7 @@ mod tests { let no_value_output = TransactionTemplate { inputs: &[(1, 0, 0, Default::default())], fee: 50 * COIN_VALUE, - ..Default::default() + ..default() }; context.rpc_server.broadcast_tx(no_value_output); context.mine_blocks(1); @@ -2398,7 +2398,7 @@ mod tests { let no_value_input = TransactionTemplate { inputs: &[(2, 1, 0, Default::default())], fee: 0, - ..Default::default() + ..default() }; let txid = context.rpc_server.broadcast_tx(no_value_input); context.mine_blocks(1); @@ -2416,7 +2416,7 @@ mod tests { context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, Default::default())], fee: 0, - ..Default::default() + ..default() }); context.mine_blocks(1); let txid = context.rpc_server.tx(1, 0).txid(); @@ -2498,7 +2498,7 @@ mod tests { let spend_txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, Default::default())], fee: 0, - ..Default::default() + ..default() }); context.mine_blocks(1); assert_eq!( @@ -2517,7 +2517,7 @@ mod tests { let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("text/plain", "hello").to_witness())], - ..Default::default() + ..default() }); let inscription_id = InscriptionId { txid, index: 0 }; @@ -2542,14 +2542,14 @@ mod tests { context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, Default::default())], fee: 50 * 100_000_000, - ..Default::default() + ..default() }); context.mine_blocks(1); let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(2, 1, 0, inscription("text/plain", "hello").to_witness())], - ..Default::default() + ..default() }); let inscription_id = InscriptionId { txid, index: 0 }; @@ -2570,14 +2570,14 @@ mod tests { context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(4, 0, 0, Default::default())], fee: 50 * 100_000_000, - ..Default::default() + ..default() }); context.mine_blocks(1); let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(5, 1, 0, inscription("text/plain", "hello").to_witness())], - ..Default::default() + ..default() }); let inscription_id = InscriptionId { txid, index: 0 }; @@ -2602,7 +2602,7 @@ mod tests { let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("text/plain", "hello").to_witness())], - ..Default::default() + ..default() }); let inscription_id = InscriptionId { txid, index: 0 }; @@ -2619,7 +2619,7 @@ mod tests { let send_txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(2, 0, 0, Default::default()), (2, 1, 0, Default::default())], - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -2645,7 +2645,7 @@ mod tests { let first_txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("text/plain", "hello").to_witness())], - ..Default::default() + ..default() }); let first_inscription_id = InscriptionId { @@ -2655,7 +2655,7 @@ mod tests { let second_txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(2, 0, 0, inscription("text/png", [1; 100]).to_witness())], - ..Default::default() + ..default() }); let second_inscription_id = InscriptionId { txid: second_txid, @@ -2666,7 +2666,7 @@ mod tests { let merged_txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(3, 1, 0, Default::default()), (3, 2, 0, Default::default())], - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -2704,7 +2704,7 @@ mod tests { let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("text/plain", "hello").to_witness())], - ..Default::default() + ..default() }); let inscription_id = InscriptionId { txid, index: 0 }; @@ -2722,7 +2722,7 @@ mod tests { let send_txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(2, 0, 0, Default::default()), (2, 1, 0, Default::default())], outputs: 2, - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -2752,7 +2752,7 @@ mod tests { let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("text/plain", "hello").to_witness())], - ..Default::default() + ..default() }); let inscription_id = InscriptionId { txid, index: 0 }; @@ -2769,7 +2769,7 @@ mod tests { let send_txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(2, 0, 0, Default::default()), (2, 1, 0, Default::default())], - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -2795,7 +2795,7 @@ mod tests { let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("text/plain", "hello").to_witness())], - ..Default::default() + ..default() }); let inscription_id = InscriptionId { txid, index: 0 }; @@ -2804,7 +2804,7 @@ mod tests { context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(2, 1, 0, Default::default())], fee: 50 * COIN_VALUE, - ..Default::default() + ..default() }); let coinbase_tx = context.mine_blocks(1)[0].txdata[0].txid(); @@ -2830,7 +2830,7 @@ mod tests { let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("text/plain", "hello").to_witness())], - ..Default::default() + ..default() }); let inscription_id = InscriptionId { txid, index: 0 }; @@ -2839,7 +2839,7 @@ mod tests { context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(2, 0, 0, Default::default()), (3, 1, 0, Default::default())], fee: 50 * COIN_VALUE, - ..Default::default() + ..default() }); let coinbase_tx = context.mine_blocks(1)[0].txdata[0].txid(); @@ -2866,7 +2866,7 @@ mod tests { let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("text/plain", "hello").to_witness())], fee: 50 * COIN_VALUE, - ..Default::default() + ..default() }); let inscription_id = InscriptionId { txid, index: 0 }; @@ -2894,7 +2894,7 @@ mod tests { let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("text/plain", "hello").to_witness())], fee: 50 * COIN_VALUE, - ..Default::default() + ..default() }); let inscription_id = InscriptionId { txid, index: 0 }; @@ -2919,7 +2919,7 @@ mod tests { let first_txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("text/plain", "hello").to_witness())], fee: 50 * COIN_VALUE, - ..Default::default() + ..default() }); let first_inscription_id = InscriptionId { txid: first_txid, @@ -2932,7 +2932,7 @@ mod tests { let second_txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(3, 0, 0, inscription("text/plain", "hello").to_witness())], fee: 50 * COIN_VALUE, - ..Default::default() + ..default() }); let second_inscription_id = InscriptionId { txid: second_txid, @@ -3049,7 +3049,7 @@ mod tests { let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(2, 0, 0, inscription("text/plain", "hello").to_witness())], outputs: 2, - ..Default::default() + ..default() }); let inscription_id = InscriptionId { txid, index: 0 }; context.mine_blocks(1); @@ -3057,7 +3057,7 @@ mod tests { context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(3, 1, 1, Default::default()), (3, 1, 0, Default::default())], fee: 50 * COIN_VALUE, - ..Default::default() + ..default() }); context.mine_blocks_with_subsidy(1, 0); @@ -3081,7 +3081,7 @@ mod tests { inputs: &[(1, 0, 0, inscription("text/plain", "hello").to_witness())], outputs: 2, output_values: &[0, 50 * COIN_VALUE], - ..Default::default() + ..default() }); let inscription_id = InscriptionId { txid, index: 0 }; context.mine_blocks(1); @@ -3105,7 +3105,7 @@ mod tests { let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("text/plain", "hello").to_witness())], fee: 50 * COIN_VALUE, - ..Default::default() + ..default() }); let inscription_id = InscriptionId { txid, index: 0 }; context.mine_blocks_with_subsidy(1, 0); @@ -3213,7 +3213,7 @@ mod tests { let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("text/plain", "hello").to_witness())], - ..Default::default() + ..default() }); let inscription_id = InscriptionId { txid, index: 0 }; @@ -3238,7 +3238,7 @@ mod tests { let send_id = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(2, 1, 0, Default::default())], - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -3271,7 +3271,7 @@ mod tests { let first = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("text/plain", "hello").to_witness())], - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -3306,7 +3306,7 @@ mod tests { let second = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(2, 1, 0, inscription("text/plain", "hello").to_witness())], - ..Default::default() + ..default() }); let inscription_id = InscriptionId { @@ -3355,7 +3355,7 @@ mod tests { let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("text/plain", "hello").to_witness())], - ..Default::default() + ..default() }); let inscription_id = InscriptionId { txid, index: 0 }; @@ -3377,7 +3377,7 @@ mod tests { for i in 0..101 { let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(i + 1, 0, 0, inscription("text/plain", "hello").to_witness())], - ..Default::default() + ..default() }); context.mine_blocks(1); ids.push(InscriptionId { txid, index: 0 }); @@ -3411,7 +3411,7 @@ mod tests { let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, witness)], - ..Default::default() + ..default() }); let inscription_id = InscriptionId { txid, index: 0 }; @@ -3448,7 +3448,7 @@ mod tests { let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, witness)], - ..Default::default() + ..default() }); let inscription_id = InscriptionId { txid, index: 0 }; @@ -3483,7 +3483,7 @@ mod tests { let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, witness.clone())], - ..Default::default() + ..default() }); let inscription_id = InscriptionId { txid, index: 0 }; @@ -3496,7 +3496,7 @@ mod tests { let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(2, 0, 0, witness)], - ..Default::default() + ..default() }); let inscription_id = InscriptionId { txid, index: 0 }; @@ -3524,7 +3524,7 @@ mod tests { let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, witness)], - ..Default::default() + ..default() }); let inscription_id = InscriptionId { txid, index: 0 }; @@ -3544,7 +3544,7 @@ mod tests { let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, witness)], - ..Default::default() + ..default() }); let inscription_id = InscriptionId { txid, index: 0 }; @@ -3573,7 +3573,7 @@ mod tests { let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, witness)], - ..Default::default() + ..default() }); let inscription_id = InscriptionId { txid, index: 0 }; @@ -3603,7 +3603,7 @@ mod tests { let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, witness)], - ..Default::default() + ..default() }); let inscription_id = InscriptionId { txid, index: 0 }; @@ -3623,14 +3623,14 @@ mod tests { context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, Default::default())], fee: 50 * 100_000_000, - ..Default::default() + ..default() }); context.mine_blocks(1); let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(2, 1, 0, inscription("text/plain", "hello").to_witness())], - ..Default::default() + ..default() }); let inscription_id = InscriptionId { txid, index: 0 }; @@ -3659,7 +3659,7 @@ mod tests { context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, Default::default())], fee: 50 * 100_000_000, - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -3668,7 +3668,7 @@ mod tests { let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(2, 0, 0, witness.clone()), (2, 1, 0, witness.clone())], - ..Default::default() + ..default() }); let second_inscription_id = InscriptionId { txid, index: 1 }; @@ -3703,7 +3703,7 @@ mod tests { (2, 0, 0, witness.clone()), (3, 0, 0, witness.clone()), ], - ..Default::default() + ..default() }); let first = InscriptionId { txid, index: 0 }; @@ -3781,7 +3781,7 @@ mod tests { let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, witness)], - ..Default::default() + ..default() }); let first = InscriptionId { txid, index: 0 }; @@ -3865,7 +3865,7 @@ mod tests { (2, 0, 0, witness.clone()), (3, 0, 0, witness.clone()), ], - ..Default::default() + ..default() }); let first = InscriptionId { txid, index: 0 }; // normal @@ -3965,7 +3965,7 @@ mod tests { let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, witness)], fee: 33, - ..Default::default() + ..default() }); let first = InscriptionId { txid, index: 0 }; @@ -4006,7 +4006,7 @@ mod tests { let cursed_txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, witness.clone()), (2, 0, 0, witness.clone())], outputs: 2, - ..Default::default() + ..default() }); let cursed = InscriptionId { @@ -4040,7 +4040,7 @@ mod tests { let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(3, 1, 1, witness)], - ..Default::default() + ..default() }); let reinscription_on_cursed = InscriptionId { txid, index: 0 }; @@ -4071,7 +4071,7 @@ mod tests { let cursed_txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, witness.clone()), (2, 0, 0, witness.clone())], outputs: 2, - ..Default::default() + ..default() }); let cursed = InscriptionId { @@ -4105,7 +4105,7 @@ mod tests { let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(3, 1, 1, witness)], - ..Default::default() + ..default() }); let reinscription_on_cursed = InscriptionId { txid, index: 0 }; @@ -4133,7 +4133,7 @@ mod tests { let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(4, 1, 0, witness)], - ..Default::default() + ..default() }); let second_reinscription_on_cursed = InscriptionId { txid, index: 0 }; @@ -4185,7 +4185,7 @@ mod tests { 0, inscription("text/plain;charset=utf-8", "hello").to_witness(), )], - ..Default::default() + ..default() }); let first = InscriptionId { txid, index: 0 }; @@ -4199,7 +4199,7 @@ mod tests { 0, inscription("text/plain;charset=utf-8", "hello").to_witness(), )], - ..Default::default() + ..default() }); let second = InscriptionId { txid, index: 0 }; @@ -4212,7 +4212,7 @@ mod tests { 0, inscription("text/plain;charset=utf-8", "hello").to_witness(), )], - ..Default::default() + ..default() }); let third = InscriptionId { txid, index: 0 }; @@ -4248,7 +4248,7 @@ mod tests { 0, inscription("text/plain;charset=utf-8", &format!("hello {}", i)).to_witness(), )], // for the first inscription use coinbase, otherwise use the previous tx - ..Default::default() + ..default() }); inscription_ids.push(InscriptionId { txid, index: 0 }); @@ -4297,7 +4297,7 @@ mod tests { 0, inscription("text/plain;charset=utf-8", "hello").to_witness(), )], - ..Default::default() + ..default() }); let first_id = InscriptionId { txid, index: 0 }; let first_location = SatPoint { @@ -4318,7 +4318,7 @@ mod tests { 0, inscription("text/plain;charset=utf-8", "hello").to_witness(), )], - ..Default::default() + ..default() }); let second_id = InscriptionId { txid, index: 0 }; let second_location = SatPoint { @@ -4357,7 +4357,7 @@ mod tests { 0, inscription("text/plain;charset=utf-8", "hello").to_witness(), )], - ..Default::default() + ..default() }); let first_id = InscriptionId { txid, index: 0 }; let first_location = SatPoint { @@ -4374,7 +4374,7 @@ mod tests { 0, inscription("text/plain;charset=utf-8", "hello").to_witness(), )], - ..Default::default() + ..default() }); let second_id = InscriptionId { txid, index: 0 }; let second_location = SatPoint { @@ -4420,7 +4420,7 @@ mod tests { 0, inscription("text/plain;charset=utf-8", "hello").to_witness(), )], - ..Default::default() + ..default() }); context.mine_blocks(11); @@ -4438,7 +4438,7 @@ mod tests { 0, inscription("text/plain;charset=utf-8", "hello").to_witness(), )], - ..Default::default() + ..default() }); let second_id = InscriptionId { txid, index: 0 }; @@ -4474,7 +4474,7 @@ mod tests { let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("text/plain", "hello").to_witness())], - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -4498,7 +4498,7 @@ mod tests { let parent_txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("text/plain", "hello").to_witness())], - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -4517,11 +4517,11 @@ mod tests { content_type: Some("text/plain".into()), body: Some("hello".into()), parents: vec![parent_inscription_id.value()], - ..Default::default() + ..default() } .to_witness(), )], - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -4545,7 +4545,7 @@ mod tests { let parent_txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("text/plain", "hello").to_witness())], - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -4564,11 +4564,11 @@ mod tests { content_type: Some("text/plain".into()), body: Some("hello".into()), parents: vec![parent_inscription_id.value()], - ..Default::default() + ..default() } .to_witness(), )], - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -4597,11 +4597,11 @@ mod tests { let parent_txid_a = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("text/plain", "hello").to_witness())], - ..Default::default() + ..default() }); let parent_txid_b = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(2, 0, 0, inscription("text/plain", "world").to_witness())], - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -4622,7 +4622,7 @@ mod tests { parent_inscription_id_a.value(), parent_inscription_id_b.value(), ], - ..Default::default() + ..default() }; let multi_parent_witness = multi_parent_inscription.to_witness(); @@ -4632,7 +4632,7 @@ mod tests { let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[revelation_input, parent_b_input], - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -4668,7 +4668,7 @@ mod tests { let parent_txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("text/plain", "hello").to_witness())], - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -4687,11 +4687,11 @@ mod tests { content_type: Some("text/plain".into()), body: Some("hello".into()), parents: vec![parent_inscription_id.value(), parent_inscription_id.value()], - ..Default::default() + ..default() } .to_witness(), )], - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -4720,7 +4720,7 @@ mod tests { let parent_txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("text/plain", "hello").to_witness())], - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -4745,11 +4745,11 @@ mod tests { content_type: Some("text/plain".into()), body: Some("hello".into()), parents: vec![parent_inscription_id.value(), trailing_zero_inscription_id], - ..Default::default() + ..default() } .to_witness(), )], - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -4778,15 +4778,15 @@ mod tests { let parent_txid_a = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("text/plain", "hello").to_witness())], - ..Default::default() + ..default() }); let parent_txid_b = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(2, 0, 0, inscription("text/plain", "world").to_witness())], - ..Default::default() + ..default() }); let parent_txid_c = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(3, 0, 0, inscription("text/plain", "wazzup").to_witness())], - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -4812,7 +4812,7 @@ mod tests { parent_inscription_id_b.value(), parent_inscription_id_c.value(), ], - ..Default::default() + ..default() }; let multi_parent_witness = multi_parent_inscription.to_witness(); @@ -4822,7 +4822,7 @@ mod tests { let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[revealing_parent_a_input, parent_c_input], - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -4865,15 +4865,15 @@ mod tests { let parent_txid_a = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("text/plain", "hello").to_witness())], - ..Default::default() + ..default() }); let parent_txid_b = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(2, 0, 0, inscription("text/plain", "world").to_witness())], - ..Default::default() + ..default() }); let parent_txid_c = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(3, 0, 0, inscription("text/plain", "wazzup").to_witness())], - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -4905,7 +4905,7 @@ mod tests { malformed_inscription_id_b, parent_inscription_id_c.value(), ], - ..Default::default() + ..default() }; let multi_parent_witness = multi_parent_inscription.to_witness(); @@ -4915,7 +4915,7 @@ mod tests { let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[revealing_parent_a_input, parent_b_input, parent_c_input], - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -4958,7 +4958,7 @@ mod tests { let parent_txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("text/plain", "hello").to_witness())], - ..Default::default() + ..default() }); context.mine_blocks(2); @@ -4979,12 +4979,12 @@ mod tests { content_type: Some("text/plain".into()), body: Some("hello".into()), parents: vec![parent_inscription_id.value()], - ..Default::default() + ..default() } .to_witness(), ), ], - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -5013,7 +5013,7 @@ mod tests { let parent_txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("text/plain", "hello").to_witness())], - ..Default::default() + ..default() }); context.mine_blocks(2); @@ -5033,13 +5033,13 @@ mod tests { content_type: Some("text/plain".into()), body: Some("hello".into()), parents: vec![parent_inscription_id.value()], - ..Default::default() + ..default() } .to_witness(), ), (2, 1, 0, Default::default()), ], - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -5068,7 +5068,7 @@ mod tests { let parent_txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("text/plain", "hello").to_witness())], - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -5091,11 +5091,11 @@ mod tests { .into_iter() .chain(iter::once(0)) .collect()], - ..Default::default() + ..default() } .to_witness(), )], - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -5121,12 +5121,12 @@ mod tests { content_type: Some("text/plain".into()), body: Some("hello".into()), pointer: Some(100u64.to_le_bytes().to_vec()), - ..Default::default() + ..default() }; let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription.to_witness())], - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -5153,12 +5153,12 @@ mod tests { content_type: Some("text/plain".into()), body: Some("hello".into()), pointer: Some((50 * COIN_VALUE).to_le_bytes().to_vec()), - ..Default::default() + ..default() }; let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription.to_witness())], - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -5185,13 +5185,13 @@ mod tests { content_type: Some("text/plain".into()), body: Some("hello".into()), pointer: Some((25 * COIN_VALUE).to_le_bytes().to_vec()), - ..Default::default() + ..default() }; let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription.to_witness())], fee: 25 * COIN_VALUE, - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -5218,12 +5218,12 @@ mod tests { content_type: Some("text/plain".into()), body: Some("pointer-child".into()), pointer: Some(0u64.to_le_bytes().to_vec()), - ..Default::default() + ..default() }; let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription.to_witness())], - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -5250,7 +5250,7 @@ mod tests { let parent_txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("text/plain", "parent").to_witness())], - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -5265,12 +5265,12 @@ mod tests { body: Some("pointer-child".into()), parents: vec![parent_inscription_id.value()], pointer: Some(0u64.to_le_bytes().to_vec()), - ..Default::default() + ..default() }; let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(2, 1, 0, child_inscription.to_witness())], - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -5323,19 +5323,19 @@ mod tests { let builder = Inscription { pointer: Some(100u64.to_le_bytes().to_vec()), - ..Default::default() + ..default() } .append_reveal_script_to_builder(builder); let builder = Inscription { pointer: Some(300_000u64.to_le_bytes().to_vec()), - ..Default::default() + ..default() } .append_reveal_script_to_builder(builder); let builder = Inscription { pointer: Some(1_000_000u64.to_le_bytes().to_vec()), - ..Default::default() + ..default() } .append_reveal_script_to_builder(builder); @@ -5343,7 +5343,7 @@ mod tests { let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, witness)], - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -5390,19 +5390,19 @@ mod tests { let builder = Inscription { pointer: Some(100u64.to_le_bytes().to_vec()), - ..Default::default() + ..default() } .append_reveal_script_to_builder(builder); let builder = Inscription { pointer: Some(100_111u64.to_le_bytes().to_vec()), - ..Default::default() + ..default() } .append_reveal_script_to_builder(builder); let builder = Inscription { pointer: Some(299_999u64.to_le_bytes().to_vec()), - ..Default::default() + ..default() } .append_reveal_script_to_builder(builder); @@ -5411,7 +5411,7 @@ mod tests { let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, witness)], outputs: 3, - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -5458,21 +5458,21 @@ mod tests { content_type: Some("text/plain".into()), body: Some("hello jupiter".into()), pointer: Some((50 * COIN_VALUE).to_le_bytes().to_vec()), - ..Default::default() + ..default() }; let inscription_for_third_output = Inscription { content_type: Some("text/plain".into()), body: Some("hello mars".into()), pointer: Some((100 * COIN_VALUE).to_le_bytes().to_vec()), - ..Default::default() + ..default() }; let inscription_for_first_output = Inscription { content_type: Some("text/plain".into()), body: Some("hello world".into()), pointer: Some(0u64.to_le_bytes().to_vec()), - ..Default::default() + ..default() }; let txid = context.rpc_server.broadcast_tx(TransactionTemplate { @@ -5482,7 +5482,7 @@ mod tests { (3, 0, 0, inscription_for_first_output.to_witness()), ], outputs: 3, - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -5528,21 +5528,21 @@ mod tests { let first_inscription = Inscription { content_type: Some("text/plain".into()), body: Some("hello jupiter".into()), - ..Default::default() + ..default() }; let second_inscription = Inscription { content_type: Some("text/plain".into()), body: Some("hello mars".into()), pointer: Some(1u64.to_le_bytes().to_vec()), - ..Default::default() + ..default() }; let third_inscription = Inscription { content_type: Some("text/plain".into()), body: Some("hello world".into()), pointer: Some(2u64.to_le_bytes().to_vec()), - ..Default::default() + ..default() }; let txid = context.rpc_server.broadcast_tx(TransactionTemplate { @@ -5552,7 +5552,7 @@ mod tests { (3, 0, 0, third_inscription.to_witness()), ], outputs: 1, - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -5598,14 +5598,14 @@ mod tests { let inscription = Inscription { content_type: Some("text/plain".into()), body: Some("hello jupiter".into()), - ..Default::default() + ..default() }; let cursed_reinscription = Inscription { content_type: Some("text/plain".into()), body: Some("hello mars".into()), pointer: Some(0u64.to_le_bytes().to_vec()), - ..Default::default() + ..default() }; let txid = context.rpc_server.broadcast_tx(TransactionTemplate { @@ -5614,7 +5614,7 @@ mod tests { (2, 0, 0, cursed_reinscription.to_witness()), ], outputs: 2, - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -5659,7 +5659,7 @@ mod tests { let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription.to_witness())], fee: 50 * COIN_VALUE, - ..Default::default() + ..default() }); let blocks = context.mine_blocks(1); @@ -5690,7 +5690,7 @@ mod tests { let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription.to_witness())], fee: 50 * COIN_VALUE, - ..Default::default() + ..default() }); let blocks = context.mine_blocks_with_subsidy(1, 25 * COIN_VALUE); @@ -5732,7 +5732,7 @@ mod tests { let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, witness)], - ..Default::default() + ..default() }); let inscription_id = InscriptionId { txid, index: 0 }; @@ -5764,7 +5764,7 @@ mod tests { let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(2, 1, 0, inscription.to_witness())], - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -5796,7 +5796,7 @@ mod tests { let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(3, 1, 0, inscription.to_witness())], - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -5843,7 +5843,7 @@ mod tests { let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, witness)], - ..Default::default() + ..default() }); let inscription_id = InscriptionId { txid, index: 0 }; @@ -5875,7 +5875,7 @@ mod tests { let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(111, 1, 0, inscription.to_witness())], - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -5907,7 +5907,7 @@ mod tests { let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(112, 1, 0, inscription.to_witness())], - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -5952,7 +5952,7 @@ mod tests { context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, Default::default())], - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -5983,7 +5983,7 @@ mod tests { context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, Default::default())], - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -6007,7 +6007,7 @@ mod tests { context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, Default::default())], - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -6023,7 +6023,7 @@ mod tests { let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, Default::default())], - ..Default::default() + ..default() }); context.mine_blocks_with_update(1, false); @@ -6032,7 +6032,7 @@ mod tests { context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(2, 1, 0, Default::default())], - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -6062,7 +6062,7 @@ mod tests { context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, Default::default())], - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -6125,14 +6125,14 @@ mod tests { let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("text/plain", "hello").to_witness())], fee: 50 * COIN_VALUE, - ..Default::default() + ..default() }); let a = InscriptionId { txid, index: 0 }; let txid = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(2, 0, 0, inscription("text/plain", "hello").to_witness())], - ..Default::default() + ..default() }); let b = InscriptionId { txid, index: 0 }; @@ -6156,7 +6156,7 @@ mod tests { inputs: &[(1, 0, 0, inscription.to_witness())], fee: 0, outputs: 1, - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -6190,7 +6190,7 @@ mod tests { inputs: &[(2, 1, 0, Default::default())], fee: 0, outputs: 1, - ..Default::default() + ..default() }); context.mine_blocks(1); diff --git a/src/index/testing.rs b/src/index/testing.rs index d68014b2d8..0032a3e68f 100644 --- a/src/index/testing.rs +++ b/src/index/testing.rs @@ -160,7 +160,7 @@ impl Context { self.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(block_count, 0, 0, Witness::new())], p2tr: true, - ..Default::default() + ..default() }); self.mine_blocks(RUNE_COMMIT_INTERVAL.into()); @@ -191,7 +191,7 @@ impl Context { inputs: &[(block_count + 1, 1, 0, witness)], op_return: Some(runestone.encipher()), outputs, - ..Default::default() + ..default() }); self.mine_blocks(1); diff --git a/src/inscriptions/envelope.rs b/src/inscriptions/envelope.rs index da54535ec6..202c49f96f 100644 --- a/src/inscriptions/envelope.rs +++ b/src/inscriptions/envelope.rs @@ -326,9 +326,7 @@ mod tests { .into_bytes(), Vec::new() ])]), - vec![ParsedEnvelope { - ..Default::default() - }] + vec![ParsedEnvelope { ..default() }] ); } @@ -373,9 +371,9 @@ mod tests { vec![ParsedEnvelope { payload: Inscription { duplicate_field: true, - ..Default::default() + ..default() }, - ..Default::default() + ..default() }] ); } @@ -392,7 +390,7 @@ mod tests { ])]), vec![ParsedEnvelope { payload: inscription("text/plain;charset=utf-8", "ord"), - ..Default::default() + ..default() }] ); } @@ -414,7 +412,7 @@ mod tests { content_encoding: Some("br".as_bytes().to_vec()), ..inscription("text/plain;charset=utf-8", "ord") }, - ..Default::default() + ..default() }] ); } @@ -433,7 +431,7 @@ mod tests { ])]), vec![ParsedEnvelope { payload: inscription("text/plain;charset=utf-8", "ord"), - ..Default::default() + ..default() }] ); } @@ -449,9 +447,9 @@ mod tests { vec![ParsedEnvelope { payload: Inscription { content_type: Some(b"text/plain;charset=utf-8".to_vec()), - ..Default::default() + ..default() }, - ..Default::default() + ..default() }], ); } @@ -463,9 +461,9 @@ mod tests { vec![ParsedEnvelope { payload: Inscription { body: Some(b"foo".to_vec()), - ..Default::default() + ..default() }, - ..Default::default() + ..default() }], ); } @@ -483,7 +481,7 @@ mod tests { ])]), vec![ParsedEnvelope { payload: inscription("text/plain;charset=utf-8", "foobar"), - ..Default::default() + ..default() }], ); } @@ -499,7 +497,7 @@ mod tests { ])]), vec![ParsedEnvelope { payload: inscription("text/plain;charset=utf-8", ""), - ..Default::default() + ..default() }] ); } @@ -520,7 +518,7 @@ mod tests { ])]), vec![ParsedEnvelope { payload: inscription("text/plain;charset=utf-8", ""), - ..Default::default() + ..default() }], ); } @@ -543,7 +541,7 @@ mod tests { parse(&[Witness::from_slice(&[script.into_bytes(), Vec::new()])]), vec![ParsedEnvelope { payload: inscription("text/plain;charset=utf-8", "ord"), - ..Default::default() + ..default() }], ); } @@ -566,7 +564,7 @@ mod tests { parse(&[Witness::from_slice(&[script.into_bytes(), Vec::new()])]), vec![ParsedEnvelope { payload: inscription("text/plain;charset=utf-8", "ord"), - ..Default::default() + ..default() }], ); } @@ -597,12 +595,12 @@ mod tests { vec![ ParsedEnvelope { payload: inscription("text/plain;charset=utf-8", "foo"), - ..Default::default() + ..default() }, ParsedEnvelope { payload: inscription("text/plain;charset=utf-8", "bar"), offset: 1, - ..Default::default() + ..default() }, ], ); @@ -620,7 +618,7 @@ mod tests { ])]), vec![ParsedEnvelope { payload: inscription("text/plain;charset=utf-8", [0b10000000]), - ..Default::default() + ..default() },], ); } @@ -675,7 +673,7 @@ mod tests { ])]), vec![ParsedEnvelope { payload: inscription("text/plain;charset=utf-8", "ord"), - ..Default::default() + ..default() }], ); } @@ -687,7 +685,7 @@ mod tests { vec![ParsedEnvelope { payload: inscription("foo", [1; 1040]), input: 1, - ..Default::default() + ..default() }] ); } @@ -706,12 +704,12 @@ mod tests { vec![ ParsedEnvelope { payload: inscription("foo", [1; 100]), - ..Default::default() + ..default() }, ParsedEnvelope { payload: inscription("bar", [1; 100]), offset: 1, - ..Default::default() + ..default() } ] ); @@ -729,7 +727,7 @@ mod tests { ])]), vec![ParsedEnvelope { payload: inscription("image/png", [1; 100]), - ..Default::default() + ..default() }] ); } @@ -746,7 +744,7 @@ mod tests { parse(&[witness]), vec![ParsedEnvelope { payload: inscription("foo", [1; 1040]), - ..Default::default() + ..default() }] ); } @@ -763,7 +761,7 @@ mod tests { parse(&[witness]), vec![ParsedEnvelope { payload: Inscription::default(), - ..Default::default() + ..default() }], ); } @@ -774,7 +772,7 @@ mod tests { parse(&[envelope(&[&PROTOCOL_ID, &Tag::Nop.bytes(), &[0]])]), vec![ParsedEnvelope { payload: Inscription::default(), - ..Default::default() + ..default() }], ); } @@ -786,9 +784,9 @@ mod tests { vec![ParsedEnvelope { payload: Inscription { unrecognized_even_field: true, - ..Default::default() + ..default() }, - ..Default::default() + ..default() }], ); } @@ -800,9 +798,9 @@ mod tests { vec![ParsedEnvelope { payload: Inscription { pointer: Some(vec![1]), - ..Default::default() + ..default() }, - ..Default::default() + ..default() }], ); } @@ -816,9 +814,9 @@ mod tests { pointer: Some(vec![1]), duplicate_field: true, unrecognized_even_field: true, - ..Default::default() + ..default() }, - ..Default::default() + ..default() }], ); } @@ -830,9 +828,9 @@ mod tests { vec![ParsedEnvelope { payload: Inscription { unrecognized_even_field: true, - ..Default::default() + ..default() }, - ..Default::default() + ..default() }], ); } @@ -844,9 +842,9 @@ mod tests { vec![ParsedEnvelope { payload: Inscription { incomplete_field: true, - ..Default::default() + ..default() }, - ..Default::default() + ..default() }], ); } @@ -858,9 +856,9 @@ mod tests { vec![ParsedEnvelope { payload: Inscription { metadata: Some(Vec::new()), - ..Default::default() + ..default() }, - ..Default::default() + ..default() }] ); } @@ -879,9 +877,9 @@ mod tests { payload: Inscription { metadata: Some(vec![0, 1]), duplicate_field: true, - ..Default::default() + ..default() }, - ..Default::default() + ..default() }] ); } @@ -923,10 +921,10 @@ mod tests { vec![ParsedEnvelope { payload: Inscription { body: Some(vec![value]), - ..Default::default() + ..default() }, pushnum: true, - ..Default::default() + ..default() }], ); } @@ -947,7 +945,7 @@ mod tests { vec![ParsedEnvelope { payload: Default::default(), stutter: true, - ..Default::default() + ..default() }], ); @@ -965,7 +963,7 @@ mod tests { vec![ParsedEnvelope { payload: Default::default(), stutter: true, - ..Default::default() + ..default() }], ); @@ -985,7 +983,7 @@ mod tests { vec![ParsedEnvelope { payload: Default::default(), stutter: true, - ..Default::default() + ..default() }], ); @@ -1004,7 +1002,7 @@ mod tests { vec![ParsedEnvelope { payload: Default::default(), stutter: false, - ..Default::default() + ..default() }], ); } diff --git a/src/inscriptions/inscription.rs b/src/inscriptions/inscription.rs index f764f5ed96..022bd17008 100644 --- a/src/inscriptions/inscription.rs +++ b/src/inscriptions/inscription.rs @@ -33,7 +33,7 @@ impl Inscription { Self { content_type, body, - ..Default::default() + ..default() } } @@ -67,7 +67,7 @@ impl Inscription { mode: compression_mode, quality: 11, size_hint: body.len(), - ..Default::default() + ..default() }, ) .write_all(&body)?; @@ -107,7 +107,7 @@ impl Inscription { parents: parents.iter().map(|parent| parent.value()).collect(), pointer: pointer.map(Self::pointer_value), rune: rune.map(|rune| rune.commitment()), - ..Default::default() + ..default() }) } @@ -373,7 +373,7 @@ mod tests { assert_eq!( Inscription { metadata: None, - ..Default::default() + ..default() } .append_reveal_script(script::Builder::new()) .instructions() @@ -384,7 +384,7 @@ mod tests { assert_eq!( Inscription { metadata: Some(Vec::new()), - ..Default::default() + ..default() } .append_reveal_script(script::Builder::new()) .instructions() @@ -395,7 +395,7 @@ mod tests { assert_eq!( Inscription { metadata: Some(vec![0; 1]), - ..Default::default() + ..default() } .append_reveal_script(script::Builder::new()) .instructions() @@ -406,7 +406,7 @@ mod tests { assert_eq!( Inscription { metadata: Some(vec![0; 520]), - ..Default::default() + ..default() } .append_reveal_script(script::Builder::new()) .instructions() @@ -417,7 +417,7 @@ mod tests { assert_eq!( Inscription { metadata: Some(vec![0; 521]), - ..Default::default() + ..default() } .append_reveal_script(script::Builder::new()) .instructions() @@ -430,7 +430,7 @@ mod tests { fn inscription_with_no_parent_field_has_no_parent() { assert!(Inscription { parents: Vec::new(), - ..Default::default() + ..default() } .parents() .is_empty()); @@ -440,7 +440,7 @@ mod tests { fn inscription_with_parent_field_shorter_than_txid_length_has_no_parent() { assert!(Inscription { parents: vec![Vec::new()], - ..Default::default() + ..default() } .parents() .is_empty()); @@ -450,7 +450,7 @@ mod tests { fn inscription_with_parent_field_longer_than_txid_and_index_has_no_parent() { assert!(Inscription { parents: vec![vec![1; 37]], - ..Default::default() + ..default() } .parents() .is_empty()); @@ -464,7 +464,7 @@ mod tests { assert!(!Inscription { parents: vec![parent], - ..Default::default() + ..default() } .parents() .is_empty()); @@ -478,7 +478,7 @@ mod tests { assert!(Inscription { parents: vec![parent], - ..Default::default() + ..default() } .parents() .is_empty()); @@ -493,7 +493,7 @@ mod tests { 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, ]), - ..Default::default() + ..default() } .delegate() .unwrap() @@ -513,7 +513,7 @@ mod tests { 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, ]], - ..Default::default() + ..default() } .parents(), [ @@ -529,7 +529,7 @@ mod tests { assert_eq!( Inscription { parents: vec![vec![1; 32]], - ..Default::default() + ..default() } .parents(), [ @@ -549,7 +549,7 @@ mod tests { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01 ]], - ..Default::default() + ..default() } .parents(), [ @@ -569,7 +569,7 @@ mod tests { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x02 ]], - ..Default::default() + ..default() } .parents(), [ @@ -589,7 +589,7 @@ mod tests { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x02, 0x03 ]], - ..Default::default() + ..default() } .parents(), [ @@ -609,7 +609,7 @@ mod tests { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x02, 0x03, 0x04, ]], - ..Default::default() + ..default() } .parents(), [ @@ -636,7 +636,7 @@ mod tests { 0xff, 0xff, 0xff, 0xff, 0x00, 0x02, 0x03, 0x04, ] ], - ..Default::default() + ..default() } .parents(), [ @@ -655,7 +655,7 @@ mod tests { assert_eq!( Inscription { metadata: Some(vec![0x44, 0, 1, 2, 3]), - ..Default::default() + ..default() } .metadata() .unwrap(), @@ -668,7 +668,7 @@ mod tests { assert_eq!( Inscription { metadata: None, - ..Default::default() + ..default() } .metadata(), None, @@ -680,7 +680,7 @@ mod tests { assert_eq!( Inscription { metadata: Some(vec![0x44]), - ..Default::default() + ..default() } .metadata(), None, @@ -692,7 +692,7 @@ mod tests { assert_eq!( Inscription { pointer: None, - ..Default::default() + ..default() } .pointer(), None @@ -700,7 +700,7 @@ mod tests { assert_eq!( Inscription { pointer: Some(vec![0]), - ..Default::default() + ..default() } .pointer(), Some(0), @@ -708,7 +708,7 @@ mod tests { assert_eq!( Inscription { pointer: Some(vec![1, 2, 3, 4, 5, 6, 7, 8]), - ..Default::default() + ..default() } .pointer(), Some(0x0807060504030201), @@ -716,7 +716,7 @@ mod tests { assert_eq!( Inscription { pointer: Some(vec![1, 2, 3, 4, 5, 6]), - ..Default::default() + ..default() } .pointer(), Some(0x0000060504030201), @@ -724,7 +724,7 @@ mod tests { assert_eq!( Inscription { pointer: Some(vec![1, 2, 3, 4, 5, 6, 7, 8, 0, 0, 0, 0, 0]), - ..Default::default() + ..default() } .pointer(), Some(0x0807060504030201), @@ -732,7 +732,7 @@ mod tests { assert_eq!( Inscription { pointer: Some(vec![1, 2, 3, 4, 5, 6, 7, 8, 0, 0, 0, 0, 1]), - ..Default::default() + ..default() } .pointer(), None, @@ -740,7 +740,7 @@ mod tests { assert_eq!( Inscription { pointer: Some(vec![1, 2, 3, 4, 5, 6, 7, 8, 1]), - ..Default::default() + ..default() } .pointer(), None, @@ -752,7 +752,7 @@ mod tests { assert_eq!( Inscription { pointer: None, - ..Default::default() + ..default() } .to_witness(), envelope(&[b"ord"]), @@ -761,7 +761,7 @@ mod tests { assert_eq!( Inscription { pointer: Some(vec![1, 2, 3]), - ..Default::default() + ..default() } .to_witness(), envelope(&[b"ord", &[2], &[1, 2, 3]]), @@ -843,7 +843,7 @@ mod tests { Inscription { content_type: content_type.map(|content_type| content_type.as_bytes().into()), body: body.map(|content_type| content_type.as_bytes().into()), - ..Default::default() + ..default() } .hidden(), expected @@ -900,7 +900,7 @@ mod tests { assert!(Inscription { content_type: Some("text/plain".as_bytes().into()), body: Some(b"{\xc3\x28}".as_slice().into()), - ..Default::default() + ..default() } .hidden()); @@ -908,7 +908,7 @@ mod tests { content_type: Some("text/html".as_bytes().into()), body: Some("hello".as_bytes().into()), metaprotocol: Some(Vec::new()), - ..Default::default() + ..default() } .hidden()); } diff --git a/src/lib.rs b/src/lib.rs index e3c1797efc..64248d4bec 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -165,7 +165,7 @@ fn fund_raw_transaction( // by 1000. fee_rate: Some(Amount::from_sat((fee_rate.n() * 1000.0).ceil() as u64)), change_position: Some(unfunded_transaction.output.len().try_into()?), - ..Default::default() + ..default() }), Some(false), ) @@ -204,6 +204,10 @@ fn uncheck(address: &Address) -> Address { address.to_string().parse().unwrap() } +fn default() -> T { + Default::default() +} + pub fn parse_ord_server_args(args: &str) -> (Settings, subcommand::server::Server) { match Arguments::try_parse_from(args.split_whitespace()) { Ok(arguments) => match arguments.subcommand { diff --git a/src/runes.rs b/src/runes.rs index 98185e53d2..1ed1d22886 100644 --- a/src/runes.rs +++ b/src/runes.rs @@ -69,9 +69,9 @@ mod tests { Runestone { etching: Some(Etching { rune: Some(Rune(RUNE)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -90,7 +90,7 @@ mod tests { context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, Witness::new())], op_return: Some(Runestone::default().encipher()), - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -106,9 +106,9 @@ mod tests { Runestone { etching: Some(Etching { rune: Some(Rune(RUNE)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -123,7 +123,7 @@ mod tests { spacers: 0, }, timestamp: id.block, - ..Default::default() + ..default() }, )], [], @@ -143,9 +143,9 @@ mod tests { }], etching: Some(Etching { rune: Some(Rune(RUNE)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -162,7 +162,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id.block, - ..Default::default() + ..default() }, )], [(OutPoint { txid, vout: 0 }, vec![(id, u128::MAX)])], @@ -188,9 +188,9 @@ mod tests { }], etching: Some(Etching { rune: Some(Rune(minimum - 1)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -213,9 +213,9 @@ mod tests { }], etching: Some(Etching { rune: Some(Rune(minimum)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -232,7 +232,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id.block, - ..Default::default() + ..default() }, )], [(OutPoint { txid, vout: 0 }, vec![(id, u128::MAX)])], @@ -254,9 +254,9 @@ mod tests { }], etching: Some(Etching { rune: Some(Rune(RESERVED)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -276,9 +276,9 @@ mod tests { }], etching: Some(Etching { rune: Some(Rune(RESERVED - 1)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -295,7 +295,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id.block, - ..Default::default() + ..default() }, )], [(OutPoint { txid, vout: 0 }, vec![(id, u128::MAX)])], @@ -321,13 +321,13 @@ mod tests { }], etching: Some(Etching { rune: None, - ..Default::default() + ..default() }), - ..Default::default() + ..default() } .encipher(), ), - ..Default::default() + ..default() }); let id0 = RuneId { block: 2, tx: 1 }; @@ -346,7 +346,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: 2, - ..Default::default() + ..default() }, )], [( @@ -371,13 +371,13 @@ mod tests { }], etching: Some(Etching { rune: None, - ..Default::default() + ..default() }), - ..Default::default() + ..default() } .encipher(), ), - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -397,7 +397,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: 2, - ..Default::default() + ..default() }, ), ( @@ -412,7 +412,7 @@ mod tests { supply: u128::MAX, timestamp: 4, number: 1, - ..Default::default() + ..default() }, ), ], @@ -449,9 +449,9 @@ mod tests { etching: Some(Etching { divisibility: 1, rune: Some(Rune(RUNE)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -471,7 +471,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id.block, - ..Default::default() + ..default() }, )], [(OutPoint { txid, vout: 0 }, vec![(id, u128::MAX)])], @@ -498,9 +498,9 @@ mod tests { ], etching: Some(Etching { rune: Some(Rune(RUNE)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -517,7 +517,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id.block, - ..Default::default() + ..default() }, )], [(OutPoint { txid, vout: 0 }, vec![(id, u128::MAX)])], @@ -544,9 +544,9 @@ mod tests { ], etching: Some(Etching { rune: Some(Rune(RUNE)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -564,7 +564,7 @@ mod tests { supply: u128::MAX, symbol: None, timestamp: id.block, - ..Default::default() + ..default() }, )], [(OutPoint { txid, vout: 0 }, vec![(id, u128::MAX)])], @@ -586,9 +586,9 @@ mod tests { }], etching: Some(Etching { rune: Some(Rune(RUNE)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -605,7 +605,7 @@ mod tests { premine: 100, supply: 100, timestamp: id.block, - ..Default::default() + ..default() }, )], [(OutPoint { txid, vout: 0 }, vec![(id, 100)])], @@ -632,9 +632,9 @@ mod tests { ], etching: Some(Etching { rune: Some(Rune(RUNE)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -652,7 +652,7 @@ mod tests { premine: 200, supply: 200, timestamp: id.block, - ..Default::default() + ..default() }, )], [(OutPoint { txid, vout: 0 }, vec![(id, 100)])], @@ -679,9 +679,9 @@ mod tests { ], etching: Some(Etching { rune: Some(Rune(RUNE)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -698,7 +698,7 @@ mod tests { premine: 0, supply: 0, timestamp: id.block, - ..Default::default() + ..default() }, )], [], @@ -718,9 +718,9 @@ mod tests { }], etching: Some(Etching { rune: Some(Rune(RUNE)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -737,7 +737,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id.block, - ..Default::default() + ..default() }, )], [( @@ -758,11 +758,11 @@ mod tests { amount: u128::MAX, output: 0, }], - ..Default::default() + ..default() } .encipher(), ), - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -779,7 +779,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id.block, - ..Default::default() + ..default() }, )], [( @@ -805,11 +805,11 @@ mod tests { }], etching: Some(Etching { rune: Some(Rune(RUNE)), - ..Default::default() + ..default() }), default_output: None, cenotaph: true, - ..Default::default() + ..default() }, 1, ); @@ -824,7 +824,7 @@ mod tests { spacers: 0, }, timestamp: id.block, - ..Default::default() + ..default() }, )], [], @@ -854,7 +854,7 @@ mod tests { spacers: 1, }), cenotaph: true, - ..Default::default() + ..default() }, 1, ); @@ -900,11 +900,11 @@ mod tests { }], etching: Some(Etching::default()), cenotaph: true, - ..Default::default() + ..default() } .encipher(), ), - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -921,7 +921,7 @@ mod tests { spacers: 0, }, timestamp: 2, - ..Default::default() + ..default() }, )], [], @@ -941,9 +941,9 @@ mod tests { }], etching: Some(Etching { rune: Some(Rune(RUNE)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -960,7 +960,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id.block, - ..Default::default() + ..default() }, )], [( @@ -977,11 +977,11 @@ mod tests { op_return: Some( Runestone { cenotaph: true, - ..Default::default() + ..default() } .encipher(), ), - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -999,7 +999,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id.block, - ..Default::default() + ..default() }, )], [], @@ -1019,9 +1019,9 @@ mod tests { }], etching: Some(Etching { rune: Some(Rune(RUNE)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -1038,7 +1038,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id.block, - ..Default::default() + ..default() }, )], [( @@ -1053,7 +1053,7 @@ mod tests { let txid1 = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(id.block.try_into().unwrap(), 1, 0, Witness::new())], op_return: Some(Runestone::default().encipher()), - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -1070,7 +1070,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id.block, - ..Default::default() + ..default() }, )], [( @@ -1096,9 +1096,9 @@ mod tests { }], etching: Some(Etching { rune: Some(Rune(RUNE)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -1115,7 +1115,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id.block, - ..Default::default() + ..default() }, )], [( @@ -1131,7 +1131,7 @@ mod tests { inputs: &[(id.block.try_into().unwrap(), 1, 0, Witness::new())], op_return: Some(Runestone::default().encipher()), outputs: 0, - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -1149,7 +1149,7 @@ mod tests { supply: u128::MAX, timestamp: id.block, burned: u128::MAX, - ..Default::default() + ..default() }, )], [], @@ -1169,9 +1169,9 @@ mod tests { }], etching: Some(Etching { rune: Some(Rune(RUNE)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -1188,7 +1188,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id.block, - ..Default::default() + ..default() }, )], [( @@ -1206,11 +1206,11 @@ mod tests { op_return: Some( Runestone { default_output: Some(1), - ..Default::default() + ..default() } .encipher(), ), - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -1227,7 +1227,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id.block, - ..Default::default() + ..default() }, )], [( @@ -1253,9 +1253,9 @@ mod tests { }], etching: Some(Etching { rune: Some(Rune(RUNE)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -1272,7 +1272,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id.block, - ..Default::default() + ..default() }, )], [( @@ -1290,11 +1290,11 @@ mod tests { op_return: Some( Runestone { default_output: Some(2), - ..Default::default() + ..default() } .encipher(), ), - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -1312,7 +1312,7 @@ mod tests { supply: u128::MAX, burned: u128::MAX, timestamp: id.block, - ..Default::default() + ..default() }, )], [], @@ -1333,9 +1333,9 @@ mod tests { }], etching: Some(Etching { rune: Some(Rune(RUNE)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -1352,7 +1352,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id.block, - ..Default::default() + ..default() }, )], [( @@ -1367,7 +1367,7 @@ mod tests { let txid1 = context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(id.block.try_into().unwrap(), 1, 0, Witness::new())], op_return: None, - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -1384,7 +1384,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id.block, - ..Default::default() + ..default() }, )], [( @@ -1410,9 +1410,9 @@ mod tests { }], etching: Some(Etching { rune: Some(Rune(RUNE)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -1429,7 +1429,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id.block, - ..Default::default() + ..default() }, )], [(OutPoint { txid, vout: 0 }, vec![(id, u128::MAX)])], @@ -1444,9 +1444,9 @@ mod tests { }], etching: Some(Etching { rune: Some(Rune(RUNE)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -1465,7 +1465,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id.block, - ..Default::default() + ..default() }, )], [(OutPoint { txid, vout: 0 }, vec![(id, u128::MAX)])], @@ -1485,9 +1485,9 @@ mod tests { }], etching: Some(Etching { rune: Some(Rune(RUNE)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -1504,7 +1504,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id0.block, - ..Default::default() + ..default() }, )], [( @@ -1525,9 +1525,9 @@ mod tests { }], etching: Some(Etching { rune: Some(Rune(RUNE + 1)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -1545,7 +1545,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id0.block, - ..Default::default() + ..default() }, ), ( @@ -1560,7 +1560,7 @@ mod tests { supply: u128::MAX, timestamp: id1.block, number: 1, - ..Default::default() + ..default() }, ), ], @@ -1587,7 +1587,7 @@ mod tests { (id0.block.try_into().unwrap(), 1, 0, Witness::new()), (id1.block.try_into().unwrap(), 1, 0, Witness::new()), ], - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -1605,7 +1605,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id0.block, - ..Default::default() + ..default() }, ), ( @@ -1620,7 +1620,7 @@ mod tests { supply: u128::MAX, timestamp: id1.block, number: 1, - ..Default::default() + ..default() }, ), ], @@ -1647,9 +1647,9 @@ mod tests { }], etching: Some(Etching { rune: Some(Rune(RUNE)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -1666,7 +1666,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id0.block, - ..Default::default() + ..default() }, )], [( @@ -1687,9 +1687,9 @@ mod tests { }], etching: Some(Etching { rune: Some(Rune(RUNE + 1)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -1707,7 +1707,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id0.block, - ..Default::default() + ..default() }, ), ( @@ -1722,7 +1722,7 @@ mod tests { supply: u128::MAX, timestamp: id1.block, number: 1, - ..Default::default() + ..default() }, ), ], @@ -1749,7 +1749,7 @@ mod tests { (id0.block.try_into().unwrap(), 1, 0, Witness::new()), (id1.block.try_into().unwrap(), 1, 0, Witness::new()), ], - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -1767,7 +1767,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id0.block, - ..Default::default() + ..default() }, ), ( @@ -1782,7 +1782,7 @@ mod tests { supply: u128::MAX, timestamp: id1.block, number: 1, - ..Default::default() + ..default() }, ), ], @@ -1812,11 +1812,11 @@ mod tests { output: 1, }, ], - ..Default::default() + ..default() } .encipher(), ), - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -1834,7 +1834,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id0.block, - ..Default::default() + ..default() }, ), ( @@ -1849,7 +1849,7 @@ mod tests { supply: u128::MAX, timestamp: id1.block, number: 1, - ..Default::default() + ..default() }, ), ], @@ -1885,9 +1885,9 @@ mod tests { }], etching: Some(Etching { rune: Some(Rune(RUNE)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -1904,7 +1904,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id0.block, - ..Default::default() + ..default() }, )], [( @@ -1925,9 +1925,9 @@ mod tests { }], etching: Some(Etching { rune: Some(Rune(RUNE + 1)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -1945,7 +1945,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id0.block, - ..Default::default() + ..default() }, ), ( @@ -1960,7 +1960,7 @@ mod tests { supply: u128::MAX, timestamp: id1.block, number: 1, - ..Default::default() + ..default() }, ), ], @@ -2001,11 +2001,11 @@ mod tests { output: 0, }, ], - ..Default::default() + ..default() } .encipher(), ), - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -2023,7 +2023,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id0.block, - ..Default::default() + ..default() }, ), ( @@ -2038,7 +2038,7 @@ mod tests { supply: u128::MAX, timestamp: id1.block, number: 1, - ..Default::default() + ..default() }, ), ], @@ -2066,9 +2066,9 @@ mod tests { }], etching: Some(Etching { rune: Some(Rune(RUNE)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -2085,7 +2085,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id.block, - ..Default::default() + ..default() }, )], [( @@ -2105,7 +2105,7 @@ mod tests { .into_script(), ), op_return_index: Some(0), - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -2122,7 +2122,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id.block, - ..Default::default() + ..default() }, )], [(OutPoint { txid, vout: 1 }, vec![(id, u128::MAX)])], @@ -2142,9 +2142,9 @@ mod tests { }], etching: Some(Etching { rune: Some(Rune(RUNE)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -2158,9 +2158,9 @@ mod tests { }], etching: Some(Etching { rune: Some(Rune(RUNE + 1)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -2178,7 +2178,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id0.block, - ..Default::default() + ..default() }, ), ( @@ -2193,7 +2193,7 @@ mod tests { supply: u128::MAX, timestamp: id1.block, number: 1, - ..Default::default() + ..default() }, ), ], @@ -2231,9 +2231,9 @@ mod tests { }], etching: Some(Etching { rune: Some(Rune(RUNE)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -2250,7 +2250,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id.block, - ..Default::default() + ..default() }, )], [( @@ -2278,11 +2278,11 @@ mod tests { output: 0, }, ], - ..Default::default() + ..default() } .encipher(), ), - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -2299,7 +2299,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id.block, - ..Default::default() + ..default() }, )], [( @@ -2325,9 +2325,9 @@ mod tests { }], etching: Some(Etching { rune: Some(Rune(RUNE)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -2344,7 +2344,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id0.block, - ..Default::default() + ..default() }, )], [( @@ -2365,9 +2365,9 @@ mod tests { }], etching: Some(Etching { rune: Some(Rune(RUNE + 1)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -2385,7 +2385,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id0.block, - ..Default::default() + ..default() }, ), ( @@ -2400,7 +2400,7 @@ mod tests { supply: u128::MAX, timestamp: id1.block, number: 1, - ..Default::default() + ..default() }, ), ], @@ -2438,11 +2438,11 @@ mod tests { output: 0, }, ], - ..Default::default() + ..default() } .encipher(), ), - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -2460,7 +2460,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id0.block, - ..Default::default() + ..default() }, ), ( @@ -2475,7 +2475,7 @@ mod tests { supply: u128::MAX, timestamp: id1.block, number: 1, - ..Default::default() + ..default() }, ), ], @@ -2511,9 +2511,9 @@ mod tests { }], etching: Some(Etching { rune: Some(Rune(RUNE)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -2530,7 +2530,7 @@ mod tests { premine: u128::MAX / 2, supply: u128::MAX / 2, timestamp: id.block, - ..Default::default() + ..default() }, )], [( @@ -2551,11 +2551,11 @@ mod tests { amount: u128::MAX, output: 0, }], - ..Default::default() + ..default() } .encipher(), ), - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -2572,7 +2572,7 @@ mod tests { premine: u128::MAX / 2, supply: u128::MAX / 2, timestamp: id.block, - ..Default::default() + ..default() }, )], [( @@ -2598,9 +2598,9 @@ mod tests { }], etching: Some(Etching { rune: Some(Rune(RUNE)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -2618,7 +2618,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id.block, - ..Default::default() + ..default() }, )], [], @@ -2638,9 +2638,9 @@ mod tests { }], etching: Some(Etching { rune: Some(Rune(RUNE)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -2657,7 +2657,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id.block, - ..Default::default() + ..default() }, )], [(OutPoint { txid, vout: 0 }, vec![(id, u128::MAX)])], @@ -2684,9 +2684,9 @@ mod tests { ], etching: Some(Etching { rune: Some(Rune(RUNE)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -2703,7 +2703,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id.block, - ..Default::default() + ..default() }, )], [(OutPoint { txid, vout: 0 }, vec![(id, u128::MAX)])], @@ -2723,9 +2723,9 @@ mod tests { }], etching: Some(Etching { rune: Some(Rune(RUNE)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 4, ); @@ -2742,7 +2742,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id.block, - ..Default::default() + ..default() }, )], [ @@ -2774,9 +2774,9 @@ mod tests { ], etching: Some(Etching { rune: Some(Rune(RUNE)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 4, ); @@ -2793,7 +2793,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id.block, - ..Default::default() + ..default() }, )], [ @@ -2837,9 +2837,9 @@ mod tests { ], etching: Some(Etching { rune: Some(Rune(RUNE)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 4, ); @@ -2856,7 +2856,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id.block, - ..Default::default() + ..default() }, )], [ @@ -2881,9 +2881,9 @@ mod tests { }], etching: Some(Etching { rune: Some(Rune(RUNE)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 4, ); @@ -2900,7 +2900,7 @@ mod tests { premine: 4000, supply: 4000, timestamp: id.block, - ..Default::default() + ..default() }, )], [ @@ -2932,9 +2932,9 @@ mod tests { ], etching: Some(Etching { rune: Some(Rune(RUNE)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 4, ); @@ -2951,7 +2951,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id.block, - ..Default::default() + ..default() }, )], [ @@ -2982,9 +2982,9 @@ mod tests { ], etching: Some(Etching { rune: Some(Rune(RUNE)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 4, ); @@ -3001,7 +3001,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id.block, - ..Default::default() + ..default() }, )], [ @@ -3029,9 +3029,9 @@ mod tests { }], etching: Some(Etching { rune: Some(Rune(RUNE)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -3048,7 +3048,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id.block, - ..Default::default() + ..default() }, )], [( @@ -3070,11 +3070,11 @@ mod tests { amount: 0, output: 3, }], - ..Default::default() + ..default() } .encipher(), ), - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -3091,7 +3091,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id.block, - ..Default::default() + ..default() }, )], [ @@ -3126,9 +3126,9 @@ mod tests { }], etching: Some(Etching { rune: Some(Rune(RUNE)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -3145,7 +3145,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id.block, - ..Default::default() + ..default() }, )], [( @@ -3174,11 +3174,11 @@ mod tests { output: 3, }, ], - ..Default::default() + ..default() } .encipher(), ), - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -3195,7 +3195,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id.block, - ..Default::default() + ..default() }, )], [ @@ -3230,9 +3230,9 @@ mod tests { }], etching: Some(Etching { rune: Some(Rune(RUNE)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -3249,7 +3249,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id.block, - ..Default::default() + ..default() }, )], [( @@ -3278,11 +3278,11 @@ mod tests { output: 1, }, ], - ..Default::default() + ..default() } .encipher(), ), - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -3299,7 +3299,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id.block, - ..Default::default() + ..default() }, )], [ @@ -3334,9 +3334,9 @@ mod tests { }], etching: Some(Etching { rune: Some(Rune(RUNE)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -3353,7 +3353,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id.block, - ..Default::default() + ..default() }, )], [( @@ -3375,11 +3375,11 @@ mod tests { amount: 1000, output: 3, }], - ..Default::default() + ..default() } .encipher(), ), - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -3396,7 +3396,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id.block, - ..Default::default() + ..default() }, )], [ @@ -3431,9 +3431,9 @@ mod tests { }], etching: Some(Etching { rune: Some(Rune(RUNE)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -3450,7 +3450,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id.block, - ..Default::default() + ..default() }, )], [( @@ -3479,11 +3479,11 @@ mod tests { output: 5, }, ], - ..Default::default() + ..default() } .encipher(), ), - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -3500,7 +3500,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id.block, - ..Default::default() + ..default() }, )], [ @@ -3535,9 +3535,9 @@ mod tests { }], etching: Some(Etching { rune: Some(Rune(RUNE)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -3554,7 +3554,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id.block, - ..Default::default() + ..default() }, )], [( @@ -3583,11 +3583,11 @@ mod tests { output: 0, }, ], - ..Default::default() + ..default() } .encipher(), ), - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -3604,7 +3604,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id.block, - ..Default::default() + ..default() }, )], [ @@ -3654,9 +3654,9 @@ mod tests { etching: Some(Etching { rune: Some(Rune(RUNE)), symbol: Some('$'), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -3674,7 +3674,7 @@ mod tests { supply: u128::MAX, symbol: Some('$'), timestamp: id.block, - ..Default::default() + ..default() }, )], [(OutPoint { txid, vout: 0 }, vec![(id, u128::MAX)])], @@ -3694,9 +3694,9 @@ mod tests { }], etching: Some(Etching { rune: Some(Rune(RUNE)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -3713,7 +3713,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id.block, - ..Default::default() + ..default() }, )], [(OutPoint { txid, vout: 0 }, vec![(id, u128::MAX)])], @@ -3733,9 +3733,9 @@ mod tests { }], etching: Some(Etching { rune: Some(Rune(RUNE)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -3752,7 +3752,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id.block, - ..Default::default() + ..default() }, )], [( @@ -3774,11 +3774,11 @@ mod tests { amount: 0, output: 1, }], - ..Default::default() + ..default() } .encipher(), ), - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -3795,7 +3795,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id.block, - ..Default::default() + ..default() }, )], [( @@ -3825,11 +3825,11 @@ mod tests { rune: Some(Rune(RUNE)), mint: Some(Mint { limit: Some(1000), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -3847,9 +3847,9 @@ mod tests { mints: 0, mint: Some(MintEntry { limit: Some(1000), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, )], [], @@ -3860,11 +3860,11 @@ mod tests { op_return: Some( Runestone { claim: Some(id), - ..Default::default() + ..default() } .encipher(), ), - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -3876,7 +3876,7 @@ mod tests { etching: txid0, mint: Some(MintEntry { limit: Some(1000), - ..Default::default() + ..default() }), mints: 1, spaced_rune: SpacedRune { @@ -3886,7 +3886,7 @@ mod tests { premine: 0, supply: 1000, timestamp: id.block, - ..Default::default() + ..default() }, )], [( @@ -3909,11 +3909,11 @@ mod tests { rune: Some(Rune(RUNE)), mint: Some(Mint { limit: Some(1000), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -3933,9 +3933,9 @@ mod tests { mints: 0, mint: Some(MintEntry { limit: Some(1000), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, )], [], @@ -3951,11 +3951,11 @@ mod tests { output: 0, }], claim: Some(id), - ..Default::default() + ..default() } .encipher(), ), - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -3967,7 +3967,7 @@ mod tests { etching: txid0, mint: Some(MintEntry { limit: Some(1000), - ..Default::default() + ..default() }), mints: 1, spaced_rune: SpacedRune { @@ -3977,7 +3977,7 @@ mod tests { premine: 0, supply: 1000, timestamp: id.block, - ..Default::default() + ..default() }, )], [( @@ -4000,11 +4000,11 @@ mod tests { output: 0, }], claim: Some(id), - ..Default::default() + ..default() } .encipher(), ), - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -4016,7 +4016,7 @@ mod tests { etching: txid0, mint: Some(MintEntry { limit: Some(1000), - ..Default::default() + ..default() }), mints: 2, spaced_rune: SpacedRune { @@ -4026,7 +4026,7 @@ mod tests { premine: 0, supply: 2000, timestamp: id.block, - ..Default::default() + ..default() }, )], [ @@ -4059,11 +4059,11 @@ mod tests { amount: 1000, output: 0, }], - ..Default::default() + ..default() } .encipher(), ), - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -4076,7 +4076,7 @@ mod tests { etching: txid0, mint: Some(MintEntry { limit: Some(1000), - ..Default::default() + ..default() }), mints: 3, spaced_rune: SpacedRune { @@ -4086,7 +4086,7 @@ mod tests { premine: 0, supply: 3000, timestamp: id.block, - ..Default::default() + ..default() }, )], [ @@ -4119,11 +4119,11 @@ mod tests { mint: Some(Mint { limit: Some(1000), term: Some(2), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -4140,10 +4140,10 @@ mod tests { mint: Some(MintEntry { limit: Some(1000), end: Some(id.block + 2), - ..Default::default() + ..default() }), timestamp: id.block, - ..Default::default() + ..default() }, )], [], @@ -4159,11 +4159,11 @@ mod tests { output: 0, }], claim: Some(id), - ..Default::default() + ..default() } .encipher(), ), - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -4180,13 +4180,13 @@ mod tests { mint: Some(MintEntry { limit: Some(1000), end: Some(id.block + 2), - ..Default::default() + ..default() }), premine: 0, supply: 1000, timestamp: id.block, mints: 1, - ..Default::default() + ..default() }, )], [( @@ -4208,11 +4208,11 @@ mod tests { output: 0, }], claim: Some(id), - ..Default::default() + ..default() } .encipher(), ), - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -4232,10 +4232,10 @@ mod tests { mint: Some(MintEntry { limit: Some(1000), end: Some(id.block + 2), - ..Default::default() + ..default() }), mints: 1, - ..Default::default() + ..default() }, )], [( @@ -4264,11 +4264,11 @@ mod tests { mint: Some(Mint { limit: Some(1000), term: Some(0), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -4285,12 +4285,12 @@ mod tests { mint: Some(MintEntry { limit: Some(1000), end: Some(id.block), - ..Default::default() + ..default() }), timestamp: id.block, premine: 1111, supply: 1111, - ..Default::default() + ..default() }, )], [(OutPoint { txid, vout: 0 }, vec![(id, 1111)])], @@ -4302,11 +4302,11 @@ mod tests { op_return: Some( Runestone { claim: Some(id), - ..Default::default() + ..default() } .encipher(), ), - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -4324,11 +4324,11 @@ mod tests { mint: Some(MintEntry { limit: Some(1000), end: Some(id.block), - ..Default::default() + ..default() }), premine: 1111, supply: 1111, - ..Default::default() + ..default() }, )], [(OutPoint { txid, vout: 0 }, vec![(id, 1111)])], @@ -4350,9 +4350,9 @@ mod tests { deadline: Some(12), term: Some(2), }), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -4372,7 +4372,7 @@ mod tests { end: Some(11), limit: Some(1000), }), - ..Default::default() + ..default() }, )], [], @@ -4383,11 +4383,11 @@ mod tests { op_return: Some( Runestone { claim: Some(id), - ..Default::default() + ..default() } .encipher(), ), - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -4410,7 +4410,7 @@ mod tests { end: Some(11), limit: Some(1000), }), - ..Default::default() + ..default() }, )], [( @@ -4427,11 +4427,11 @@ mod tests { op_return: Some( Runestone { claim: Some(id), - ..Default::default() + ..default() } .encipher(), ), - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -4454,7 +4454,7 @@ mod tests { end: Some(11), }), mints: 1, - ..Default::default() + ..default() }, )], [( @@ -4482,9 +4482,9 @@ mod tests { deadline: Some(11), term: Some(3), }), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -4504,7 +4504,7 @@ mod tests { end: Some(12), limit: Some(1000), }), - ..Default::default() + ..default() }, )], [], @@ -4515,11 +4515,11 @@ mod tests { op_return: Some( Runestone { claim: Some(id), - ..Default::default() + ..default() } .encipher(), ), - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -4542,7 +4542,7 @@ mod tests { end: Some(12), limit: Some(1000), }), - ..Default::default() + ..default() }, )], [( @@ -4559,11 +4559,11 @@ mod tests { op_return: Some( Runestone { claim: Some(id), - ..Default::default() + ..default() } .encipher(), ), - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -4586,7 +4586,7 @@ mod tests { end: Some(12), }), mints: 1, - ..Default::default() + ..default() }, )], [( @@ -4610,11 +4610,11 @@ mod tests { mint: Some(Mint { limit: Some(1000), deadline: Some(RUNE_COMMIT_INTERVAL + 4), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -4632,9 +4632,9 @@ mod tests { mint: Some(MintEntry { deadline: Some(id.block + 2), limit: Some(1000), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, )], [], @@ -4650,11 +4650,11 @@ mod tests { output: 0, }], claim: Some(id), - ..Default::default() + ..default() } .encipher(), ), - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -4674,9 +4674,9 @@ mod tests { mint: Some(MintEntry { deadline: Some(id.block + 2), limit: Some(1000), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, )], [( @@ -4698,11 +4698,11 @@ mod tests { output: 0, }], claim: Some(id), - ..Default::default() + ..default() } .encipher(), ), - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -4721,10 +4721,10 @@ mod tests { mint: Some(MintEntry { limit: Some(1000), deadline: Some(id.block + 2), - ..Default::default() + ..default() }), mints: 1, - ..Default::default() + ..default() }, )], [( @@ -4747,11 +4747,11 @@ mod tests { rune: Some(Rune(RUNE)), mint: Some(Mint { limit: Some(1000), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -4767,10 +4767,10 @@ mod tests { }, mint: Some(MintEntry { limit: Some(1000), - ..Default::default() + ..default() }), timestamp: id.block, - ..Default::default() + ..default() }, )], [], @@ -4787,11 +4787,11 @@ mod tests { output: 3, }], claim: Some(id), - ..Default::default() + ..default() } .encipher(), ), - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -4809,10 +4809,10 @@ mod tests { timestamp: id.block, mint: Some(MintEntry { limit: Some(1000), - ..Default::default() + ..default() }), mints: 1, - ..Default::default() + ..default() }, )], [ @@ -4844,16 +4844,16 @@ mod tests { rune: Some(Rune(RUNE)), mint: Some(Mint { limit: Some(1000), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }), edicts: vec![Edict { id: RuneId::default(), amount: 2000, output: 0, }], - ..Default::default() + ..default() }, 1, ); @@ -4869,12 +4869,12 @@ mod tests { }, mint: Some(MintEntry { limit: Some(1000), - ..Default::default() + ..default() }), timestamp: id.block, premine: 2000, supply: 2000, - ..Default::default() + ..default() }, )], [(OutPoint { txid, vout: 0 }, vec![(id, 2000)])], @@ -4891,11 +4891,11 @@ mod tests { rune: Some(Rune(RUNE)), mint: Some(Mint { term: Some(1), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -4912,10 +4912,10 @@ mod tests { mint: Some(MintEntry { limit: None, end: Some(id.block + 1), - ..Default::default() + ..default() }), timestamp: id.block, - ..Default::default() + ..default() }, )], [], @@ -4932,16 +4932,16 @@ mod tests { rune: Some(Rune(RUNE)), mint: Some(Mint { limit: Some(1000), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }), edicts: vec![Edict { id: RuneId::default(), amount: 2000, output: 0, }], - ..Default::default() + ..default() }, 1, ); @@ -4957,13 +4957,13 @@ mod tests { }, mint: Some(MintEntry { limit: Some(1000), - ..Default::default() + ..default() }), timestamp: rune_id.block, premine: 2000, supply: 2000, mints: 0, - ..Default::default() + ..default() }, )], [( @@ -4986,11 +4986,11 @@ mod tests { rune: Some(Rune(RUNE)), mint: Some(Mint { limit: Some(1000), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -5005,11 +5005,11 @@ mod tests { output: 0, }], claim: Some(id), - ..Default::default() + ..default() } .encipher(), ), - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -5025,12 +5025,12 @@ mod tests { }, mint: Some(MintEntry { limit: Some(1000), - ..Default::default() + ..default() }), timestamp: id.block, supply: 1000, mints: 1, - ..Default::default() + ..default() }, )], [( @@ -5053,11 +5053,11 @@ mod tests { rune: Some(Rune(RUNE)), mint: Some(Mint { limit: Some(1000), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, ); @@ -5073,10 +5073,10 @@ mod tests { }, mint: Some(MintEntry { limit: Some(1000), - ..Default::default() + ..default() }), timestamp: id.block, - ..Default::default() + ..default() }, )], [], @@ -5104,11 +5104,11 @@ mod tests { }, ], claim: Some(id), - ..Default::default() + ..default() } .encipher(), ), - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -5124,12 +5124,12 @@ mod tests { }, mint: Some(MintEntry { limit: Some(1000), - ..Default::default() + ..default() }), timestamp: id.block, supply: 1000, mints: 1, - ..Default::default() + ..default() }, )], [( @@ -5153,7 +5153,7 @@ mod tests { context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(block_count, 0, 0, Witness::new())], p2tr: false, - ..Default::default() + ..default() }); context.mine_blocks(RUNE_COMMIT_INTERVAL.into()); @@ -5165,11 +5165,11 @@ mod tests { rune: Some(Rune(RUNE)), mint: Some(Mint { limit: Some(1000), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }; let tapscript = script::Builder::new() @@ -5194,7 +5194,7 @@ mod tests { inputs: &[(block_count + 1, 1, 0, witness)], op_return: Some(runestone.encipher()), outputs: 1, - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -5213,7 +5213,7 @@ mod tests { context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(block_count, 0, 0, Witness::new())], p2tr: true, - ..Default::default() + ..default() }); context.mine_blocks((RUNE_COMMIT_INTERVAL - 1).into()); @@ -5225,11 +5225,11 @@ mod tests { rune: Some(Rune(RUNE)), mint: Some(Mint { limit: Some(1000), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }; let tapscript = script::Builder::new() @@ -5254,7 +5254,7 @@ mod tests { inputs: &[(block_count + 1, 1, 0, witness)], op_return: Some(runestone.encipher()), outputs: 1, - ..Default::default() + ..default() }); context.mine_blocks(1); @@ -5273,7 +5273,7 @@ mod tests { context.rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(block_count, 0, 0, Witness::new())], p2tr: true, - ..Default::default() + ..default() }); context.mine_blocks(RUNE_COMMIT_INTERVAL.into()); @@ -5285,11 +5285,11 @@ mod tests { rune: Some(Rune(RUNE)), mint: Some(Mint { limit: Some(1000), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }; let tapscript = script::Builder::new() @@ -5304,7 +5304,7 @@ mod tests { inputs: &[(block_count + 1, 1, 0, witness)], op_return: Some(runestone.encipher()), outputs: 1, - ..Default::default() + ..default() }); context.mine_blocks(1); diff --git a/src/runes/runestone.rs b/src/runes/runestone.rs index 589e78ab13..896a87cc92 100644 --- a/src/runes/runestone.rs +++ b/src/runes/runestone.rs @@ -82,7 +82,7 @@ impl Runestone { Some(Payload::Invalid) => { return Ok(Some(Self { cenotaph: true, - ..Default::default() + ..default() })) } None => return Ok(None), @@ -91,7 +91,7 @@ impl Runestone { let Some(integers) = Runestone::integers(&payload) else { return Ok(Some(Self { cenotaph: true, - ..Default::default() + ..default() })); }; @@ -509,7 +509,7 @@ mod tests { .unwrap(), Runestone { cenotaph: true, - ..Default::default() + ..default() } ); } @@ -578,7 +578,7 @@ mod tests { amount: 2, output: 0, }], - ..Default::default() + ..default() } ); } @@ -602,7 +602,7 @@ mod tests { output: 0, }], etching: Some(Etching::default()), - ..Default::default() + ..default() } ); } @@ -629,9 +629,9 @@ mod tests { }], etching: Some(Etching { rune: Some(Rune(4)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, ); } @@ -656,7 +656,7 @@ mod tests { amount: 2, output: 0, }], - ..Default::default() + ..default() }, ); } @@ -684,11 +684,11 @@ mod tests { etching: Some(Etching { mint: Some(Mint { term: Some(4), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, ); } @@ -716,11 +716,11 @@ mod tests { etching: Some(Etching { mint: Some(Mint { limit: Some(4), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, ); } @@ -745,7 +745,7 @@ mod tests { .unwrap(), Runestone { cenotaph: true, - ..Default::default() + ..default() } ); } @@ -774,10 +774,10 @@ mod tests { }], etching: Some(Etching { rune: Some(Rune(4)), - ..Default::default() + ..default() }), cenotaph: true, - ..Default::default() + ..default() } ); } @@ -807,9 +807,9 @@ mod tests { etching: Some(Etching { rune: None, divisibility: 4, - ..Default::default() + ..default() }), - ..Default::default() + ..default() } ); } @@ -824,7 +824,7 @@ mod tests { amount: 2, output: 0, }], - ..Default::default() + ..default() }, ); } @@ -840,7 +840,7 @@ mod tests { output: 0, }], cenotaph: true, - ..Default::default() + ..default() }, ); } @@ -864,7 +864,7 @@ mod tests { output: 0, }], cenotaph: true, - ..Default::default() + ..default() }, ); } @@ -876,7 +876,7 @@ mod tests { Runestone { edicts: Vec::new(), cenotaph: true, - ..Default::default() + ..default() }, ); } @@ -888,7 +888,7 @@ mod tests { Runestone { edicts: Vec::new(), cenotaph: true, - ..Default::default() + ..default() }, ); } @@ -900,7 +900,7 @@ mod tests { Runestone { etching: Some(Etching::default()), cenotaph: true, - ..Default::default() + ..default() }, ); } @@ -919,7 +919,7 @@ mod tests { amount: 2, output: 0, }], - ..Default::default() + ..default() } ); @@ -952,9 +952,9 @@ mod tests { etching: Some(Etching { rune: Some(Rune(4)), divisibility: 5, - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, ); } @@ -983,9 +983,9 @@ mod tests { }], etching: Some(Etching { rune: Some(Rune(4)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, ); } @@ -1011,7 +1011,7 @@ mod tests { output: 0, }], etching: Some(Etching::default()), - ..Default::default() + ..default() }, ); } @@ -1041,9 +1041,9 @@ mod tests { etching: Some(Etching { rune: Some(Rune(4)), symbol: Some('a'), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, ); } @@ -1091,7 +1091,7 @@ mod tests { symbol: Some('a'), spacers: 5, }), - ..Default::default() + ..default() }, ); } @@ -1122,7 +1122,7 @@ mod tests { amount: 2, output: 0, }], - ..Default::default() + ..default() }, ); } @@ -1155,9 +1155,9 @@ mod tests { rune: Some(Rune(4)), divisibility: 1, symbol: Some('a'), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, ); } @@ -1183,7 +1183,7 @@ mod tests { output: 0, }], etching: Some(Etching::default()), - ..Default::default() + ..default() }, ); } @@ -1205,7 +1205,7 @@ mod tests { output: 0, }, ], - ..Default::default() + ..default() }, ); } @@ -1221,7 +1221,7 @@ mod tests { output: 0, }], cenotaph: true, - ..Default::default() + ..default() }, ); } @@ -1237,7 +1237,7 @@ mod tests { output: 0, }], cenotaph: true, - ..Default::default() + ..default() }, ); } @@ -1294,9 +1294,9 @@ mod tests { }], etching: Some(Etching { divisibility: 5, - ..Default::default() + ..default() }), - ..Default::default() + ..default() })) ); } @@ -1333,7 +1333,7 @@ mod tests { amount: 2, output: 0, }], - ..Default::default() + ..default() })) ); } @@ -1373,7 +1373,7 @@ mod tests { amount: 2, output: 0, }], - ..Default::default() + ..default() })) ); } @@ -1386,7 +1386,7 @@ mod tests { Runestone { edicts, etching, - ..Default::default() + ..default() } .encipher() .len(), @@ -1400,7 +1400,7 @@ mod tests { Vec::new(), Some(Etching { rune: Some(Rune(0)), - ..Default::default() + ..default() }), 7, ); @@ -1410,7 +1410,7 @@ mod tests { Some(Etching { divisibility: MAX_DIVISIBILITY, rune: Some(Rune(0)), - ..Default::default() + ..default() }), 9, ); @@ -1435,7 +1435,7 @@ mod tests { Vec::new(), Some(Etching { rune: Some(Rune(u128::MAX)), - ..Default::default() + ..default() }), 25, ); @@ -1449,7 +1449,7 @@ mod tests { Some(Etching { divisibility: MAX_DIVISIBILITY, rune: Some(Rune(u128::MAX)), - ..Default::default() + ..default() }), 32, ); @@ -1463,7 +1463,7 @@ mod tests { Some(Etching { divisibility: MAX_DIVISIBILITY, rune: Some(Rune(u128::MAX)), - ..Default::default() + ..default() }), 50, ); @@ -1625,7 +1625,7 @@ mod tests { Runestone { etching: Some(Etching::default()), cenotaph: true, - ..Default::default() + ..default() }, ); } @@ -1745,7 +1745,7 @@ mod tests { spacers: 0, }), cenotaph: false, - ..Default::default() + ..default() }, &[Tag::Flags.into(), Flag::Etch.mask(), Tag::Rune.into(), 3], ); @@ -1760,7 +1760,7 @@ mod tests { spacers: 0, }), cenotaph: false, - ..Default::default() + ..default() }, &[Tag::Flags.into(), Flag::Etch.mask()], ); @@ -1768,7 +1768,7 @@ mod tests { case( Runestone { cenotaph: true, - ..Default::default() + ..default() }, &[Tag::Cenotaph.into(), 0], ); @@ -1785,7 +1785,7 @@ mod tests { }; 129 ], - ..Default::default() + ..default() } .encipher(); @@ -1800,7 +1800,7 @@ mod tests { }; 130 ], - ..Default::default() + ..default() } .encipher(); diff --git a/src/settings.rs b/src/settings.rs index eb5a456b91..7de414501d 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -599,7 +599,7 @@ mod tests { Settings::merge( Options { bitcoin_rpc_username: Some("foo".into()), - ..Default::default() + ..default() }, Default::default(), ) @@ -615,7 +615,7 @@ mod tests { Settings::merge( Options { bitcoin_rpc_password: Some("foo".into()), - ..Default::default() + ..default() }, Default::default(), ) @@ -909,7 +909,7 @@ mod tests { let config = Settings { bitcoin_rpc_username: Some("config_user".into()), bitcoin_rpc_password: Some("config_pass".into()), - ..Default::default() + ..default() }; let tempdir = TempDir::new().unwrap(); @@ -924,7 +924,7 @@ mod tests { bitcoin_rpc_username: Some("option_user".into()), bitcoin_rpc_password: Some("option_pass".into()), config: Some(config_path.clone()), - ..Default::default() + ..default() }, vec![ ("BITCOIN_RPC_USERNAME".into(), "env_user".into()), @@ -943,7 +943,7 @@ mod tests { Settings::merge( Options { config: Some(config_path.clone()), - ..Default::default() + ..default() }, vec![ ("BITCOIN_RPC_USERNAME".into(), "env_user".into()), @@ -962,7 +962,7 @@ mod tests { Settings::merge( Options { config: Some(config_path), - ..Default::default() + ..default() }, Default::default(), ) @@ -1133,7 +1133,7 @@ mod tests { let config = Settings { index: Some("config".into()), - ..Default::default() + ..default() }; let tempdir = TempDir::new().unwrap(); diff --git a/src/subcommand/server.rs b/src/subcommand/server.rs index d5c2a63504..071654151c 100644 --- a/src/subcommand/server.rs +++ b/src/subcommand/server.rs @@ -2115,7 +2115,7 @@ mod tests { self.bitcoin_rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(block_count, 0, 0, Default::default())], p2tr: true, - ..Default::default() + ..default() }); self.mine_blocks(RUNE_COMMIT_INTERVAL.into()); @@ -2144,7 +2144,7 @@ mod tests { inputs: &[(block_count + 1, 1, 0, witness)], op_return: Some(runestone.encipher()), outputs, - ..Default::default() + ..default() }); self.mine_blocks(1); @@ -2565,9 +2565,9 @@ mod tests { }], etching: Some(Etching { rune: Some(rune), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, None, @@ -2645,9 +2645,9 @@ mod tests { }], etching: Some(Etching { rune: Some(rune), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, None, @@ -2687,9 +2687,9 @@ mod tests { etching: Some(Etching { rune: Some(Rune(RUNE)), symbol: Some('%'), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, Default::default(), @@ -2709,7 +2709,7 @@ mod tests { supply: u128::MAX, timestamp: id.block, symbol: Some('%'), - ..Default::default() + ..default() } )] ); @@ -2753,9 +2753,9 @@ mod tests { etching: Some(Etching { rune: Some(rune), symbol: Some('%'), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, Some( @@ -2763,7 +2763,7 @@ mod tests { content_type: Some("text/plain".into()), body: Some("hello".into()), rune: Some(rune.commitment()), - ..Default::default() + ..default() } .to_witness(), ), @@ -2780,7 +2780,7 @@ mod tests { supply: u128::MAX, symbol: Some('%'), timestamp: id.block, - ..Default::default() + ..default() } )] ); @@ -2866,9 +2866,9 @@ mod tests { rune: Some(rune), symbol: Some('%'), spacers: 1, - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, Some( @@ -2876,7 +2876,7 @@ mod tests { content_type: Some("text/plain".into()), body: Some("hello".into()), rune: Some(rune.commitment()), - ..Default::default() + ..default() } .to_witness(), ), @@ -2893,7 +2893,7 @@ mod tests { supply: u128::MAX, symbol: Some('%'), timestamp: id.block, - ..Default::default() + ..default() } )] ); @@ -2964,9 +2964,9 @@ mod tests { }], etching: Some(Etching { rune: Some(Rune(RUNE)), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, None, @@ -2985,7 +2985,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id.block, - ..Default::default() + ..default() } )] ); @@ -3028,9 +3028,9 @@ mod tests { etching: Some(Etching { divisibility: 1, rune: Some(rune), - ..Default::default() + ..default() }), - ..Default::default() + ..default() }, 1, None, @@ -3047,7 +3047,7 @@ mod tests { premine: u128::MAX, supply: u128::MAX, timestamp: id.block, - ..Default::default() + ..default() } )] ); @@ -3143,7 +3143,7 @@ mod tests { 0, inscription("text/plain;charset=utf-8", "hello").to_witness(), )], - ..Default::default() + ..default() }); server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate { @@ -3153,7 +3153,7 @@ mod tests { 0, inscription("text/plain;charset=utf-8", "hello").to_witness(), )], - ..Default::default() + ..default() }); server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate { @@ -3163,7 +3163,7 @@ mod tests { 0, Inscription::new(None, Some("hello".as_bytes().into())).to_witness(), )], - ..Default::default() + ..default() }); server.mine_blocks(1); @@ -3502,7 +3502,7 @@ mod tests { server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, Default::default())], fee: 50 * 100_000_000, - ..Default::default() + ..default() }); server.mine_blocks(1); @@ -3514,7 +3514,7 @@ mod tests { 0, inscription("text/plain;charset=utf-8", "hello").to_witness(), )], - ..Default::default() + ..default() }); server.mine_blocks(1); @@ -3573,7 +3573,7 @@ mod tests { for i in 0..101 { let txid = server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(i + 1, 0, 0, inscription("image/png", "hello").to_witness())], - ..Default::default() + ..default() }); ids.push(InscriptionId { txid, index: 0 }); server.mine_blocks(1); @@ -3581,7 +3581,7 @@ mod tests { server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(102, 0, 0, inscription("text/plain", "{}").to_witness())], - ..Default::default() + ..default() }); server.mine_blocks(1); @@ -3712,7 +3712,7 @@ mod tests { let transaction = TransactionTemplate { inputs: &[(1, 0, 0, Default::default())], fee: 0, - ..Default::default() + ..default() }; test_server.bitcoin_rpc_server.broadcast_tx(transaction); let block_hash = test_server.mine_blocks(1)[0].block_hash(); @@ -3971,7 +3971,7 @@ mod tests { inputs: &[(1, 0, 0, Default::default())], outputs: 2, fee: 0, - ..Default::default() + ..default() }); server.mine_blocks(1); @@ -3995,7 +3995,7 @@ mod tests { inputs: &[(1, 0, 0, Default::default())], outputs: 2, fee: 2, - ..Default::default() + ..default() }); server.mine_blocks(1); @@ -4055,7 +4055,7 @@ mod tests { AcceptEncoding::default(), &ServerConfig { csp_origin: Some("https://ordinals.com".into()), - ..Default::default() + ..default() }, ) .unwrap() @@ -4073,7 +4073,7 @@ mod tests { let txid = server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("text/plain", "hello").to_witness())], - ..Default::default() + ..default() }); server.mine_blocks(1); @@ -4098,7 +4098,7 @@ mod tests { let txid = server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("text/plain", "hello").to_witness())], - ..Default::default() + ..default() }); server.mine_blocks(1); @@ -4126,7 +4126,7 @@ mod tests { 0, inscription("text/javascript", "hello").to_witness(), )], - ..Default::default() + ..default() }); let inscription_id = InscriptionId { txid, index: 0 }; @@ -4179,7 +4179,7 @@ mod tests { 0, inscription("text/plain;charset=utf-8", "hello").to_witness(), )], - ..Default::default() + ..default() }); let inscription_id = InscriptionId { txid, index: 0 }; @@ -4201,7 +4201,7 @@ mod tests { let txid = server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("audio/flac", "hello").to_witness())], - ..Default::default() + ..default() }); let inscription_id = InscriptionId { txid, index: 0 }; @@ -4221,7 +4221,7 @@ mod tests { let txid = server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("font/ttf", "hello").to_witness())], - ..Default::default() + ..default() }); let inscription_id = InscriptionId { txid, index: 0 }; @@ -4246,7 +4246,7 @@ mod tests { 0, inscription("application/pdf", "hello").to_witness(), )], - ..Default::default() + ..default() }); let inscription_id = InscriptionId { txid, index: 0 }; @@ -4266,7 +4266,7 @@ mod tests { let txid = server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("text/markdown", "hello").to_witness())], - ..Default::default() + ..default() }); let inscription_id = InscriptionId { txid, index: 0 }; @@ -4286,7 +4286,7 @@ mod tests { let txid = server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("image/png", "hello").to_witness())], - ..Default::default() + ..default() }); let inscription_id = InscriptionId { txid, index: 0 }; @@ -4312,7 +4312,7 @@ mod tests { 0, inscription("text/html;charset=utf-8", "hello").to_witness(), )], - ..Default::default() + ..default() }); server.mine_blocks(1); @@ -4332,7 +4332,7 @@ mod tests { let txid = server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("text/foo", "hello").to_witness())], - ..Default::default() + ..default() }); server.mine_blocks(1); @@ -4352,7 +4352,7 @@ mod tests { let txid = server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("video/webm", "hello").to_witness())], - ..Default::default() + ..default() }); let inscription_id = InscriptionId { txid, index: 0 }; @@ -4375,7 +4375,7 @@ mod tests { let txid = server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("text/foo", "hello").to_witness())], - ..Default::default() + ..default() }); server.mine_blocks(1); @@ -4397,7 +4397,7 @@ mod tests { let txid = server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("text/foo", "hello").to_witness())], - ..Default::default() + ..default() }); server.mine_blocks(1); @@ -4419,7 +4419,7 @@ mod tests { server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("text/foo", "hello").to_witness())], - ..Default::default() + ..default() }); server.mine_blocks(1); @@ -4447,7 +4447,7 @@ mod tests { let txid = server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("text/foo", "hello").to_witness())], - ..Default::default() + ..default() }); server.mine_blocks(1); @@ -4481,7 +4481,7 @@ mod tests { server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("text/foo", "hello").to_witness())], - ..Default::default() + ..default() }); server.mine_blocks(1); @@ -4508,7 +4508,7 @@ mod tests { 0, Inscription::new(Some("foo/bar".as_bytes().to_vec()), None).to_witness(), )], - ..Default::default() + ..default() }); let inscription_id = InscriptionId { txid, index: 0 }; @@ -4537,7 +4537,7 @@ mod tests { 0, Inscription::new(Some("image/png".as_bytes().to_vec()), None).to_witness(), )], - ..Default::default() + ..default() }); let inscription_id = InscriptionId { txid, index: 0 }; @@ -4558,7 +4558,7 @@ mod tests { let txid = server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("text/foo", "hello").to_witness())], - ..Default::default() + ..default() }); server.mine_blocks(1); @@ -4605,7 +4605,7 @@ mod tests { server.mine_blocks(1); server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(i + 1, 0, 0, inscription("text/foo", "hello").to_witness())], - ..Default::default() + ..default() }); } @@ -4629,7 +4629,7 @@ mod tests { server.mine_blocks(1); server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(i + 1, 0, 0, inscription("text/foo", "hello").to_witness())], - ..Default::default() + ..default() }); } @@ -4657,7 +4657,7 @@ mod tests { parent_ids.push(InscriptionId { txid: server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(i + 1, 0, 0, inscription("text/plain", "hello").to_witness())], - ..Default::default() + ..default() }), index: 0, }); @@ -4677,14 +4677,14 @@ mod tests { content_type: Some("text/plain".into()), body: Some("hello".into()), parents: vec![parent_id.value()], - ..Default::default() + ..default() } .to_witness(), ), ], outputs: 2, output_values: &[50 * COIN_VALUE, 50 * COIN_VALUE], - ..Default::default() + ..default() }); } @@ -4775,7 +4775,7 @@ next let parent_txid = server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("text/plain", "hello").to_witness())], - ..Default::default() + ..default() }); server.mine_blocks(1); @@ -4795,13 +4795,13 @@ next content_type: Some("text/plain".into()), body: Some("hello".into()), parents: vec![parent_inscription_id.value()], - ..Default::default() + ..default() } .to_witness(), ), (2, 1, 0, Default::default()), ], - ..Default::default() + ..default() }); server.mine_blocks(1); @@ -4841,7 +4841,7 @@ next let parent_txid = server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("text/plain", "hello").to_witness())], - ..Default::default() + ..default() }); server.mine_blocks(1); @@ -4867,13 +4867,13 @@ next content_type: Some("text/plain".into()), body: Some("hello".into()), parents: vec![parent_inscription_id.value()], - ..Default::default() + ..default() } .to_witness(), ), (2, 1, 0, Default::default()), ], - ..Default::default() + ..default() }); server.mine_blocks(1); @@ -4894,7 +4894,7 @@ next let parent_txid = server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("text/plain", "hello").to_witness())], - ..Default::default() + ..default() }); server.mine_blocks(6); @@ -4914,7 +4914,7 @@ next content_type: Some("text/plain".into()), body: Some("hello".into()), parents: vec![parent_inscription_id.value()], - ..Default::default() + ..default() } .to_witness(), ), @@ -4926,7 +4926,7 @@ next content_type: Some("text/plain".into()), body: Some("hello".into()), parents: vec![parent_inscription_id.value()], - ..Default::default() + ..default() } .to_witness(), ), @@ -4938,7 +4938,7 @@ next content_type: Some("text/plain".into()), body: Some("hello".into()), parents: vec![parent_inscription_id.value()], - ..Default::default() + ..default() } .to_witness(), ), @@ -4950,7 +4950,7 @@ next content_type: Some("text/plain".into()), body: Some("hello".into()), parents: vec![parent_inscription_id.value()], - ..Default::default() + ..default() } .to_witness(), ), @@ -4962,13 +4962,13 @@ next content_type: Some("text/plain".into()), body: Some("hello".into()), parents: vec![parent_inscription_id.value()], - ..Default::default() + ..default() } .to_witness(), ), (2, 1, 0, Default::default()), ], - ..Default::default() + ..default() }); server.mine_blocks(1); @@ -4996,12 +4996,12 @@ next let parent_a_txid = server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("text/plain", "hello").to_witness())], - ..Default::default() + ..default() }); let parent_b_txid = server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(2, 0, 0, inscription("text/plain", "hello").to_witness())], - ..Default::default() + ..default() }); server.mine_blocks(1); @@ -5029,14 +5029,14 @@ next parent_a_inscription_id.value(), parent_b_inscription_id.value(), ], - ..Default::default() + ..default() } .to_witness(), ), (3, 1, 0, Default::default()), (3, 2, 0, Default::default()), ], - ..Default::default() + ..default() }); server.mine_blocks(1); @@ -5063,7 +5063,7 @@ next InscriptionId { txid: server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(i + 1, 0, 0, inscription("text/plain", "hello").to_witness())], - ..Default::default() + ..default() }), index: 0, } @@ -5085,7 +5085,7 @@ next content_type: Some("text/plain".into()), body: Some("hello".into()), parents: parent_ids, - ..Default::default() + ..default() } .to_witness(), ), @@ -5093,7 +5093,7 @@ next let txid = server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate { inputs: &inputs, - ..Default::default() + ..default() }); server.mine_blocks(1); @@ -5130,7 +5130,7 @@ next (2, 0, 0, inscription("text/plain", "cursed").to_witness()), ], outputs: 2, - ..Default::default() + ..default() }); let inscription_id = InscriptionId { txid, index: 0 }; @@ -5183,7 +5183,7 @@ next (2, 0, 0, inscription("text/plain", "cursed").to_witness()), ], outputs: 2, - ..Default::default() + ..default() }); let id = InscriptionId { txid, index: 0 }; @@ -5222,7 +5222,7 @@ next (2, 0, 0, inscription("text/plain", "cursed").to_witness()), ], outputs: 2, - ..Default::default() + ..default() }); let id = InscriptionId { txid, index: 0 }; @@ -5258,7 +5258,7 @@ next let txid = server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("text/plain", "foo").to_witness())], - ..Default::default() + ..default() }); let id = InscriptionId { txid, index: 0 }; @@ -5294,7 +5294,7 @@ next let txid = server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("text/plain", "foo").to_witness())], - ..Default::default() + ..default() }); let id = InscriptionId { txid, index: 0 }; @@ -5330,7 +5330,7 @@ next let txid = server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(9, 0, 0, inscription("text/plain", "foo").to_witness())], - ..Default::default() + ..default() }); let id = InscriptionId { txid, index: 0 }; @@ -5363,14 +5363,14 @@ next server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("text/plain", "foo").to_witness())], - ..Default::default() + ..default() }); server.mine_blocks(1); let txid = server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(2, 1, 0, inscription("text/plain", "bar").to_witness())], - ..Default::default() + ..default() }); server.mine_blocks(1); @@ -5435,7 +5435,7 @@ next let txid = server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, witness)], - ..Default::default() + ..default() }); server.mine_blocks(1); @@ -5486,7 +5486,7 @@ next let cursed_inscription = inscription("text/plain", "bar"); let reinscription: Inscription = InscriptionTemplate { pointer: Some(0), - ..Default::default() + ..default() } .into(); @@ -5496,7 +5496,7 @@ next (2, 0, 0, cursed_inscription.to_witness()), (3, 0, 0, reinscription.to_witness()), ], - ..Default::default() + ..default() }); server.mine_blocks(1); @@ -5545,7 +5545,7 @@ next let txid = server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, envelope(&[b"ord", &[128], &[0]]))], - ..Default::default() + ..default() }); server.mine_blocks(1); @@ -5581,7 +5581,7 @@ next let txid = server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("text/plain", "foo").to_witness())], - ..Default::default() + ..default() }); let id = InscriptionId { txid, index: 0 }; @@ -5609,7 +5609,7 @@ next server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(2, 1, 0, Default::default())], fee: 50 * COIN_VALUE, - ..Default::default() + ..default() }); server.mine_blocks_with_subsidy(1, 0); @@ -5659,7 +5659,7 @@ next let txid = server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("text/plain", "foo").to_witness())], - ..Default::default() + ..default() }); server.mine_blocks(1); @@ -5670,7 +5670,7 @@ next for i in 1..111 { let txid = server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(i + 1, 1, 0, inscription("text/plain", "foo").to_witness())], - ..Default::default() + ..default() }); server.mine_blocks(1); @@ -5741,7 +5741,7 @@ next let parent_txid = server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("text/plain", "hello").to_witness())], - ..Default::default() + ..default() }); let parent_inscription_id = InscriptionId { @@ -5768,7 +5768,7 @@ next body: Some("hello".into()), parents: vec![parent_inscription_id.value()], unrecognized_even_field: false, - ..Default::default() + ..default() } .append_reveal_script_to_builder(builder); } @@ -5777,7 +5777,7 @@ next let txid = server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(2, 0, 0, witness), (2, 1, 0, Default::default())], - ..Default::default() + ..default() }); server.mine_blocks(1); @@ -5820,7 +5820,7 @@ next for i in 0..101 { server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(i + 1, 0, 0, inscription("text/foo", "hello").to_witness())], - ..Default::default() + ..default() }); } @@ -5881,12 +5881,12 @@ next let delegate = Inscription { content_type: Some("text/html".into()), body: Some("foo".into()), - ..Default::default() + ..default() }; let txid = server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, delegate.to_witness())], - ..Default::default() + ..default() }); let delegate = InscriptionId { txid, index: 0 }; @@ -5895,12 +5895,12 @@ next let inscription = Inscription { delegate: Some(delegate.value()), - ..Default::default() + ..default() }; let txid = server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(2, 0, 0, inscription.to_witness())], - ..Default::default() + ..default() }); server.mine_blocks(1); @@ -5938,12 +5938,12 @@ next let inscription = Inscription { content_type: Some("text/html".into()), body: Some("foo".into()), - ..Default::default() + ..default() }; let txid = server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription.to_witness())], - ..Default::default() + ..default() }); server.mine_blocks(1); @@ -6067,7 +6067,7 @@ next let txid = bitcoin_rpc_server.broadcast_tx(TransactionTemplate { inputs: &[(1, 0, 0, inscription("text/foo", "hello").to_witness())], - ..Default::default() + ..default() }); bitcoin_rpc_server.mine_blocks(1); diff --git a/src/subcommand/server/accept_encoding.rs b/src/subcommand/server/accept_encoding.rs index 0143339a59..5106eab882 100644 --- a/src/subcommand/server/accept_encoding.rs +++ b/src/subcommand/server/accept_encoding.rs @@ -59,7 +59,7 @@ mod tests { &Arc::new(ServerConfig { json_api_enabled: false, decompress: false, - ..Default::default() + ..default() }), ) .await @@ -80,7 +80,7 @@ mod tests { &Arc::new(ServerConfig { json_api_enabled: false, decompress: false, - ..Default::default() + ..default() }), ) .await @@ -109,7 +109,7 @@ mod tests { &Arc::new(ServerConfig { json_api_enabled: false, decompress: false, - ..Default::default() + ..default() }), ) .await diff --git a/src/subcommand/wallet/inscribe.rs b/src/subcommand/wallet/inscribe.rs index a97a484314..a7d69053fc 100644 --- a/src/subcommand/wallet/inscribe.rs +++ b/src/subcommand/wallet/inscribe.rs @@ -278,7 +278,7 @@ mod tests { reinscribe: false, postages: vec![TARGET_POSTAGE], mode: batch::Mode::SharedOutput, - ..Default::default() + ..default() } .create_batch_transactions( BTreeMap::new(), @@ -324,7 +324,7 @@ mod tests { reinscribe: false, postages: vec![TARGET_POSTAGE], mode: batch::Mode::SharedOutput, - ..Default::default() + ..default() } .create_batch_transactions( BTreeMap::new(), @@ -369,7 +369,7 @@ mod tests { reinscribe: false, postages: vec![TARGET_POSTAGE], mode: batch::Mode::SharedOutput, - ..Default::default() + ..default() } .create_batch_transactions( inscriptions, @@ -421,7 +421,7 @@ mod tests { reinscribe: false, postages: vec![TARGET_POSTAGE], mode: batch::Mode::SharedOutput, - ..Default::default() + ..default() } .create_batch_transactions( inscriptions, @@ -471,7 +471,7 @@ mod tests { reinscribe: false, postages: vec![TARGET_POSTAGE], mode: batch::Mode::SharedOutput, - ..Default::default() + ..default() } .create_batch_transactions( inscriptions, @@ -536,7 +536,7 @@ mod tests { let child_inscription = InscriptionTemplate { parents: vec![parent_inscription], - ..Default::default() + ..default() } .into(); @@ -559,7 +559,7 @@ mod tests { reinscribe: false, postages: vec![TARGET_POSTAGE], mode: batch::Mode::SharedOutput, - ..Default::default() + ..default() } .create_batch_transactions( inscriptions, @@ -604,7 +604,7 @@ mod tests { TxIn { previous_output: parent_info.location.outpoint, sequence: Sequence::ENABLE_RBF_NO_LOCKTIME, - ..Default::default() + ..default() } ); } @@ -646,7 +646,7 @@ mod tests { reinscribe: false, postages: vec![TARGET_POSTAGE], mode: batch::Mode::SharedOutput, - ..Default::default() + ..default() } .create_batch_transactions( inscriptions, @@ -705,7 +705,7 @@ mod tests { reinscribe: false, postages: vec![TARGET_POSTAGE], mode: batch::Mode::SharedOutput, - ..Default::default() + ..default() } .create_batch_transactions( BTreeMap::new(), @@ -746,7 +746,7 @@ mod tests { reinscribe: false, postages: vec![TARGET_POSTAGE], mode: batch::Mode::SharedOutput, - ..Default::default() + ..default() } .create_batch_transactions( BTreeMap::new(), @@ -829,16 +829,16 @@ inscriptions: batch::Entry { file: inscription_path, metadata: Some(Value::Mapping(metadata)), - ..Default::default() + ..default() }, batch::Entry { file: brc20_path, metaprotocol: Some("brc-20".to_string()), - ..Default::default() + ..default() } ], parent: Some(parent), - ..Default::default() + ..default() } ); } @@ -890,17 +890,17 @@ inscriptions: let inscriptions = vec![ InscriptionTemplate { parents: vec![parent], - ..Default::default() + ..default() } .into(), InscriptionTemplate { parents: vec![parent], - ..Default::default() + ..default() } .into(), InscriptionTemplate { parents: vec![parent], - ..Default::default() + ..default() } .into(), ]; @@ -924,7 +924,7 @@ inscriptions: reinscribe: false, postages: vec![Amount::from_sat(10_000); 3], mode, - ..Default::default() + ..default() } .create_batch_transactions( wallet_inscriptions, @@ -963,7 +963,7 @@ inscriptions: TxIn { previous_output: parent_info.location.outpoint, sequence: Sequence::ENABLE_RBF_NO_LOCKTIME, - ..Default::default() + ..default() } ); } @@ -1053,7 +1053,7 @@ inscriptions: Amount::from_sat(3_333), ], mode, - ..Default::default() + ..default() } .create_batch_transactions( wallet_inscriptions, @@ -1091,7 +1091,7 @@ inscriptions: TxIn { previous_output: parent_info.location.outpoint, sequence: Sequence::ENABLE_RBF_NO_LOCKTIME, - ..Default::default() + ..default() } ); } @@ -1124,17 +1124,17 @@ inscriptions: let inscriptions = vec![ InscriptionTemplate { parents: vec![parent], - ..Default::default() + ..default() } .into(), InscriptionTemplate { parents: vec![parent], - ..Default::default() + ..default() } .into(), InscriptionTemplate { parents: vec![parent], - ..Default::default() + ..default() } .into(), ]; @@ -1153,7 +1153,7 @@ inscriptions: reinscribe: false, postages: vec![Amount::from_sat(10_000); 3], mode: batch::Mode::SharedOutput, - ..Default::default() + ..default() } .create_batch_transactions( wallet_inscriptions, @@ -1201,17 +1201,17 @@ inscriptions: let inscriptions = vec![ InscriptionTemplate { parents: vec![parent], - ..Default::default() + ..default() } .into(), InscriptionTemplate { parents: vec![parent], - ..Default::default() + ..default() } .into(), InscriptionTemplate { parents: vec![parent], - ..Default::default() + ..default() } .into(), ]; @@ -1230,7 +1230,7 @@ inscriptions: reinscribe: false, postages: vec![Amount::from_sat(10_000)], mode: batch::Mode::SharedOutput, - ..Default::default() + ..default() } .create_batch_transactions( wallet_inscriptions, @@ -1269,7 +1269,7 @@ inscriptions: reinscribe: false, postages: vec![Amount::from_sat(30_000); 3], mode: batch::Mode::SharedOutput, - ..Default::default() + ..default() } .create_batch_transactions( wallet_inscriptions, @@ -1323,7 +1323,7 @@ inscriptions: reinscribe: false, postages: vec![Amount::from_sat(10_000); 3], mode, - ..Default::default() + ..default() } .create_batch_transactions( wallet_inscriptions, @@ -1374,17 +1374,17 @@ inscriptions: let inscriptions = vec![ InscriptionTemplate { parents: vec![parent], - ..Default::default() + ..default() } .into(), InscriptionTemplate { parents: vec![parent], - ..Default::default() + ..default() } .into(), InscriptionTemplate { parents: vec![parent], - ..Default::default() + ..default() } .into(), ]; @@ -1408,7 +1408,7 @@ inscriptions: reinscribe: false, postages: vec![Amount::from_sat(10_000); 3], mode, - ..Default::default() + ..default() } .create_batch_transactions( wallet_inscriptions, @@ -1456,7 +1456,7 @@ inscriptions: TxIn { previous_output: parent_info.location.outpoint, sequence: Sequence::ENABLE_RBF_NO_LOCKTIME, - ..Default::default() + ..default() } ); } diff --git a/src/subcommand/wallet/mint.rs b/src/subcommand/wallet/mint.rs index 3c22c6579a..efefb0f2ad 100644 --- a/src/subcommand/wallet/mint.rs +++ b/src/subcommand/wallet/mint.rs @@ -45,7 +45,7 @@ impl Mint { let runestone = Runestone { claim: Some(id), - ..Default::default() + ..default() }; let script_pubkey = runestone.encipher(); diff --git a/src/subcommand/wallet/send.rs b/src/subcommand/wallet/send.rs index 72bd5fe399..728c5a2902 100644 --- a/src/subcommand/wallet/send.rs +++ b/src/subcommand/wallet/send.rs @@ -275,7 +275,7 @@ impl Send { id, output: 2, }], - ..Default::default() + ..default() }; let unfunded_transaction = Transaction { diff --git a/src/templates.rs b/src/templates.rs index 31f88dc574..e5491dcc0a 100644 --- a/src/templates.rs +++ b/src/templates.rs @@ -126,7 +126,7 @@ mod tests { csp_origin: Some("https://signet.ordinals.com".into()), domain: Some("signet.ordinals.com".into()), index_sats: true, - ..Default::default() + ..default() }),), r" @@ -176,7 +176,7 @@ mod tests { csp_origin: None, domain: None, index_sats: true, - ..Default::default() + ..default() })), r".*