[ci] Fix or ignore clippy warnings for all optional features except compact_filters
This commit is contained in:
parent
297e92a829
commit
8d04128c74
16
src/cli.rs
16
src/cli.rs
@ -41,7 +41,7 @@ use crate::types::ScriptType;
|
|||||||
use crate::{FeeRate, TxBuilder, Wallet};
|
use crate::{FeeRate, TxBuilder, Wallet};
|
||||||
|
|
||||||
fn parse_recipient(s: &str) -> Result<(Script, u64), String> {
|
fn parse_recipient(s: &str) -> Result<(Script, u64), String> {
|
||||||
let parts: Vec<_> = s.split(":").collect();
|
let parts: Vec<_> = s.split(':').collect();
|
||||||
if parts.len() != 2 {
|
if parts.len() != 2 {
|
||||||
return Err("Invalid format".to_string());
|
return Err("Invalid format".to_string());
|
||||||
}
|
}
|
||||||
@ -387,7 +387,7 @@ where
|
|||||||
.unwrap()
|
.unwrap()
|
||||||
.map(|s| parse_recipient(s))
|
.map(|s| parse_recipient(s))
|
||||||
.collect::<Result<Vec<_>, _>>()
|
.collect::<Result<Vec<_>, _>>()
|
||||||
.map_err(|s| Error::Generic(s))?;
|
.map_err(Error::Generic)?;
|
||||||
let mut tx_builder = TxBuilder::with_recipients(recipients);
|
let mut tx_builder = TxBuilder::with_recipients(recipients);
|
||||||
|
|
||||||
if sub_matches.is_present("send_all") {
|
if sub_matches.is_present("send_all") {
|
||||||
@ -405,7 +405,7 @@ where
|
|||||||
let utxos = utxos
|
let utxos = utxos
|
||||||
.map(|i| parse_outpoint(i))
|
.map(|i| parse_outpoint(i))
|
||||||
.collect::<Result<Vec<_>, _>>()
|
.collect::<Result<Vec<_>, _>>()
|
||||||
.map_err(|s| Error::Generic(s.to_string()))?;
|
.map_err(Error::Generic)?;
|
||||||
tx_builder = tx_builder.utxos(utxos).manually_selected_only();
|
tx_builder = tx_builder.utxos(utxos).manually_selected_only();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -413,7 +413,7 @@ where
|
|||||||
let unspendable = unspendable
|
let unspendable = unspendable
|
||||||
.map(|i| parse_outpoint(i))
|
.map(|i| parse_outpoint(i))
|
||||||
.collect::<Result<Vec<_>, _>>()
|
.collect::<Result<Vec<_>, _>>()
|
||||||
.map_err(|s| Error::Generic(s.to_string()))?;
|
.map_err(Error::Generic)?;
|
||||||
tx_builder = tx_builder.unspendable(unspendable);
|
tx_builder = tx_builder.unspendable(unspendable);
|
||||||
}
|
}
|
||||||
if let Some(policy) = sub_matches.value_of("policy") {
|
if let Some(policy) = sub_matches.value_of("policy") {
|
||||||
@ -443,7 +443,7 @@ where
|
|||||||
let utxos = utxos
|
let utxos = utxos
|
||||||
.map(|i| parse_outpoint(i))
|
.map(|i| parse_outpoint(i))
|
||||||
.collect::<Result<Vec<_>, _>>()
|
.collect::<Result<Vec<_>, _>>()
|
||||||
.map_err(|s| Error::Generic(s.to_string()))?;
|
.map_err(Error::Generic)?;
|
||||||
tx_builder = tx_builder.utxos(utxos);
|
tx_builder = tx_builder.utxos(utxos);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -451,7 +451,7 @@ where
|
|||||||
let unspendable = unspendable
|
let unspendable = unspendable
|
||||||
.map(|i| parse_outpoint(i))
|
.map(|i| parse_outpoint(i))
|
||||||
.collect::<Result<Vec<_>, _>>()
|
.collect::<Result<Vec<_>, _>>()
|
||||||
.map_err(|s| Error::Generic(s.to_string()))?;
|
.map_err(Error::Generic)?;
|
||||||
tx_builder = tx_builder.unspendable(unspendable);
|
tx_builder = tx_builder.unspendable(unspendable);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -475,7 +475,7 @@ where
|
|||||||
let psbt: PartiallySignedTransaction = deserialize(&psbt).unwrap();
|
let psbt: PartiallySignedTransaction = deserialize(&psbt).unwrap();
|
||||||
let assume_height = sub_matches
|
let assume_height = sub_matches
|
||||||
.value_of("assume_height")
|
.value_of("assume_height")
|
||||||
.and_then(|s| Some(s.parse().unwrap()));
|
.map(|s| s.parse().unwrap());
|
||||||
let (psbt, finalized) = wallet.sign(psbt, assume_height)?;
|
let (psbt, finalized) = wallet.sign(psbt, assume_height)?;
|
||||||
Ok(json!({
|
Ok(json!({
|
||||||
"psbt": base64::encode(&serialize(&psbt)),
|
"psbt": base64::encode(&serialize(&psbt)),
|
||||||
@ -507,7 +507,7 @@ where
|
|||||||
|
|
||||||
let assume_height = sub_matches
|
let assume_height = sub_matches
|
||||||
.value_of("assume_height")
|
.value_of("assume_height")
|
||||||
.and_then(|s| Some(s.parse().unwrap()));
|
.map(|s| s.parse().unwrap());
|
||||||
|
|
||||||
let (psbt, finalized) = wallet.finalize_psbt(psbt, assume_height)?;
|
let (psbt, finalized) = wallet.finalize_psbt(psbt, assume_height)?;
|
||||||
Ok(json!({
|
Ok(json!({
|
||||||
|
@ -322,7 +322,7 @@ impl BatchDatabase for AnyDatabase {
|
|||||||
}
|
}
|
||||||
fn commit_batch(&mut self, batch: Self::Batch) -> Result<(), Error> {
|
fn commit_batch(&mut self, batch: Self::Batch) -> Result<(), Error> {
|
||||||
// TODO: refactor once `move_ref_pattern` is stable
|
// TODO: refactor once `move_ref_pattern` is stable
|
||||||
|
#[allow(irrefutable_let_patterns)]
|
||||||
match self {
|
match self {
|
||||||
AnyDatabase::Memory(db) => {
|
AnyDatabase::Memory(db) => {
|
||||||
if let AnyBatch::Memory(batch) = batch {
|
if let AnyBatch::Memory(batch) = batch {
|
||||||
|
@ -61,12 +61,15 @@ pub extern crate sled;
|
|||||||
#[cfg(feature = "cli-utils")]
|
#[cfg(feature = "cli-utils")]
|
||||||
pub mod cli;
|
pub mod cli;
|
||||||
|
|
||||||
|
#[allow(unused_imports)]
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate testutils;
|
extern crate testutils;
|
||||||
|
#[allow(unused_imports)]
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate testutils_macros;
|
extern crate testutils_macros;
|
||||||
|
#[allow(unused_imports)]
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate serial_test;
|
extern crate serial_test;
|
||||||
|
@ -1753,7 +1753,7 @@ mod test {
|
|||||||
fn test_create_tx_absolute_high_fee() {
|
fn test_create_tx_absolute_high_fee() {
|
||||||
let (wallet, _, _) = get_funded_wallet(get_test_wpkh());
|
let (wallet, _, _) = get_funded_wallet(get_test_wpkh());
|
||||||
let addr = wallet.get_new_address().unwrap();
|
let addr = wallet.get_new_address().unwrap();
|
||||||
let (psbt, details) = wallet
|
let (_psbt, _details) = wallet
|
||||||
.create_tx(
|
.create_tx(
|
||||||
TxBuilder::with_recipients(vec![(addr.script_pubkey(), 0)])
|
TxBuilder::with_recipients(vec![(addr.script_pubkey(), 0)])
|
||||||
.fee_absolute(60_000)
|
.fee_absolute(60_000)
|
||||||
|
@ -103,6 +103,7 @@ pub struct ChunksIterator<I: Iterator> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<I: Iterator> ChunksIterator<I> {
|
impl<I: Iterator> ChunksIterator<I> {
|
||||||
|
#[allow(dead_code)]
|
||||||
pub fn new(iter: I, size: usize) -> Self {
|
pub fn new(iter: I, size: usize) -> Self {
|
||||||
ChunksIterator { iter, size }
|
ChunksIterator { iter, size }
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user