diff --git a/src/subcommand/wallet/inscribe.rs b/src/subcommand/wallet/inscribe.rs index 92a33b21e2..915613e8fe 100644 --- a/src/subcommand/wallet/inscribe.rs +++ b/src/subcommand/wallet/inscribe.rs @@ -58,13 +58,13 @@ pub(crate) struct Inscribe { impl Inscribe { pub(crate) fn run(self, options: Options) -> Result { - let client = options.bitcoin_rpc_client_for_wallet_command(false)?; - let inscription = Inscription::from_file(options.chain(), &self.file)?; let index = Index::open(&options)?; index.update()?; + let client = options.bitcoin_rpc_client_for_wallet_command(false)?; + let mut utxos = index.get_unspent_outputs(Wallet::load(&options)?)?; let inscriptions = index.get_inscriptions(None)?; diff --git a/src/subcommand/wallet/send.rs b/src/subcommand/wallet/send.rs index a5e096ed0a..85a22f3c09 100644 --- a/src/subcommand/wallet/send.rs +++ b/src/subcommand/wallet/send.rs @@ -15,8 +15,6 @@ pub struct Output { impl Send { pub(crate) fn run(self, options: Options) -> Result { - let client = options.bitcoin_rpc_client_for_wallet_command(false)?; - if !self.address.is_valid_for_network(options.chain().network()) { bail!( "Address `{}` is not valid for {}", @@ -28,6 +26,8 @@ impl Send { let index = Index::open(&options)?; index.update()?; + let client = options.bitcoin_rpc_client_for_wallet_command(false)?; + let unspent_outputs = index.get_unspent_outputs(Wallet::load(&options)?)?; let inscriptions = index.get_inscriptions(None)?; diff --git a/tests/wallet/inscribe.rs b/tests/wallet/inscribe.rs index 4be097c8dd..16b486037e 100644 --- a/tests/wallet/inscribe.rs +++ b/tests/wallet/inscribe.rs @@ -43,6 +43,7 @@ fn inscribe_fails_if_bitcoin_core_is_too_old() { let rpc_server = test_bitcoincore_rpc::builder().version(230000).build(); CommandBuilder::new("wallet inscribe hello.txt") + .write("hello.txt", "HELLOWORLD") .expected_exit_code(1) .expected_stderr("error: Bitcoin Core 24.0.0 or newer required, current version is 23.0.0\n") .rpc_server(&rpc_server)