diff --git a/Cargo.toml b/Cargo.toml index c2ff34e..218d2e5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "zcash-devtool" version = "0.1.0" -edition = "2021" -rust-version = "1.81" +edition = "2024" +rust-version = "1.85" license = "MIT OR Apache-2.0" publish = false diff --git a/src/commands/create_multisig_address.rs b/src/commands/create_multisig_address.rs index 98ef86d..4a70323 100644 --- a/src/commands/create_multisig_address.rs +++ b/src/commands/create_multisig_address.rs @@ -86,7 +86,9 @@ fn multisig_script( fn validate_args(threshold: u8, pub_keys: &[PublicKey]) -> anyhow::Result<()> { if threshold < 1 { - return Err(anyhow::anyhow!("a multisignature address must require at least one key to redeem, threshold must be at least 1")); + return Err(anyhow::anyhow!( + "a multisignature address must require at least one key to redeem, threshold must be at least 1" + )); } if pub_keys.len() < threshold as usize { diff --git a/src/commands/inspect.rs b/src/commands/inspect.rs index c942361..49783b6 100644 --- a/src/commands/inspect.rs +++ b/src/commands/inspect.rs @@ -2,18 +2,18 @@ use std::io; use std::io::Cursor; use std::process; -use bech32::primitives::decode::CheckedHrpstring; use bech32::Bech32; +use bech32::primitives::decode::CheckedHrpstring; use clap::Args; use lazy_static::lazy_static; use secrecy::Zeroize; use zcash_address::{ - unified::{self, Encoding}, ZcashAddress, + unified::{self, Encoding}, }; use zcash_primitives::{block::BlockHeader, transaction::Transaction}; -use zcash_proofs::{default_params_folder, load_parameters, ZcashParameters}; +use zcash_proofs::{ZcashParameters, default_params_folder, load_parameters}; use zcash_protocol::{ consensus::{BranchId, NetworkType}, constants, diff --git a/src/commands/inspect/address.rs b/src/commands/inspect/address.rs index 97b30c5..2e21091 100644 --- a/src/commands/inspect/address.rs +++ b/src/commands/inspect/address.rs @@ -1,7 +1,7 @@ use group::GroupEncoding; use zcash_address::{ - unified::{self, Container, Encoding}, ConversionError, ToAddress, ZcashAddress, + unified::{self, Container, Encoding}, }; use zcash_protocol::consensus::NetworkType; diff --git a/src/commands/inspect/block.rs b/src/commands/inspect/block.rs index e9a26d8..57d2c3e 100644 --- a/src/commands/inspect/block.rs +++ b/src/commands/inspect/block.rs @@ -14,8 +14,8 @@ use zcash_primitives::{block::BlockHeader, transaction::Transaction}; use zcash_protocol::consensus::{BlockHeight, BranchId, Network, NetworkUpgrade, Parameters}; use super::{ - transaction::{extract_height_from_coinbase, is_coinbase}, Context, ZUint256, + transaction::{extract_height_from_coinbase, is_coinbase}, }; const MIN_BLOCK_VERSION: i32 = 4; @@ -277,7 +277,9 @@ fn inspect_header_inner(header: &BlockHeader, params: Option) { eprintln!("⚠️ Invalid Proof-of-Work: {e}"); } } else { - eprintln!("🔎 To check contextual rules, add \"network\" to context (either \"main\" or \"test\")"); + eprintln!( + "🔎 To check contextual rules, add \"network\" to context (either \"main\" or \"test\")" + ); } } @@ -385,15 +387,17 @@ pub(crate) fn inspect(block: &Block, context: Option) { } else if Some(height) == params.activation_height(NetworkUpgrade::Heartwood) { if block.header.final_sapling_root != [0; 32] { // zcashd: bad-heartwood-root-in-block - eprintln!("⚠️ This is the block that activates Heartwood but header.blockcommitments is not null"); + eprintln!( + "⚠️ This is the block that activates Heartwood but header.blockcommitments is not null" + ); } } else if params.is_nu_active(NetworkUpgrade::Heartwood, height) { if let Some(chain_history_root) = context.and_then(|c| c.chainhistoryroot) { if chain_history_root.0 != block.header.final_sapling_root { // zcashd: bad-heartwood-root-in-block eprintln!( - "⚠️ [Heartwood] header.blockcommitments doesn't match provided chain history root" - ); + "⚠️ [Heartwood] header.blockcommitments doesn't match provided chain history root" + ); eprintln!(" - chainhistoryroot: {chain_history_root}"); eprintln!( " - header.blockcommitments: {}", diff --git a/src/commands/inspect/context.rs b/src/commands/inspect/context.rs index 2ace1ce..6457460 100644 --- a/src/commands/inspect/context.rs +++ b/src/commands/inspect/context.rs @@ -3,8 +3,8 @@ use std::fmt; use std::str::FromStr; use serde::{ - de::{Unexpected, Visitor}, Deserialize, Serialize, Serializer, + de::{Unexpected, Visitor}, }; use ::transparent::{ @@ -262,7 +262,7 @@ impl<'de> Deserialize<'de> for ZScript { impl Serialize for ZScript { fn serialize(&self, serializer: S) -> Result { - serializer.serialize_str(&hex::encode(&self.0 .0 .0)) + serializer.serialize_str(&hex::encode(&self.0.0.0)) } } diff --git a/src/commands/inspect/keys.rs b/src/commands/inspect/keys.rs index 5ae5d84..93cc4d8 100644 --- a/src/commands/inspect/keys.rs +++ b/src/commands/inspect/keys.rs @@ -9,8 +9,8 @@ use ::transparent::{ keys::{AccountPrivKey, IncomingViewingKey}, }; use zcash_address::{ - unified::{self, Encoding}, ToAddress, ZcashAddress, + unified::{self, Encoding}, }; use zcash_keys::{ encoding::AddressCodec, @@ -103,9 +103,11 @@ pub(crate) fn inspect_mnemonic(mnemonic: bip0039::Mnemonic, context: Option eprintln!( " - Default address: {}", match addr { - TransparentAddress::PublicKeyHash(data) => ZcashAddress::from_transparent_p2pkh(addr_net, data), + TransparentAddress::PublicKeyHash(data) => + ZcashAddress::from_transparent_p2pkh(addr_net, data), TransparentAddress::ScriptHash(_) => unreachable!(), - }.encode(), + } + .encode(), ), Err(e) => eprintln!( " ⚠️ No valid transparent default address for this account under this seed: {e:?}" @@ -153,7 +155,9 @@ pub(crate) fn inspect_mnemonic(mnemonic: bip0039::Mnemonic, context: Option bool { @@ -160,7 +160,9 @@ pub(crate) fn inspect( ) { (true, coins) => coins, (false, Some(_)) => { - eprintln!("⚠️ Context was given \"transparentcoins\" but this transaction has no transparent inputs"); + eprintln!( + "⚠️ Context was given \"transparentcoins\" but this transaction has no transparent inputs" + ); Some(vec![]) } (false, None) => Some(vec![]), @@ -261,7 +263,9 @@ pub(crate) fn inspect( (sig, hash_type, pubkey) { if TransparentAddress::from_pubkey(&pubkey) != addr { - eprintln!(" ⚠️ Txin {i} pubkey does not match coin's script_pubkey"); + eprintln!( + " ⚠️ Txin {i} pubkey does not match coin's script_pubkey" + ); } let sighash = signature_hash( @@ -298,10 +302,16 @@ pub(crate) fn inspect( eprintln!(" 🔎 \"transparentcoins\"[{i}] is a P2SH coin."); } Some(solver::ScriptKind::MultiSig { required, pubkeys }) => { - eprintln!(" 🔎 \"transparentcoins\"[{i}] is a direct (non-P2SH) {required}-of-{} multi-sig coin.", pubkeys.len()); + eprintln!( + " 🔎 \"transparentcoins\"[{i}] is a direct (non-P2SH) {required}-of-{} multi-sig coin.", + pubkeys.len() + ); } Some(solver::ScriptKind::NullData { data }) => { - eprintln!(" 🔎 \"transparentcoins\"[{i}] is a null data output with {} PushDatas.", data.len()); + eprintln!( + " 🔎 \"transparentcoins\"[{i}] is a null data output with {} PushDatas.", + data.len() + ); } Some(solver::ScriptKind::PubKey { .. }) => { eprintln!(" 🔎 \"transparentcoins\"[{i}] is a P2PK (not P2PKH) coin."); @@ -426,7 +436,9 @@ pub(crate) fn inspect( eprintln!(" ⚠️ Output {i} is not recoverable with the all-zeros OVK"); } } else { - eprintln!(" 🔎 To check Sapling coinbase rules, add \"network\" to context (either \"main\" or \"test\")"); + eprintln!( + " 🔎 To check Sapling coinbase rules, add \"network\" to context (either \"main\" or \"test\")" + ); } } @@ -500,7 +512,9 @@ pub(crate) fn inspect( ); eprintln!(" - {zaddr}"); } else { - eprintln!(" 🔎 To show recipient address, add \"network\" to context (either \"main\" or \"test\")"); + eprintln!( + " 🔎 To show recipient address, add \"network\" to context (either \"main\" or \"test\")" + ); } eprintln!(" - {}", render_value(note.value().inner())); diff --git a/src/commands/keystone.rs b/src/commands/keystone.rs index 65cfcc7..a039275 100644 --- a/src/commands/keystone.rs +++ b/src/commands/keystone.rs @@ -3,14 +3,14 @@ use std::time::Duration; use anyhow::anyhow; use clap::{Args, Subcommand}; use minicbor::data::{Int, Tag}; -use qrcode::{render::unicode, QrCode}; +use qrcode::{QrCode, render::unicode}; use rand::rngs::OsRng; -use tokio::io::{stdout, AsyncWriteExt}; +use tokio::io::{AsyncWriteExt, stdout}; use uuid::Uuid; use zcash_client_backend::data_api::Account; -use zcash_client_sqlite::{util::SystemClock, WalletDb}; +use zcash_client_sqlite::{WalletDb, util::SystemClock}; -use crate::{config::WalletConfig, data::get_db_paths, ShutdownListener}; +use crate::{ShutdownListener, config::WalletConfig, data::get_db_paths}; use super::select_account; diff --git a/src/commands/pczt/combine.rs b/src/commands/pczt/combine.rs index 6b1c1ee..2ae2382 100644 --- a/src/commands/pczt/combine.rs +++ b/src/commands/pczt/combine.rs @@ -2,10 +2,10 @@ use std::path::PathBuf; use anyhow::anyhow; use clap::Args; -use pczt::{roles::combiner::Combiner, Pczt}; +use pczt::{Pczt, roles::combiner::Combiner}; use tokio::{ fs::File, - io::{stdout, AsyncReadExt, AsyncWriteExt}, + io::{AsyncReadExt, AsyncWriteExt, stdout}, }; // Options accepted for the `pczt combine` command diff --git a/src/commands/pczt/create.rs b/src/commands/pczt/create.rs index c51be89..45567c3 100644 --- a/src/commands/pczt/create.rs +++ b/src/commands/pczt/create.rs @@ -4,26 +4,26 @@ use std::{num::NonZeroUsize, str::FromStr}; use anyhow::anyhow; use clap::Args; use rand::rngs::OsRng; -use tokio::io::{stdout, AsyncWriteExt}; +use tokio::io::{AsyncWriteExt, stdout}; use uuid::Uuid; use zcash_address::ZcashAddress; use zcash_client_backend::{ data_api::{ + Account as _, wallet::{ - create_pczt_from_proposal, input_selection::GreedyInputSelector, propose_transfer, - ConfirmationsPolicy, + ConfirmationsPolicy, create_pczt_from_proposal, input_selection::GreedyInputSelector, + propose_transfer, }, - Account as _, }, - fees::{standard::MultiOutputChangeStrategy, DustOutputPolicy, SplitPolicy, StandardFeeRule}, + fees::{DustOutputPolicy, SplitPolicy, StandardFeeRule, standard::MultiOutputChangeStrategy}, wallet::OvkPolicy, }; -use zcash_client_sqlite::{util::SystemClock, WalletDb}; +use zcash_client_sqlite::{WalletDb, util::SystemClock}; use zcash_protocol::{ + ShieldedProtocol, memo::{Memo, MemoBytes}, value::Zatoshis, - ShieldedProtocol, }; use zip321::{Payment, TransactionRequest}; @@ -81,18 +81,21 @@ impl Command { ); let input_selector = GreedyInputSelector::new(); - let request = TransactionRequest::new(vec![Payment::new( - ZcashAddress::from_str(&self.address).map_err(|_| error::Error::InvalidRecipient)?, - Some(Zatoshis::from_u64(self.value).map_err(|_| error::Error::InvalidAmount)?), - self.memo - .map(|memo| Memo::from_str(&memo)) - .transpose()? - .map(MemoBytes::from), - None, - None, - vec![], - ) - .ok_or_else(|| error::Error::TransparentMemo(0))?]) + let request = TransactionRequest::new(vec![ + Payment::new( + ZcashAddress::from_str(&self.address) + .map_err(|_| error::Error::InvalidRecipient)?, + Some(Zatoshis::from_u64(self.value).map_err(|_| error::Error::InvalidAmount)?), + self.memo + .map(|memo| Memo::from_str(&memo)) + .transpose()? + .map(MemoBytes::from), + None, + None, + vec![], + ) + .ok_or_else(|| error::Error::TransparentMemo(0))?, + ]) .map_err(error::Error::from)?; let proposal = propose_transfer( diff --git a/src/commands/pczt/create_manual.rs b/src/commands/pczt/create_manual.rs index ce55e99..8247113 100644 --- a/src/commands/pczt/create_manual.rs +++ b/src/commands/pczt/create_manual.rs @@ -5,16 +5,16 @@ use anyhow::anyhow; use clap::Args; use pczt::roles::{creator::Creator, io_finalizer::IoFinalizer, updater::Updater}; use rand::rngs::OsRng; -use tokio::io::{stdout, AsyncWriteExt}; +use tokio::io::{AsyncWriteExt, stdout}; use transparent::builder::TransparentInputInfo; use zcash_address::ZcashAddress; use zcash_client_backend::proto::service::{ChainSpec, TxFilter}; use zcash_keys::address::Address; use zcash_primitives::transaction::{ + Transaction, builder::{Builder, PcztResult}, fees::zip317, - Transaction, }; use zcash_protocol::{ consensus::{self, Parameters}, diff --git a/src/commands/pczt/create_max.rs b/src/commands/pczt/create_max.rs index ea850d6..6205de5 100644 --- a/src/commands/pczt/create_max.rs +++ b/src/commands/pczt/create_max.rs @@ -2,22 +2,22 @@ use std::str::FromStr; use clap::Args; use rand::rngs::OsRng; -use tokio::io::{stdout, AsyncWriteExt}; +use tokio::io::{AsyncWriteExt, stdout}; use uuid::Uuid; use zcash_address::ZcashAddress; use zcash_client_backend::{ data_api::{ - wallet::{create_pczt_from_proposal, propose_send_max_transfer, ConfirmationsPolicy}, Account as _, MaxSpendMode, + wallet::{ConfirmationsPolicy, create_pczt_from_proposal, propose_send_max_transfer}, }, fees::StandardFeeRule, wallet::OvkPolicy, }; -use zcash_client_sqlite::{util::SystemClock, WalletDb}; +use zcash_client_sqlite::{WalletDb, util::SystemClock}; use zcash_protocol::{ - memo::{Memo, MemoBytes}, ShieldedProtocol, + memo::{Memo, MemoBytes}, }; use crate::{commands::select_account, config::WalletConfig, data::get_db_paths, error}; diff --git a/src/commands/pczt/inspect.rs b/src/commands/pczt/inspect.rs index eb6db38..399e8a0 100644 --- a/src/commands/pczt/inspect.rs +++ b/src/commands/pczt/inspect.rs @@ -2,18 +2,18 @@ use std::collections::BTreeMap; use anyhow::anyhow; use clap::Args; -use pczt::{roles::verifier::Verifier, Pczt}; +use pczt::{Pczt, roles::verifier::Verifier}; use secrecy::ExposeSecret; -use tokio::io::{stdin, AsyncReadExt}; +use tokio::io::{AsyncReadExt, stdin}; use ::transparent::sighash::SighashType; use transparent::address::TransparentAddress; use zcash_keys::encoding::AddressCodec; use zcash_primitives::transaction::{ + TxVersion, sighash::SignableInput, sighash_v5::v5_signature_hash, - txid::{to_txid, TxIdDigester}, - TxVersion, + txid::{TxIdDigester, to_txid}, }; use zcash_protocol::consensus::{NetworkConstants, Parameters}; use zcash_script::solver; diff --git a/src/commands/pczt/pay_manual.rs b/src/commands/pczt/pay_manual.rs index 10baca4..5fe7c30 100644 --- a/src/commands/pczt/pay_manual.rs +++ b/src/commands/pczt/pay_manual.rs @@ -4,24 +4,24 @@ use anyhow::anyhow; use clap::Args; use pczt::roles::{creator::Creator, io_finalizer::IoFinalizer, updater::Updater}; use rand::rngs::OsRng; -use tokio::io::{stdout, AsyncWriteExt}; +use tokio::io::{AsyncWriteExt, stdout}; use transparent::{builder::TransparentInputInfo, bundle::TxOut}; use zcash_client_backend::{ fees::{ - zip317::SingleOutputChangeStrategy, ChangeError, ChangeStrategy as _, DustOutputPolicy, + ChangeError, ChangeStrategy as _, DustOutputPolicy, zip317::SingleOutputChangeStrategy, }, proto::service::{ChainSpec, TxFilter}, }; use zcash_keys::address::Address; use zcash_primitives::transaction::{ + Transaction, builder::{Builder, PcztResult}, fees::zip317, - Transaction, }; use zcash_protocol::{ - consensus::{self, Parameters as _}, PoolType, ShieldedProtocol, + consensus::{self, Parameters as _}, }; use zip321::TransactionRequest; diff --git a/src/commands/pczt/prove.rs b/src/commands/pczt/prove.rs index 9ce9ecd..6e49e7c 100644 --- a/src/commands/pczt/prove.rs +++ b/src/commands/pczt/prove.rs @@ -1,12 +1,12 @@ use anyhow::anyhow; use clap::Args; use pczt::{ - roles::{prover::Prover, updater::Updater}, Pczt, + roles::{prover::Prover, updater::Updater}, }; use sapling::ProofGenerationKey; use secrecy::{ExposeSecret, SecretVec}; -use tokio::io::{stdin, stdout, AsyncReadExt, AsyncWriteExt}; +use tokio::io::{AsyncReadExt, AsyncWriteExt, stdin, stdout}; use zcash_keys::keys::UnifiedSpendingKey; use zcash_proofs::prover::LocalTxProver; use zcash_protocol::consensus::{NetworkConstants, Parameters}; diff --git a/src/commands/pczt/qr.rs b/src/commands/pczt/qr.rs index b3deb64..7ea73e8 100644 --- a/src/commands/pczt/qr.rs +++ b/src/commands/pczt/qr.rs @@ -5,14 +5,13 @@ use clap::Args; use image::buffer::ConvertBuffer; use minicbor::data::{Int, Type}; use nokhwa::{ - nokhwa_check, nokhwa_initialize, + Camera, nokhwa_check, nokhwa_initialize, pixel_format::RgbFormat, utils::{RequestedFormat, RequestedFormatType, Resolution}, - Camera, }; use pczt::Pczt; -use qrcode::{render::unicode, QrCode}; -use tokio::io::{stdin, stdout, AsyncReadExt, AsyncWriteExt, Stdout}; +use qrcode::{QrCode, render::unicode}; +use tokio::io::{AsyncReadExt, AsyncWriteExt, Stdout, stdin, stdout}; use crate::ShutdownListener; diff --git a/src/commands/pczt/qr/tui.rs b/src/commands/pczt/qr/tui.rs index ad8c74e..1ccfb23 100644 --- a/src/commands/pczt/qr/tui.rs +++ b/src/commands/pczt/qr/tui.rs @@ -1,6 +1,6 @@ use crossterm::event::KeyCode; use futures_util::FutureExt; -use qrcode::{render::unicode, QrCode}; +use qrcode::{QrCode, render::unicode}; use ratatui::{ prelude::*, widgets::{Block, Paragraph}, diff --git a/src/commands/pczt/redact.rs b/src/commands/pczt/redact.rs index 8e534b2..f481710 100644 --- a/src/commands/pczt/redact.rs +++ b/src/commands/pczt/redact.rs @@ -1,15 +1,15 @@ use anyhow::anyhow; use clap::Args; use pczt::{ + Pczt, roles::redactor::{ + Redactor, orchard::ActionRedactor, sapling::{OutputRedactor as SaplingOutputRedactor, SpendRedactor}, transparent::{InputRedactor, OutputRedactor as TransparentOutputRedactor}, - Redactor, }, - Pczt, }; -use tokio::io::{stdin, stdout, AsyncReadExt, AsyncWriteExt}; +use tokio::io::{AsyncReadExt, AsyncWriteExt, stdin, stdout}; // Options accepted for the `pczt redact` command #[derive(Debug, Args)] diff --git a/src/commands/pczt/send.rs b/src/commands/pczt/send.rs index 67d5284..2dc6336 100644 --- a/src/commands/pczt/send.rs +++ b/src/commands/pczt/send.rs @@ -2,12 +2,12 @@ use anyhow::anyhow; use clap::Args; use pczt::Pczt; use rand::rngs::OsRng; -use tokio::io::{stdin, AsyncReadExt}; +use tokio::io::{AsyncReadExt, stdin}; use zcash_client_backend::{ - data_api::{wallet::extract_and_store_transaction_from_pczt, WalletRead}, + data_api::{WalletRead, wallet::extract_and_store_transaction_from_pczt}, proto::service, }; -use zcash_client_sqlite::{util::SystemClock, WalletDb}; +use zcash_client_sqlite::{WalletDb, util::SystemClock}; use zcash_proofs::prover::LocalTxProver; use crate::{config::WalletConfig, data::get_db_paths, error, remote::ConnectionArgs}; diff --git a/src/commands/pczt/send_without_storing.rs b/src/commands/pczt/send_without_storing.rs index 41035ac..d6d5478 100644 --- a/src/commands/pczt/send_without_storing.rs +++ b/src/commands/pczt/send_without_storing.rs @@ -1,10 +1,10 @@ use anyhow::anyhow; use clap::Args; use pczt::{ - roles::{spend_finalizer::SpendFinalizer, tx_extractor::TransactionExtractor}, Pczt, + roles::{spend_finalizer::SpendFinalizer, tx_extractor::TransactionExtractor}, }; -use tokio::io::{stdin, AsyncReadExt}; +use tokio::io::{AsyncReadExt, stdin}; use zcash_client_backend::proto::service; use zcash_proofs::prover::LocalTxProver; diff --git a/src/commands/pczt/shield.rs b/src/commands/pczt/shield.rs index d24510a..7aabe31 100644 --- a/src/commands/pczt/shield.rs +++ b/src/commands/pczt/shield.rs @@ -4,23 +4,23 @@ use std::num::NonZeroUsize; use anyhow::anyhow; use clap::Args; use rand::rngs::OsRng; -use tokio::io::{stdout, AsyncWriteExt}; +use tokio::io::{AsyncWriteExt, stdout}; use transparent::address::TransparentAddress; use uuid::Uuid; use zcash_client_backend::{ data_api::{ + Account as _, WalletRead, wallet::{ - create_pczt_from_proposal, input_selection::GreedyInputSelector, propose_shielding, - ConfirmationsPolicy, + ConfirmationsPolicy, create_pczt_from_proposal, input_selection::GreedyInputSelector, + propose_shielding, }, - Account as _, WalletRead, }, - fees::{standard::MultiOutputChangeStrategy, DustOutputPolicy, SplitPolicy, StandardFeeRule}, + fees::{DustOutputPolicy, SplitPolicy, StandardFeeRule, standard::MultiOutputChangeStrategy}, wallet::OvkPolicy, }; -use zcash_client_sqlite::{util::SystemClock, WalletDb}; +use zcash_client_sqlite::{WalletDb, util::SystemClock}; use zcash_keys::encoding::AddressCodec; -use zcash_protocol::{value::Zatoshis, ShieldedProtocol}; +use zcash_protocol::{ShieldedProtocol, value::Zatoshis}; use crate::{commands::select_account, config::WalletConfig, data::get_db_paths, error}; diff --git a/src/commands/pczt/sign.rs b/src/commands/pczt/sign.rs index 43a5125..f868d24 100644 --- a/src/commands/pczt/sign.rs +++ b/src/commands/pczt/sign.rs @@ -3,11 +3,11 @@ use std::{collections::BTreeMap, convert::Infallible}; use anyhow::anyhow; use clap::Args; use pczt::{ - roles::{signer::Signer, verifier::Verifier}, Pczt, + roles::{signer::Signer, verifier::Verifier}, }; use secrecy::ExposeSecret; -use tokio::io::{stdin, stdout, AsyncReadExt, AsyncWriteExt}; +use tokio::io::{AsyncReadExt, AsyncWriteExt, stdin, stdout}; use ::transparent::{ keys::{NonHardenedChildIndex, TransparentKeyScope}, diff --git a/src/commands/pczt/update_with_derivation.rs b/src/commands/pczt/update_with_derivation.rs index fc0aa22..0d28149 100644 --- a/src/commands/pczt/update_with_derivation.rs +++ b/src/commands/pczt/update_with_derivation.rs @@ -1,15 +1,15 @@ use anyhow::anyhow; use bip32::Prefix; use clap::Args; -use pczt::{roles::updater::Updater, Pczt}; +use pczt::{Pczt, roles::updater::Updater}; use sapling::zip32::DiversifiableFullViewingKey; use secrecy::ExposeSecret; -use tokio::io::{stdin, stdout, AsyncReadExt, AsyncWriteExt}; +use tokio::io::{AsyncReadExt, AsyncWriteExt, stdin, stdout}; use transparent::{address::TransparentAddress, pczt::Bip32Derivation, zip48}; use zcash_keys::keys::UnifiedSpendingKey; use zcash_protocol::{ - consensus::{self, NetworkConstants, Parameters}, PoolType, + consensus::{self, NetworkConstants, Parameters}, }; use zcash_script::solver; use zip32::fingerprint::SeedFingerprint; diff --git a/src/commands/wallet/balance.rs b/src/commands/wallet/balance.rs index aafb398..69833c1 100644 --- a/src/commands/wallet/balance.rs +++ b/src/commands/wallet/balance.rs @@ -1,16 +1,16 @@ use anyhow::anyhow; use clap::Args; use iso_currency::Currency; -use rust_decimal::{prelude::FromPrimitive, Decimal}; +use rust_decimal::{Decimal, prelude::FromPrimitive}; use tracing::{info, warn}; use uuid::Uuid; use zcash_client_backend::{ - data_api::{wallet::ConfirmationsPolicy, Account as _, WalletRead}, + data_api::{Account as _, WalletRead, wallet::ConfirmationsPolicy}, tor, }; use zcash_client_sqlite::WalletDb; use zcash_keys::keys::UnifiedAddressRequest; -use zcash_protocol::value::{Zatoshis, COIN}; +use zcash_protocol::value::{COIN, Zatoshis}; use crate::{ commands::select_account, config::get_wallet_network, data::get_db_paths, error, diff --git a/src/commands/wallet/derive_path.rs b/src/commands/wallet/derive_path.rs index 32e0baa..f59aaee 100644 --- a/src/commands/wallet/derive_path.rs +++ b/src/commands/wallet/derive_path.rs @@ -9,8 +9,8 @@ use zcash_keys::{ keys::{UnifiedAddressRequest, UnifiedFullViewingKey}, }; use zcash_protocol::{ - consensus::{NetworkConstants, Parameters}, PoolType, + consensus::{NetworkConstants, Parameters}, }; use crate::config::WalletConfig; @@ -75,8 +75,11 @@ impl Command { println!(" ⚠️ Missing account"); false } - [(coin_type, coin_type_hardened), (account, account_hardened), subpath @ ..] => - { + [ + (coin_type, coin_type_hardened), + (account, account_hardened), + subpath @ .., + ] => { if !*coin_type_hardened { println!(" ⚠️ Coin type is not hardened"); } @@ -93,8 +96,10 @@ impl Command { println!(" ⚠️ Account is not hardened"); } match subpath { - [(kind, kind_hardened), (address_index, address_index_hardened)] => - { + [ + (kind, kind_hardened), + (address_index, address_index_hardened), + ] => { match kind { 0 => println!(" - External chain"), 1 => println!(" - Internal chain (change addresses)"), @@ -156,8 +161,11 @@ impl Command { println!(" ⚠️ Missing account"); None } - [(coin_type, coin_type_hardened), (account, account_hardened), subpath @ ..] => - { + [ + (coin_type, coin_type_hardened), + (account, account_hardened), + subpath @ .., + ] => { if !*coin_type_hardened { println!(" ⚠️ Coin type is not hardened"); } @@ -225,8 +233,11 @@ impl Command { println!(" ⚠️ Missing account"); None } - [(coin_type, coin_type_hardened), (account, account_hardened), subpath @ ..] => - { + [ + (coin_type, coin_type_hardened), + (account, account_hardened), + subpath @ .., + ] => { if !*coin_type_hardened { println!(" ⚠️ Coin type is not hardened"); } diff --git a/src/commands/wallet/enhance.rs b/src/commands/wallet/enhance.rs index 7da8eff..b8271b8 100644 --- a/src/commands/wallet/enhance.rs +++ b/src/commands/wallet/enhance.rs @@ -4,18 +4,18 @@ use anyhow::anyhow; use clap::Args; use futures_util::StreamExt; use rand::rngs::OsRng; -use tonic::{transport::Channel, Code}; +use tonic::{Code, transport::Channel}; use tracing::info; use zcash_client_backend::{ data_api::{ - wallet::decrypt_and_store_transaction, TransactionDataRequest, TransactionStatus, - WalletRead, WalletWrite, + TransactionDataRequest, TransactionStatus, WalletRead, WalletWrite, + wallet::decrypt_and_store_transaction, }, proto::service::{ - self, compact_tx_streamer_client::CompactTxStreamerClient, BlockRange, RawTransaction, + self, BlockRange, RawTransaction, compact_tx_streamer_client::CompactTxStreamerClient, }, }; -use zcash_client_sqlite::{util::SystemClock, WalletDb}; +use zcash_client_sqlite::{WalletDb, util::SystemClock}; use zcash_keys::encoding::AddressCodec; use zcash_primitives::transaction::{Transaction, TxId}; use zcash_protocol::consensus::{BlockHeight, BranchId, Network}; diff --git a/src/commands/wallet/gen_account.rs b/src/commands/wallet/gen_account.rs index cace6e8..f4315da 100644 --- a/src/commands/wallet/gen_account.rs +++ b/src/commands/wallet/gen_account.rs @@ -2,7 +2,7 @@ use anyhow::anyhow; use clap::Args; use rand::rngs::OsRng; use zcash_client_backend::{data_api::WalletWrite, proto::service}; -use zcash_client_sqlite::{util::SystemClock, WalletDb}; +use zcash_client_sqlite::{WalletDb, util::SystemClock}; use crate::{commands::wallet, config::WalletConfig, data::get_db_paths, remote::ConnectionArgs}; diff --git a/src/commands/wallet/gen_addr.rs b/src/commands/wallet/gen_addr.rs index f6d570d..7677f75 100644 --- a/src/commands/wallet/gen_addr.rs +++ b/src/commands/wallet/gen_addr.rs @@ -2,7 +2,7 @@ use clap::Args; use rand::rngs::OsRng; use uuid::Uuid; use zcash_client_backend::data_api::{Account, WalletWrite}; -use zcash_client_sqlite::{util::SystemClock, WalletDb}; +use zcash_client_sqlite::{WalletDb, util::SystemClock}; use zcash_keys::{address::Address, keys::UnifiedAddressRequest}; use crate::{ @@ -12,7 +12,7 @@ use crate::{ }; #[cfg(feature = "qr")] -use qrcode::{render::unicode, QrCode}; +use qrcode::{QrCode, render::unicode}; // Options accepted for the `generate-address` command #[derive(Debug, Args)] diff --git a/src/commands/wallet/import_ufvk.rs b/src/commands/wallet/import_ufvk.rs index cd2c21a..309736d 100644 --- a/src/commands/wallet/import_ufvk.rs +++ b/src/commands/wallet/import_ufvk.rs @@ -7,7 +7,7 @@ use zcash_client_backend::{ data_api::{AccountBirthday, AccountPurpose, WalletWrite, Zip32Derivation}, proto::service, }; -use zcash_client_sqlite::{util::SystemClock, WalletDb}; +use zcash_client_sqlite::{WalletDb, util::SystemClock}; use zcash_keys::keys::UnifiedFullViewingKey; use zcash_protocol::consensus; use zip32::fingerprint::SeedFingerprint; @@ -93,7 +93,9 @@ impl Command { )), }), (None, None) => Ok(AccountPurpose::ViewOnly), - _ => Err(anyhow!("Need either both (for spending) or neither (for view-only) of seed_fingerprint and hd_account_index")), + _ => Err(anyhow!( + "Need either both (for spending) or neither (for view-only) of seed_fingerprint and hd_account_index" + )), }?; // Import the UFVK. diff --git a/src/commands/wallet/init.rs b/src/commands/wallet/init.rs index 731d2a6..1a11263 100644 --- a/src/commands/wallet/init.rs +++ b/src/commands/wallet/init.rs @@ -13,7 +13,7 @@ use zcash_protocol::consensus::{self, BlockHeight, Parameters}; use crate::{ config::WalletConfig, - data::{init_dbs, Network}, + data::{Network, init_dbs}, error, remote::ConnectionArgs, }; diff --git a/src/commands/wallet/init_fvk.rs b/src/commands/wallet/init_fvk.rs index 9007d9a..21b73b1 100644 --- a/src/commands/wallet/init_fvk.rs +++ b/src/commands/wallet/init_fvk.rs @@ -104,7 +104,9 @@ impl Command { )), }), (None, None) => Ok(AccountPurpose::ViewOnly), - _ => Err(anyhow!("Need either both (for spending) or neither (for view-only) of seed_fingerprint and hd_account_index")), + _ => Err(anyhow!( + "Need either both (for spending) or neither (for view-only) of seed_fingerprint and hd_account_index" + )), }?; // Save the wallet config to disk. diff --git a/src/commands/wallet/list_addresses.rs b/src/commands/wallet/list_addresses.rs index 6faa4b0..938e04d 100644 --- a/src/commands/wallet/list_addresses.rs +++ b/src/commands/wallet/list_addresses.rs @@ -7,7 +7,7 @@ use zcash_keys::keys::UnifiedAddressRequest; use crate::{commands::select_account, config::get_wallet_network, data::get_db_paths}; #[cfg(feature = "qr")] -use qrcode::{render::unicode, QrCode}; +use qrcode::{QrCode, render::unicode}; // Options accepted for the `list-addresses` command #[derive(Debug, Args)] diff --git a/src/commands/wallet/list_tx.rs b/src/commands/wallet/list_tx.rs index 2a39ba0..2fd1c96 100644 --- a/src/commands/wallet/list_tx.rs +++ b/src/commands/wallet/list_tx.rs @@ -1,14 +1,14 @@ use anyhow::{anyhow, bail}; use clap::Args; -use rusqlite::{named_params, Connection}; +use rusqlite::{Connection, named_params}; use time::macros::format_description; use uuid::Uuid; use zcash_protocol::{ + PoolType, TxId, consensus::BlockHeight, memo::{Memo, MemoBytes}, value::{ZatBalance, Zatoshis}, - PoolType, TxId, }; use crate::{data::get_db_paths, ui::format_zec}; @@ -257,7 +257,9 @@ impl WalletTxOutput { if let Some(action) = match (&self.from_account, &self.to_account) { (Some(_), Some(_)) => None, // wallet-internal transfer, skip (None, None) => { - bail!("we should not encounter a state where neither source nor destination are known"); + bail!( + "we should not encounter a state where neither source nor destination are known" + ); } (None, Some(_)) => Some("RECEIVE"), (Some(_), None) => Some("SEND"), @@ -288,7 +290,9 @@ impl WalletTxOutput { Memo::Future(_) => "".to_string(), Memo::Arbitrary(_) => "".to_string(), }); - println!("{date},{action},{symbol},{volume},{currency},{account_id}{aname_str},{total},{price},{fee},{fee_currency},{memo}"); + println!( + "{date},{action},{symbol},{volume},{currency},{account_id}{aname_str},{total},{price},{fee},{fee_currency},{memo}" + ); } Ok(()) diff --git a/src/commands/wallet/pay.rs b/src/commands/wallet/pay.rs index 53268b3..2502171 100644 --- a/src/commands/wallet/pay.rs +++ b/src/commands/wallet/pay.rs @@ -7,7 +7,7 @@ use uuid::Uuid; use zip321::TransactionRequest; use crate::{ - commands::wallet::send::{pay, PaymentContext}, + commands::wallet::send::{PaymentContext, pay}, remote::ConnectionArgs, }; diff --git a/src/commands/wallet/propose.rs b/src/commands/wallet/propose.rs index 6d2a8e7..f2482cf 100644 --- a/src/commands/wallet/propose.rs +++ b/src/commands/wallet/propose.rs @@ -7,13 +7,13 @@ use uuid::Uuid; use zcash_address::ZcashAddress; use zcash_client_backend::{ data_api::{ - wallet::{input_selection::GreedyInputSelector, propose_transfer, ConfirmationsPolicy}, Account as _, + wallet::{ConfirmationsPolicy, input_selection::GreedyInputSelector, propose_transfer}, }, - fees::{zip317::MultiOutputChangeStrategy, DustOutputPolicy, SplitPolicy, StandardFeeRule}, + fees::{DustOutputPolicy, SplitPolicy, StandardFeeRule, zip317::MultiOutputChangeStrategy}, }; -use zcash_client_sqlite::{util::SystemClock, WalletDb}; -use zcash_protocol::{value::Zatoshis, ShieldedProtocol}; +use zcash_client_sqlite::{WalletDb, util::SystemClock}; +use zcash_protocol::{ShieldedProtocol, value::Zatoshis}; use zip321::{Payment, TransactionRequest}; use crate::{commands::select_account, config::get_wallet_network, data::get_db_paths, error}; diff --git a/src/commands/wallet/reset.rs b/src/commands/wallet/reset.rs index 5339d79..16e46d1 100644 --- a/src/commands/wallet/reset.rs +++ b/src/commands/wallet/reset.rs @@ -5,7 +5,7 @@ use zcash_client_backend::{ data_api::{Account, WalletRead}, proto::service, }; -use zcash_client_sqlite::{util::SystemClock, WalletDb}; +use zcash_client_sqlite::{WalletDb, util::SystemClock}; use crate::{ config::WalletConfig, diff --git a/src/commands/wallet/send.rs b/src/commands/wallet/send.rs index 5c7199b..8442a4f 100644 --- a/src/commands/wallet/send.rs +++ b/src/commands/wallet/send.rs @@ -11,23 +11,23 @@ use uuid::Uuid; use zcash_address::ZcashAddress; use zcash_client_backend::{ data_api::{ + Account, WalletRead, wallet::{ - create_proposed_transactions, input_selection::GreedyInputSelector, propose_transfer, - ConfirmationsPolicy, SpendingKeys, + ConfirmationsPolicy, SpendingKeys, create_proposed_transactions, + input_selection::GreedyInputSelector, propose_transfer, }, - Account, WalletRead, }, - fees::{standard::MultiOutputChangeStrategy, DustOutputPolicy, SplitPolicy, StandardFeeRule}, + fees::{DustOutputPolicy, SplitPolicy, StandardFeeRule, standard::MultiOutputChangeStrategy}, proto::service, wallet::OvkPolicy, }; -use zcash_client_sqlite::{util::SystemClock, WalletDb}; +use zcash_client_sqlite::{WalletDb, util::SystemClock}; use zcash_keys::keys::UnifiedSpendingKey; use zcash_proofs::prover::LocalTxProver; use zcash_protocol::{ + ShieldedProtocol, memo::{Memo, MemoBytes}, value::Zatoshis, - ShieldedProtocol, }; use zip321::{Payment, TransactionRequest}; diff --git a/src/commands/wallet/shield.rs b/src/commands/wallet/shield.rs index 60665d2..4d1be88 100644 --- a/src/commands/wallet/shield.rs +++ b/src/commands/wallet/shield.rs @@ -10,20 +10,20 @@ use uuid::Uuid; use zcash_client_backend::{ data_api::{ + Account, WalletRead, wallet::{ - create_proposed_transactions, input_selection::GreedyInputSelector, propose_shielding, - ConfirmationsPolicy, SpendingKeys, + ConfirmationsPolicy, SpendingKeys, create_proposed_transactions, + input_selection::GreedyInputSelector, propose_shielding, }, - Account, WalletRead, }, - fees::{standard::MultiOutputChangeStrategy, DustOutputPolicy, SplitPolicy, StandardFeeRule}, + fees::{DustOutputPolicy, SplitPolicy, StandardFeeRule, standard::MultiOutputChangeStrategy}, proto::service, wallet::OvkPolicy, }; -use zcash_client_sqlite::{util::SystemClock, WalletDb}; +use zcash_client_sqlite::{WalletDb, util::SystemClock}; use zcash_keys::{encoding::AddressCodec, keys::UnifiedSpendingKey}; use zcash_proofs::prover::LocalTxProver; -use zcash_protocol::{value::Zatoshis, ShieldedProtocol}; +use zcash_protocol::{ShieldedProtocol, value::Zatoshis}; use crate::{ commands::select_account, config::WalletConfig, data::get_db_paths, error, diff --git a/src/commands/wallet/sync.rs b/src/commands/wallet/sync.rs index 47f976d..00d24d3 100644 --- a/src/commands/wallet/sync.rs +++ b/src/commands/wallet/sync.rs @@ -12,27 +12,27 @@ use tonic::transport::Channel; use tracing::{debug, error, info}; use zcash_client_backend::{ data_api::{ + WalletCommitmentTrees, WalletRead, WalletWrite, chain::{ - error::Error as ChainError, scan_cached_blocks, BlockSource, ChainState, - CommitmentTreeRoot, + BlockSource, ChainState, CommitmentTreeRoot, error::Error as ChainError, + scan_cached_blocks, }, scanning::{ScanPriority, ScanRange}, - WalletCommitmentTrees, WalletRead, WalletWrite, }, - proto::service::{self, compact_tx_streamer_client::CompactTxStreamerClient, BlockId}, + proto::service::{self, BlockId, compact_tx_streamer_client::CompactTxStreamerClient}, }; use zcash_client_sqlite::{ - chain::BlockMeta, util::SystemClock, FsBlockDb, FsBlockDbError, WalletDb, + FsBlockDb, FsBlockDbError, WalletDb, chain::BlockMeta, util::SystemClock, }; use zcash_primitives::merkle_tree::HashSer; use zcash_protocol::consensus::{BlockHeight, Parameters}; use crate::{ + ShutdownListener, config::get_wallet_network, data::{get_block_path, get_db_paths}, error, remote::ConnectionArgs, - ShutdownListener, }; #[cfg(feature = "transparent-inputs")] diff --git a/src/commands/wallet/sync/defrag.rs b/src/commands/wallet/sync/defrag.rs index 0a9969c..b514c14 100644 --- a/src/commands/wallet/sync/defrag.rs +++ b/src/commands/wallet/sync/defrag.rs @@ -11,8 +11,8 @@ use tokio::sync::{mpsc, oneshot}; use tracing::{error, info, warn}; use tui_logger::{TuiLoggerLevelOutput, TuiLoggerSmartWidget}; use zcash_client_backend::data_api::{ - scanning::{ScanPriority, ScanRange}, WalletSummary, + scanning::{ScanPriority, ScanRange}, }; use zcash_client_sqlite::AccountUuid; use zcash_protocol::consensus::BlockHeight; diff --git a/src/commands/wallet/tree/explore.rs b/src/commands/wallet/tree/explore.rs index 5dfe8f7..f9ab808 100644 --- a/src/commands/wallet/tree/explore.rs +++ b/src/commands/wallet/tree/explore.rs @@ -8,30 +8,30 @@ use crossterm::event::KeyCode; use futures_util::FutureExt; use incrementalmerkletree::{Address, Level}; use ratatui::{ + Frame, layout::{Constraint, Layout}, style::Color, widgets::{ - canvas::{Canvas, Circle, Context, Line}, Block, Paragraph, Widget, + canvas::{Canvas, Circle, Context, Line}, }, - Frame, }; -use shardtree::{error::ShardTreeError, store::ShardStore, LocatedTree, RetentionFlags}; +use shardtree::{LocatedTree, RetentionFlags, error::ShardTreeError, store::ShardStore}; use tokio::sync::{mpsc, oneshot}; use tracing::{info, warn}; use zcash_client_backend::data_api::{WalletCommitmentTrees, WalletRead}; -use zcash_client_sqlite::{wallet::commitment_tree::SqliteShardStore, WalletDb}; +use zcash_client_sqlite::{WalletDb, wallet::commitment_tree::SqliteShardStore}; use zcash_primitives::merkle_tree::HashSer; use zcash_protocol::{ - consensus::{BlockHeight, Network}, ShieldedProtocol, + consensus::{BlockHeight, Network}, }; use crate::{ + ShutdownListener, config::get_wallet_network, data::get_db_paths, tui::{self, Tui}, - ShutdownListener, }; fn parse_pool(data: &str) -> Result { diff --git a/src/commands/wallet/tree/fix.rs b/src/commands/wallet/tree/fix.rs index 5627f8a..7ba1ad7 100644 --- a/src/commands/wallet/tree/fix.rs +++ b/src/commands/wallet/tree/fix.rs @@ -2,7 +2,7 @@ use clap::Args; use nonempty::NonEmpty; use rand::rngs::OsRng; use zcash_client_backend::data_api::scanning::ScanPriority; -use zcash_client_sqlite::{util::SystemClock, WalletDb}; +use zcash_client_sqlite::{WalletDb, util::SystemClock}; use crate::{config::get_wallet_network, data::get_db_paths}; diff --git a/src/commands/wallet/upgrade.rs b/src/commands/wallet/upgrade.rs index 3295e1f..9c9ff8c 100644 --- a/src/commands/wallet/upgrade.rs +++ b/src/commands/wallet/upgrade.rs @@ -2,10 +2,10 @@ use anyhow::anyhow; use clap::Args; use rand::rngs::OsRng; use zcash_client_sqlite::{ + FsBlockDb, WalletDb, chain::init::init_blockmeta_db, util::SystemClock, - wallet::init::{init_wallet_db, WalletMigrationError}, - FsBlockDb, WalletDb, + wallet::init::{WalletMigrationError, init_wallet_db}, }; use crate::{ diff --git a/src/commands/zip48/init.rs b/src/commands/zip48/init.rs index 2457499..1838682 100644 --- a/src/commands/zip48/init.rs +++ b/src/commands/zip48/init.rs @@ -9,7 +9,7 @@ use zcash_protocol::consensus::{self, Parameters}; use crate::{ config::WalletConfig, - data::{init_dbs, Network}, + data::{Network, init_dbs}, }; // Options accepted for the `zip48 init` command diff --git a/src/commands/zip48/verify_account.rs b/src/commands/zip48/verify_account.rs index 63c2e0e..230d3ed 100644 --- a/src/commands/zip48/verify_account.rs +++ b/src/commands/zip48/verify_account.rs @@ -1,7 +1,7 @@ use std::fs; use std::path::PathBuf; -use anyhow::{anyhow, Context}; +use anyhow::{Context, anyhow}; use clap::Args; use secrecy::ExposeSecret; use transparent::zip48; diff --git a/src/config.rs b/src/config.rs index ece2fa5..55cc444 100644 --- a/src/config.rs +++ b/src/config.rs @@ -10,7 +10,7 @@ use serde::{Deserialize, Serialize}; use zcash_protocol::consensus::{self, BlockHeight, Parameters}; use crate::{ - data::{Network, DEFAULT_WALLET_DIR}, + data::{DEFAULT_WALLET_DIR, Network}, error, }; diff --git a/src/error.rs b/src/error.rs index a16a8d8..d2101fb 100644 --- a/src/error.rs +++ b/src/error.rs @@ -2,10 +2,10 @@ use std::convert::Infallible; use std::fmt; use zcash_client_backend::data_api::{ - error::Error as WalletError, wallet::input_selection::GreedyInputSelectorError, BirthdayError, + BirthdayError, error::Error as WalletError, wallet::input_selection::GreedyInputSelectorError, }; use zcash_client_sqlite::{ - error::SqliteClientError, wallet::commitment_tree, FsBlockDbError, ReceivedNoteId, + FsBlockDbError, ReceivedNoteId, error::SqliteClientError, wallet::commitment_tree, }; use zcash_keys::keys::DerivationError; use zcash_primitives::transaction::fees::zip317; diff --git a/src/helpers/pczt/create_manual.rs b/src/helpers/pczt/create_manual.rs index c81e133..36e8eb1 100644 --- a/src/helpers/pczt/create_manual.rs +++ b/src/helpers/pczt/create_manual.rs @@ -7,7 +7,7 @@ use transparent::{ }; use zcash_keys::address::{Address, Receiver}; use zcash_primitives::transaction::{builder::Builder, fees::zip317}; -use zcash_protocol::{consensus, memo::MemoBytes, value::Zatoshis, PoolType}; +use zcash_protocol::{PoolType, consensus, memo::MemoBytes, value::Zatoshis}; use zcash_script::script; use crate::error; diff --git a/src/main.rs b/src/main.rs index 1b14527..0132beb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,7 +9,7 @@ use std::sync::atomic::{AtomicUsize, Ordering}; use clap::{Parser, Subcommand}; use iso_currency::Currency; -use tracing_subscriber::{layer::SubscriberExt, Layer}; +use tracing_subscriber::{Layer, layer::SubscriberExt}; mod commands; mod config;