Skip to content

Commit

Permalink
Rename ord wallet satoshis to ord wallet sats (ordinals#1004)
Browse files Browse the repository at this point in the history
  • Loading branch information
casey authored Dec 19, 2022
1 parent 2220054 commit d965ba0
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion docs/src/bounty/3.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ To search an `ord` wallet for sats with a name in `frequency.tsv`, use the
following [`ord`](https://github.com/casey/ord) command:

```
ord wallet satoshis --tsv frequency.tsv
ord wallet sats --tsv frequency.tsv
```

### Part 0
Expand Down
6 changes: 3 additions & 3 deletions docs/src/guides/sat-hunting.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ wallet is named `foo`:
2. Display any rare ordinals wallet `foo`'s UTXOs:

```sh
ord wallet satoshis
ord wallet sats
```

### Searching for Rare Ordinals in a Non-Bitcoin Core Wallet
Expand Down Expand Up @@ -130,7 +130,7 @@ your wallet of funds.
7. Display your wallet's rare ordinals:

```sh
ord wallet satoshis
ord wallet sats
```

### Searching for Rare Ordinals in a Wallet that Exports Multi-path Descriptors
Expand Down Expand Up @@ -231,7 +231,7 @@ those multiple descriptors into Bitcoin Core.
7. Display your wallet's rare ordinals:

```sh
ord wallet satoshis
ord wallet sats
```

### Exporting Descriptors
Expand Down
6 changes: 3 additions & 3 deletions src/subcommand/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ mod create;
mod inscribe;
mod inscriptions;
mod receive;
mod satoshis;
mod sats;
mod send;
mod transaction_builder;
mod transactions;
Expand All @@ -21,7 +21,7 @@ pub(crate) enum Wallet {
#[clap(about = "Generate a receive address")]
Receive(receive::Receive),
#[clap(about = "List wallet satoshis")]
Satoshis(satoshis::Satoshis),
Sats(sats::Sats),
#[clap(about = "Send a satoshi or inscription")]
Send(send::Send),
#[clap(about = "See wallet transactions")]
Expand All @@ -37,7 +37,7 @@ impl Wallet {
Self::Inscribe(inscribe) => inscribe.run(options),
Self::Inscriptions(inscriptions) => inscriptions.run(options),
Self::Receive(receive) => receive.run(options),
Self::Satoshis(satoshis) => satoshis.run(options),
Self::Sats(sats) => sats.run(options),
Self::Send(send) => send.run(options),
Self::Transactions(transactions) => transactions.run(options),
Self::Utxos(utxos) => utxos.run(options),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
use super::*;

#[derive(Debug, Parser)]
pub(crate) struct Satoshis {
pub(crate) struct Sats {
#[clap(
long,
help = "Find satoshis listed in first column of tab-separated value file <TSV>."
)]
tsv: Option<PathBuf>,
}

impl Satoshis {
impl Sats {
pub(crate) fn run(&self, options: Options) -> Result {
let index = Index::open(&options)?;
index.update()?;
Expand Down
16 changes: 8 additions & 8 deletions tests/wallet.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use {super::*, std::str::FromStr};

#[test]
fn satoshis() {
fn sats() {
let rpc_server = test_bitcoincore_rpc::spawn();
let second_coinbase = rpc_server.mine_blocks(1)[0].txdata[0].txid();

CommandBuilder::new("--index-sats wallet satoshis")
CommandBuilder::new("--index-sats wallet sats")
.rpc_server(&rpc_server)
.expected_stdout(format!(
"{}\t{}\t0\tuncommon\n",
Expand All @@ -16,11 +16,11 @@ fn satoshis() {
}

#[test]
fn satoshis_from_tsv_success() {
fn sats_from_tsv_success() {
let rpc_server = test_bitcoincore_rpc::spawn();
let second_coinbase = rpc_server.mine_blocks(1)[0].txdata[0].txid();

CommandBuilder::new("--index-sats wallet satoshis --tsv foo.tsv")
CommandBuilder::new("--index-sats wallet sats --tsv foo.tsv")
.write("foo.tsv", "nvtcsezkbtg")
.rpc_server(&rpc_server)
.expected_stdout(format!(
Expand All @@ -31,9 +31,9 @@ fn satoshis_from_tsv_success() {
}

#[test]
fn satoshis_from_tsv_parse_error() {
fn sats_from_tsv_parse_error() {
let rpc_server = test_bitcoincore_rpc::spawn();
CommandBuilder::new("wallet satoshis --tsv foo.tsv")
CommandBuilder::new("wallet sats --tsv foo.tsv")
.write("foo.tsv", "===")
.rpc_server(&rpc_server)
.expected_exit_code(1)
Expand All @@ -44,9 +44,9 @@ fn satoshis_from_tsv_parse_error() {
}

#[test]
fn satoshis_from_tsv_file_not_found() {
fn sats_from_tsv_file_not_found() {
let rpc_server = test_bitcoincore_rpc::spawn();
CommandBuilder::new("wallet satoshis --tsv foo.tsv")
CommandBuilder::new("wallet sats --tsv foo.tsv")
.rpc_server(&rpc_server)
.expected_exit_code(1)
.stderr_regex("error: I/O error reading `.*`\nbecause: .*\n")
Expand Down

0 comments on commit d965ba0

Please sign in to comment.