diff --git a/src/subcommand/wallet.rs b/src/subcommand/wallet.rs index 903b7e6dc5..fa35a253a4 100644 --- a/src/subcommand/wallet.rs +++ b/src/subcommand/wallet.rs @@ -20,7 +20,7 @@ pub(crate) enum Wallet { #[clap(about = "Create an inscription")] Inscribe(inscribe::Inscribe), #[clap(about = "List wallet inscriptions")] - Inscriptions(inscriptions::Inscriptions), + Inscriptions, #[clap(about = "Generate a receive address")] Receive, #[clap(about = "List wallet satoshis")] @@ -39,7 +39,7 @@ impl Wallet { Self::Balance => balance::run(options), Self::Create => create::run(options), Self::Inscribe(inscribe) => inscribe.run(options), - Self::Inscriptions(inscriptions) => inscriptions.run(options), + Self::Inscriptions => inscriptions::run(options), Self::Receive => receive::run(options), Self::Sats(sats) => sats.run(options), Self::Send(send) => send.run(options), diff --git a/src/subcommand/wallet/inscriptions.rs b/src/subcommand/wallet/inscriptions.rs index 05221ab6eb..a360d4942d 100644 --- a/src/subcommand/wallet/inscriptions.rs +++ b/src/subcommand/wallet/inscriptions.rs @@ -1,22 +1,17 @@ use super::*; -#[derive(Debug, Parser)] -pub(crate) struct Inscriptions {} +pub(crate) fn run(options: Options) -> Result { + let index = Index::open(&options)?; + index.update()?; -impl Inscriptions { - pub(crate) fn run(self, options: Options) -> Result { - let index = Index::open(&options)?; - index.update()?; + let inscriptions = index.get_inscriptions(None)?; + let utxos = list_utxos(&options)?; - let inscriptions = index.get_inscriptions(None)?; - let utxos = list_utxos(&options)?; - - for (satpoint, inscription_id) in inscriptions { - if utxos.contains_key(&satpoint.outpoint) { - println!("{}\t{}", inscription_id, satpoint); - } + for (satpoint, inscription_id) in inscriptions { + if utxos.contains_key(&satpoint.outpoint) { + println!("{}\t{}", inscription_id, satpoint); } - - Ok(()) } + + Ok(()) }