diff --git a/crates/test-bitcoincore-rpc/src/api.rs b/crates/test-bitcoincore-rpc/src/api.rs index 2ebe549ea6..76dc28a712 100644 --- a/crates/test-bitcoincore-rpc/src/api.rs +++ b/crates/test-bitcoincore-rpc/src/api.rs @@ -13,7 +13,7 @@ pub trait Api { fn get_balances(&self) -> Result; #[rpc(name = "getbestblockhash")] - fn get_best_block_hash(&self) -> Result; + fn get_best_block_hash(&self) -> Result; #[rpc(name = "getblockhash")] fn get_block_hash(&self, height: usize) -> Result; diff --git a/crates/test-bitcoincore-rpc/src/server.rs b/crates/test-bitcoincore-rpc/src/server.rs index 67fffa18c4..5610e52810 100644 --- a/crates/test-bitcoincore-rpc/src/server.rs +++ b/crates/test-bitcoincore-rpc/src/server.rs @@ -41,7 +41,7 @@ impl Api for Server { }) } - fn get_best_block_hash(&self) -> Result { + fn get_best_block_hash(&self) -> Result { match self.state().hashes.last() { Some(block_hash) => Ok(*block_hash), None => Err(Self::not_found()), diff --git a/src/runes.rs b/src/runes.rs index 98185e53d2..9e5cb56974 100644 --- a/src/runes.rs +++ b/src/runes.rs @@ -35,8 +35,8 @@ pub enum MintError { Unmintable(Rune), } -impl Display for MintError { - fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { +impl fmt::Display for MintError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { MintError::Deadline((rune, deadline)) => { write!(f, "rune {rune} mint ended at {deadline}") @@ -5276,7 +5276,7 @@ mod tests { ..Default::default() }); - context.mine_blocks(RUNE_COMMIT_INTERVAL.into()); + context.mine_blocks((RUNE_COMMIT_INTERVAL).into()); let mut witness = Witness::new(); diff --git a/src/runes/runestone.rs b/src/runes/runestone.rs index 9418955cfd..48590094ae 100644 --- a/src/runes/runestone.rs +++ b/src/runes/runestone.rs @@ -484,8 +484,8 @@ mod tests { .push_opcode(MAGIC_NUMBER) .push_opcode(opcodes::all::OP_VERIFY) .push_slice([0]) - .push_slice::<&PushBytes>(varint::encode(1).as_slice().try_into().unwrap()) - .push_slice::<&PushBytes>(varint::encode(1).as_slice().try_into().unwrap()) + .push_slice::<&script::PushBytes>(varint::encode(1).as_slice().try_into().unwrap()) + .push_slice::<&script::PushBytes>(varint::encode(1).as_slice().try_into().unwrap()) .push_slice([2, 0]) .into_script(), value: 0, @@ -495,8 +495,8 @@ mod tests { .push_opcode(opcodes::all::OP_RETURN) .push_opcode(MAGIC_NUMBER) .push_slice([0]) - .push_slice::<&PushBytes>(varint::encode(1).as_slice().try_into().unwrap()) - .push_slice::<&PushBytes>(varint::encode(2).as_slice().try_into().unwrap()) + .push_slice::<&script::PushBytes>(varint::encode(1).as_slice().try_into().unwrap()) + .push_slice::<&script::PushBytes>(varint::encode(2).as_slice().try_into().unwrap()) .push_slice([3, 0]) .into_script(), value: 0, @@ -1276,8 +1276,8 @@ mod tests { .try_into() .unwrap() ) - .push_slice::<&PushBytes>(varint::encode(1).as_slice().try_into().unwrap()) - .push_slice::<&PushBytes>(varint::encode(1).as_slice().try_into().unwrap()) + .push_slice::<&script::PushBytes>(varint::encode(1).as_slice().try_into().unwrap()) + .push_slice::<&script::PushBytes>(varint::encode(1).as_slice().try_into().unwrap()) .push_slice::<&PushBytes>(varint::encode(2).as_slice().try_into().unwrap()) .push_slice::<&PushBytes>(varint::encode(0).as_slice().try_into().unwrap()) .into_script(), diff --git a/src/subcommand/env.rs b/src/subcommand/env.rs index e994195e0c..47415aaa61 100644 --- a/src/subcommand/env.rs +++ b/src/subcommand/env.rs @@ -124,7 +124,8 @@ rpcport={bitcoind_port} "failed to generate receive address: {status}" ); - let receive = serde_json::from_slice::(&output.stdout)?; + let receive = + serde_json::from_slice::(&output.stdout)?; let status = Command::new("bitcoin-cli") .arg(format!("-datadir={relative}")) diff --git a/src/wallet.rs b/src/wallet.rs index d22c404973..556e195513 100644 --- a/src/wallet.rs +++ b/src/wallet.rs @@ -41,7 +41,7 @@ impl OrdClient { } pub(crate) struct Wallet { - bitcoin_client: Client, + bitcoin_client: bitcoincore_rpc::Client, has_rune_index: bool, has_sat_index: bool, rpc_url: Url, @@ -61,7 +61,7 @@ impl Wallet { settings: Settings, rpc_url: Url, ) -> Result { - let mut headers = HeaderMap::new(); + let mut headers = header::HeaderMap::new(); headers.insert( header::ACCEPT, @@ -209,7 +209,7 @@ impl Wallet { Ok(output_json) } - fn get_utxos(bitcoin_client: &Client) -> Result> { + fn get_utxos(bitcoin_client: &bitcoincore_rpc::Client) -> Result> { Ok( bitcoin_client .list_unspent(None, None, None, None, None)? @@ -227,10 +227,12 @@ impl Wallet { ) } - fn get_locked_utxos(bitcoin_client: &Client) -> Result> { + fn get_locked_utxos( + bitcoin_client: &bitcoincore_rpc::Client, + ) -> Result> { #[derive(Deserialize)] pub(crate) struct JsonOutPoint { - txid: Txid, + txid: bitcoin::Txid, vout: u32, } @@ -323,7 +325,7 @@ impl Wallet { ))) } - pub(crate) fn bitcoin_client(&self) -> &Client { + pub(crate) fn bitcoin_client(&self) -> &bitcoincore_rpc::Client { &self.bitcoin_client } @@ -623,7 +625,7 @@ impl Wallet { let public_key = secret_key.to_public(secp)?; - let mut key_map = HashMap::new(); + let mut key_map = std::collections::HashMap::new(); key_map.insert(public_key.clone(), secret_key); let descriptor = miniscript::descriptor::Descriptor::new_tr(public_key, None)?; diff --git a/src/wallet/inscribe/batchfile.rs b/src/wallet/inscribe/batchfile.rs index 76607a0072..7f2dc7d490 100644 --- a/src/wallet/inscribe/batchfile.rs +++ b/src/wallet/inscribe/batchfile.rs @@ -201,7 +201,7 @@ mod tests { #[test] fn batchfile_not_sat_and_satpoint() { - let tempdir = TempDir::new().unwrap(); + let tempdir = tempfile::TempDir::new().unwrap(); let batch_file = tempdir.path().join("batch.yaml"); fs::write( batch_file.clone(), @@ -227,7 +227,7 @@ inscriptions: #[test] fn batchfile_wrong_mode_for_satpoints() { - let tempdir = TempDir::new().unwrap(); + let tempdir = tempfile::TempDir::new().unwrap(); let batch_file = tempdir.path().join("batch.yaml"); fs::write( batch_file.clone(), @@ -254,7 +254,7 @@ inscriptions: #[test] fn batchfile_missing_satpoint() { - let tempdir = TempDir::new().unwrap(); + let tempdir = tempfile::TempDir::new().unwrap(); let batch_file = tempdir.path().join("batch.yaml"); fs::write( batch_file.clone(), @@ -280,7 +280,7 @@ inscriptions: #[test] fn batchfile_only_first_sat_of_outpoint() { - let tempdir = TempDir::new().unwrap(); + let tempdir = tempfile::TempDir::new().unwrap(); let batch_file = tempdir.path().join("batch.yaml"); fs::write( batch_file.clone(), @@ -307,7 +307,7 @@ inscriptions: #[test] fn batchfile_no_postage_if_mode_satpoints() { - let tempdir = TempDir::new().unwrap(); + let tempdir = tempfile::TempDir::new().unwrap(); let batch_file = tempdir.path().join("batch.yaml"); fs::write( batch_file.clone(), @@ -335,7 +335,7 @@ inscriptions: #[test] fn batchfile_no_duplicate_satpoints() { - let tempdir = TempDir::new().unwrap(); + let tempdir = tempfile::TempDir::new().unwrap(); let batch_file = tempdir.path().join("batch.yaml"); fs::write( batch_file.clone(),