From 1116f83c08cce77297285b772a9661acda49783c Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Mon, 12 Dec 2022 10:18:28 -0800 Subject: [PATCH 1/3] Add install script (#940) --- install.sh | 145 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100755 install.sh diff --git a/install.sh b/install.sh new file mode 100755 index 0000000000..33e5087ee5 --- /dev/null +++ b/install.sh @@ -0,0 +1,145 @@ +#!/usr/bin/env bash + +set -euo pipefail + +if [ ! -z ${GITHUB_ACTIONS-} ]; then + set -x +fi + +help() { + cat <<'EOF' +Install a binary release of ord hosted on GitHub + +USAGE: + install [options] + +FLAGS: + -h, --help Display this message + -f, --force Force overwriting an existing binary + +OPTIONS: + --tag TAG Tag (version) of the crate to install, defaults to latest release + --to LOCATION Where to install the binary [default: ~/.cargo/bin] + --target TARGET +EOF +} + +git=casey/ord +crate=ord +url=https://github.com/casey/ord +releases=$url/releases + +say() { + echo "install: $@" +} + +say_err() { + say "$@" >&2 +} + +err() { + if [ ! -z ${td-} ]; then + rm -rf $td + fi + + say_err "error: $@" + exit 1 +} + +need() { + if ! command -v $1 > /dev/null 2>&1; then + err "need $1 (command not found)" + fi +} + +force=false +while test $# -gt 0; do + case $1 in + --force | -f) + force=true + ;; + --help | -h) + help + exit 0 + ;; + --tag) + tag=$2 + shift + ;; + --target) + target=$2 + shift + ;; + --to) + dest=$2 + shift + ;; + *) + ;; + esac + shift +done + +# Dependencies +need curl +need install +need mkdir +need mktemp +need tar + +# Optional dependencies +if [ -z ${tag-} ]; then + need cut + need rev +fi + +if [ -z ${dest-} ]; then + dest="$HOME/.cargo/bin" +fi + +if [ -z ${tag-} ]; then + tag=$(curl --proto =https --tlsv1.2 -sSf https://api.github.com/repos/casey/ord/releases/latest | + grep tag_name | + cut -d'"' -f4 + ) +fi + +if [ -z ${target-} ]; then + uname_target=`uname -m`-`uname -s` + + case $uname_target in + aarch64-Linux) target=aarch64-unknown-linux-musl;; + arm64-Darwin) target=aarch64-apple-darwin;; + x86_64-Darwin) target=x86_64-apple-darwin;; + x86_64-Linux) target=x86_64-unknown-linux-musl;; + x86_64-Windows_NT) target=x86_64-pc-windows-msvc;; + *) + err 'Could not determine target from output of `uname -m`-`uname -s`, please use `--target`:' $uname_target + ;; + esac +fi + +archive="$releases/download/$tag/$crate-$tag-$target.tar.gz" + +say_err "Repository: $url" +say_err "Crate: $crate" +say_err "Tag: $tag" +say_err "Target: $target" +say_err "Destination: $dest" +say_err "Archive: $archive" + +td=$(mktemp -d || mktemp -d -t tmp) +curl --proto =https --tlsv1.2 -sSfL $archive | tar -C $td -xz + +for f in $(ls $td); do + test -x $td/$f || continue + + if [ -e "$dest/$f" ] && [ $force = false ]; then + err "$f already exists in $dest" + else + mkdir -p $dest + install -m 755 $td/$f $dest + fi +done + +rm -rf $td From 6798731545f0dd0d8e10ac34ac9a7fad9564aa03 Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Mon, 12 Dec 2022 10:24:04 -0800 Subject: [PATCH 2/3] Merge CI jobs into one workflow (#935) --- .github/workflows/ci.yaml | 99 +++++++++++++++++++++++++++++++++++++ .github/workflows/docs.yaml | 42 ---------------- .github/workflows/lint.yaml | 46 ----------------- .github/workflows/test.yaml | 41 --------------- 4 files changed, 99 insertions(+), 129 deletions(-) create mode 100644 .github/workflows/ci.yaml delete mode 100644 .github/workflows/docs.yaml delete mode 100644 .github/workflows/lint.yaml delete mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000000..5af6742ba0 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,99 @@ +name: CI + +on: + push: + branches: + - master + pull_request: + branches: + - master + +defaults: + run: + shell: bash + +jobs: + docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3.0.0 + + - uses: peaceiris/actions-mdbook@v1 + with: + mdbook-version: latest + + - name: Install mdbook-linkcheck + run: | + mkdir -p mdbook-linkcheck + cd mdbook-linkcheck + wget https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases/latest/download/mdbook-linkcheck.x86_64-unknown-linux-gnu.zip + unzip mdbook-linkcheck.x86_64-unknown-linux-gnu.zip + chmod +x mdbook-linkcheck + pwd >> $GITHUB_PATH + + - run: mdbook build docs + + - name: Deploy Pages + uses: peaceiris/actions-gh-pages@v3 + if: github.ref == 'refs/heads/master' + with: + github_token: ${{secrets.GITHUB_TOKEN}} + publish_branch: gh-pages + publish_dir: docs/build/html + lint: + runs-on: ubuntu-latest + + env: + RUSTFLAGS: --deny warnings + + steps: + - uses: actions/checkout@v2 + + - name: Install Rust Toolchain Components + uses: actions-rs/toolchain@v1 + with: + components: clippy, rustfmt + override: true + toolchain: stable + + - uses: Swatinem/rust-cache@v1 + + - name: Check Lockfile + run: cargo update --locked --package ord + + - name: Clippy + run: cargo clippy --all --all-targets + + - name: Format + run: cargo fmt --all -- --check + + - name: Check for Forbidden Words + run: | + sudo apt-get install ripgrep + ./bin/forbid + test: + strategy: + matrix: + os: + - macos-latest + - ubuntu-latest + - windows-latest + + runs-on: ${{matrix.os}} + + env: + RUSTFLAGS: --deny warnings + + steps: + - uses: actions/checkout@v2 + + - name: Install Rust Toolchain Components + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + + - uses: Swatinem/rust-cache@v1 + + - name: Test + run: cargo test --all diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml deleted file mode 100644 index 589349c0e2..0000000000 --- a/.github/workflows/docs.yaml +++ /dev/null @@ -1,42 +0,0 @@ -name: Docs - -on: - pull_request: - branches: - - master - push: - branches: - - master - -defaults: - run: - shell: bash - -jobs: - docs: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3.0.0 - - - uses: peaceiris/actions-mdbook@v1 - with: - mdbook-version: latest - - - name: Install mdbook-linkcheck - run: | - mkdir -p mdbook-linkcheck - cd mdbook-linkcheck - wget https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases/latest/download/mdbook-linkcheck.x86_64-unknown-linux-gnu.zip - unzip mdbook-linkcheck.x86_64-unknown-linux-gnu.zip - chmod +x mdbook-linkcheck - pwd >> $GITHUB_PATH - - - run: mdbook build docs - - - name: Deploy Pages - uses: peaceiris/actions-gh-pages@v3 - if: github.ref == 'refs/heads/master' - with: - github_token: ${{secrets.GITHUB_TOKEN}} - publish_branch: gh-pages - publish_dir: docs/build/html diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml deleted file mode 100644 index f70714bec3..0000000000 --- a/.github/workflows/lint.yaml +++ /dev/null @@ -1,46 +0,0 @@ -name: Lint - -on: - push: - branches: - - master - pull_request: - branches: - - master - -defaults: - run: - shell: bash - -jobs: - lint: - runs-on: ubuntu-latest - - env: - RUSTFLAGS: --deny warnings - - steps: - - uses: actions/checkout@v2 - - - name: Install Rust Toolchain Components - uses: actions-rs/toolchain@v1 - with: - components: clippy, rustfmt - override: true - toolchain: stable - - - uses: Swatinem/rust-cache@v1 - - - name: Check Lockfile - run: cargo update --locked --package ord - - - name: Clippy - run: cargo clippy --all --all-targets - - - name: Format - run: cargo fmt --all -- --check - - - name: Check for Forbidden Words - run: | - sudo apt-get install ripgrep - ./bin/forbid diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml deleted file mode 100644 index 7112f67aef..0000000000 --- a/.github/workflows/test.yaml +++ /dev/null @@ -1,41 +0,0 @@ -name: Test - -on: - push: - branches: - - master - pull_request: - branches: - - master - -defaults: - run: - shell: bash - -jobs: - test: - strategy: - matrix: - os: - - macos-latest - - ubuntu-latest - - windows-latest - - runs-on: ${{matrix.os}} - - env: - RUSTFLAGS: --deny warnings - - steps: - - uses: actions/checkout@v2 - - - name: Install Rust Toolchain Components - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - - - uses: Swatinem/rust-cache@v1 - - - name: Test - run: cargo test --all From 2f8f098d230406d8a44140075829e53493de2f1f Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Mon, 12 Dec 2022 10:28:48 -0800 Subject: [PATCH 3/3] Add help text to subcommands (#934) --- docs/src/bounty/3.md | 2 +- docs/src/guides/ordinal-hunting.md | 6 +-- src/subcommand.rs | 12 ++++- src/subcommand/wallet.rs | 54 ++++++++++--------- .../wallet/{identify.rs => satoshis.rs} | 50 ++++++++--------- tests/wallet.rs | 16 +++--- 6 files changed, 78 insertions(+), 62 deletions(-) rename src/subcommand/wallet/{identify.rs => satoshis.rs} (83%) diff --git a/docs/src/bounty/3.md b/docs/src/bounty/3.md index 041e717f2a..0bbe8defe3 100644 --- a/docs/src/bounty/3.md +++ b/docs/src/bounty/3.md @@ -34,7 +34,7 @@ To search an ordinal wallet for ordinals with a name in `frequency.tsv`, use the following [`ord`](https://github.com/casey/ord) command: ``` -ord wallet identify --ordinals frequency.tsv +ord wallet satoshis --tsv frequency.tsv ``` ### Part 0 diff --git a/docs/src/guides/ordinal-hunting.md b/docs/src/guides/ordinal-hunting.md index f3a12b1e86..7148e59dab 100644 --- a/docs/src/guides/ordinal-hunting.md +++ b/docs/src/guides/ordinal-hunting.md @@ -67,7 +67,7 @@ wallet is named `foo`: 2. Display any rare ordinals wallet `foo`'s UTXOs: ```sh - ord wallet identify + ord wallet satoshis ``` ### Searching for Rare Ordinals in a Non-Bitcoin Core Wallet @@ -130,7 +130,7 @@ your wallet of funds. 7. Display your wallet's rare ordinals: ```sh - ord wallet identify + ord wallet satoshis ``` ### Searching for Rare Ordinals in a Wallet that Exports Multi-path Descriptors @@ -231,7 +231,7 @@ those multiple descriptors into Bitcoin Core. 7. Display your wallet's rare ordinals: ```sh - ord wallet identify + ord wallet satoshis ``` ### Exporting Descriptors diff --git a/src/subcommand.rs b/src/subcommand.rs index 21514e431f..2cea1ec096 100644 --- a/src/subcommand.rs +++ b/src/subcommand.rs @@ -14,17 +14,27 @@ mod wallet; #[derive(Debug, Parser)] pub(crate) enum Subcommand { + #[clap(about = "List the first satoshis of each reward epoch")] Epochs, + #[clap(about = "Find a satoshi's current location")] Find(find::Find), + #[clap(about = "Update the index")] Index, + #[clap(about = "Display index statistics")] Info(info::Info), + #[clap(about = "List the satoshis in an output")] List(list::List), + #[clap(about = "Parse a satoshi from ordinal notation")] Parse(parse::Parse), + #[clap(about = "Display information about a block's subsidy")] Subsidy(subsidy::Subsidy), + #[clap(about = "Run the explorer server")] Server(server::Server), + #[clap(about = "Display Bitcoin supply information")] Supply, + #[clap(about = "Display satoshi traits")] Traits(traits::Traits), - #[clap(subcommand)] + #[clap(subcommand, about = "Wallet commands")] Wallet(wallet::Wallet), } diff --git a/src/subcommand/wallet.rs b/src/subcommand/wallet.rs index 1c795fc9cb..eb251aaca1 100644 --- a/src/subcommand/wallet.rs +++ b/src/subcommand/wallet.rs @@ -1,13 +1,42 @@ use {super::*, transaction_builder::TransactionBuilder}; -mod identify; mod inscribe; mod inscriptions; mod receive; +mod satoshis; mod send; mod transaction_builder; mod utxos; +#[derive(Debug, Parser)] +pub(crate) enum Wallet { + #[clap(about = "List wallet satoshis")] + Satoshis(satoshis::Satoshis), + #[clap(about = "Create an inscription")] + Inscribe(inscribe::Inscribe), + #[clap(about = "List wallet inscriptions")] + Inscriptions(inscriptions::Inscriptions), + #[clap(about = "Generate a receive address")] + Receive(receive::Receive), + #[clap(about = "Send a satoshi or inscription")] + Send(send::Send), + #[clap(about = "List wallet UTXOs")] + Utxos(utxos::Utxos), +} + +impl Wallet { + pub(crate) fn run(self, options: Options) -> Result { + match self { + Self::Satoshis(satoshis) => satoshis.run(options), + Self::Inscribe(inscribe) => inscribe.run(options), + Self::Inscriptions(inscriptions) => inscriptions.run(options), + Self::Receive(receive) => receive.run(options), + Self::Send(send) => send.run(options), + Self::Utxos(utxos) => utxos.run(options), + } + } +} + fn list_unspent(options: &Options, index: &Index) -> Result)>> { let client = options.bitcoin_rpc_client()?; @@ -56,26 +85,3 @@ fn get_change_addresses(options: &Options, n: usize) -> Result> { Ok(addresses) } - -#[derive(Debug, Parser)] -pub(crate) enum Wallet { - Identify(identify::Identify), - Inscribe(inscribe::Inscribe), - Inscriptions(inscriptions::Inscriptions), - Receive(receive::Receive), - Send(send::Send), - Utxos(utxos::Utxos), -} - -impl Wallet { - pub(crate) fn run(self, options: Options) -> Result { - match self { - Self::Identify(identify) => identify.run(options), - Self::Inscribe(inscribe) => inscribe.run(options), - Self::Inscriptions(inscriptions) => inscriptions.run(options), - Self::Receive(receive) => receive.run(options), - Self::Send(send) => send.run(options), - Self::Utxos(utxos) => utxos.run(options), - } - } -} diff --git a/src/subcommand/wallet/identify.rs b/src/subcommand/wallet/satoshis.rs similarity index 83% rename from src/subcommand/wallet/identify.rs rename to src/subcommand/wallet/satoshis.rs index 1bd2735338..7d7d9f142c 100644 --- a/src/subcommand/wallet/identify.rs +++ b/src/subcommand/wallet/satoshis.rs @@ -1,23 +1,23 @@ use super::*; #[derive(Debug, Parser)] -pub(crate) struct Identify { +pub(crate) struct Satoshis { #[clap( long, - help = "Find ordinals listed in first column of tab-separated value file ." + help = "Find satoshis listed in first column of tab-separated value file ." )] - ordinals: Option, + tsv: Option, } -impl Identify { +impl Satoshis { pub(crate) fn run(&self, options: Options) -> Result { let index = Index::open(&options)?; index.update()?; let utxos = list_unspent(&options, &index)?; - if let Some(path) = &self.ordinals { - for (output, ordinal) in identify_from_tsv( + if let Some(path) = &self.tsv { + for (output, ordinal) in satoshis_from_tsv( utxos, &fs::read_to_string(path) .with_context(|| format!("I/O error reading `{}`", path.display()))?, @@ -25,7 +25,7 @@ impl Identify { println!("{output}\t{ordinal}"); } } else { - for (output, ordinal, offset, rarity) in identify_rare(utxos) { + for (output, ordinal, offset, rarity) in rare_satoshis(utxos) { println!("{output}\t{ordinal}\t{offset}\t{rarity}"); } } @@ -34,7 +34,7 @@ impl Identify { } } -fn identify_rare(utxos: Vec<(OutPoint, Vec<(u64, u64)>)>) -> Vec<(OutPoint, Ordinal, u64, Rarity)> { +fn rare_satoshis(utxos: Vec<(OutPoint, Vec<(u64, u64)>)>) -> Vec<(OutPoint, Ordinal, u64, Rarity)> { utxos .into_iter() .flat_map(|(outpoint, ordinal_ranges)| { @@ -54,7 +54,7 @@ fn identify_rare(utxos: Vec<(OutPoint, Vec<(u64, u64)>)>) -> Vec<(OutPoint, Ordi .collect() } -fn identify_from_tsv( +fn satoshis_from_tsv( utxos: Vec<(OutPoint, Vec<(u64, u64)>)>, tsv: &str, ) -> Result> { @@ -115,7 +115,7 @@ mod tests { #[test] fn identify_no_rare_ordinals() { assert_eq!( - identify_rare(vec![( + rare_satoshis(vec![( outpoint(1), vec![(51 * COIN_VALUE, 100 * COIN_VALUE), (1234, 5678)], )]), @@ -126,7 +126,7 @@ mod tests { #[test] fn identify_one_rare_ordinal() { assert_eq!( - identify_rare(vec![( + rare_satoshis(vec![( outpoint(1), vec![(10, 80), (50 * COIN_VALUE, 100 * COIN_VALUE)], )]), @@ -137,7 +137,7 @@ mod tests { #[test] fn identify_two_rare_ordinals() { assert_eq!( - identify_rare(vec![( + rare_satoshis(vec![( outpoint(1), vec![(0, 100), (1050000000000000, 1150000000000000)], )]), @@ -151,7 +151,7 @@ mod tests { #[test] fn identify_rare_ordinals_in_different_outpoints() { assert_eq!( - identify_rare(vec![ + rare_satoshis(vec![ (outpoint(1), vec![(50 * COIN_VALUE, 55 * COIN_VALUE)]), (outpoint(2), vec![(100 * COIN_VALUE, 111 * COIN_VALUE)],), ]), @@ -165,7 +165,7 @@ mod tests { #[test] fn identify_from_tsv_none() { assert_eq!( - identify_from_tsv(vec![(outpoint(1), vec![(0, 1)])], "1\n").unwrap(), + satoshis_from_tsv(vec![(outpoint(1), vec![(0, 1)])], "1\n").unwrap(), vec![] ) } @@ -173,7 +173,7 @@ mod tests { #[test] fn identify_from_tsv_single() { assert_eq!( - identify_from_tsv(vec![(outpoint(1), vec![(0, 1)])], "0\n").unwrap(), + satoshis_from_tsv(vec![(outpoint(1), vec![(0, 1)])], "0\n").unwrap(), vec![(outpoint(1), "0"),] ) } @@ -181,7 +181,7 @@ mod tests { #[test] fn identify_from_tsv_two_in_one_range() { assert_eq!( - identify_from_tsv(vec![(outpoint(1), vec![(0, 2)])], "0\n1\n").unwrap(), + satoshis_from_tsv(vec![(outpoint(1), vec![(0, 2)])], "0\n1\n").unwrap(), vec![(outpoint(1), "0"), (outpoint(1), "1"),] ) } @@ -189,7 +189,7 @@ mod tests { #[test] fn identify_from_tsv_out_of_order_tsv() { assert_eq!( - identify_from_tsv(vec![(outpoint(1), vec![(0, 2)])], "1\n0\n").unwrap(), + satoshis_from_tsv(vec![(outpoint(1), vec![(0, 2)])], "1\n0\n").unwrap(), vec![(outpoint(1), "0"), (outpoint(1), "1"),] ) } @@ -197,7 +197,7 @@ mod tests { #[test] fn identify_from_tsv_out_of_order_ranges() { assert_eq!( - identify_from_tsv(vec![(outpoint(1), vec![(1, 2), (0, 1)])], "1\n0\n").unwrap(), + satoshis_from_tsv(vec![(outpoint(1), vec![(1, 2), (0, 1)])], "1\n0\n").unwrap(), vec![(outpoint(1), "0"), (outpoint(1), "1"),] ) } @@ -205,7 +205,7 @@ mod tests { #[test] fn identify_from_tsv_two_in_two_ranges() { assert_eq!( - identify_from_tsv(vec![(outpoint(1), vec![(0, 1), (1, 2)])], "0\n1\n").unwrap(), + satoshis_from_tsv(vec![(outpoint(1), vec![(0, 1), (1, 2)])], "0\n1\n").unwrap(), vec![(outpoint(1), "0"), (outpoint(1), "1"),] ) } @@ -213,7 +213,7 @@ mod tests { #[test] fn identify_from_tsv_two_in_two_outputs() { assert_eq!( - identify_from_tsv( + satoshis_from_tsv( vec![(outpoint(1), vec![(0, 1)]), (outpoint(2), vec![(1, 2)])], "0\n1\n" ) @@ -225,7 +225,7 @@ mod tests { #[test] fn identify_from_tsv_ignores_extra_columns() { assert_eq!( - identify_from_tsv(vec![(outpoint(1), vec![(0, 1)])], "0\t===\n").unwrap(), + satoshis_from_tsv(vec![(outpoint(1), vec![(0, 1)])], "0\t===\n").unwrap(), vec![(outpoint(1), "0"),] ) } @@ -233,7 +233,7 @@ mod tests { #[test] fn identify_from_tsv_ignores_empty_lines() { assert_eq!( - identify_from_tsv(vec![(outpoint(1), vec![(0, 1)])], "0\n\n\n").unwrap(), + satoshis_from_tsv(vec![(outpoint(1), vec![(0, 1)])], "0\n\n\n").unwrap(), vec![(outpoint(1), "0"),] ) } @@ -241,7 +241,7 @@ mod tests { #[test] fn identify_from_tsv_ignores_comments() { assert_eq!( - identify_from_tsv(vec![(outpoint(1), vec![(0, 1)])], "0\n#===\n").unwrap(), + satoshis_from_tsv(vec![(outpoint(1), vec![(0, 1)])], "0\n#===\n").unwrap(), vec![(outpoint(1), "0"),] ) } @@ -249,7 +249,7 @@ mod tests { #[test] fn parse_error_reports_line_and_value() { assert_eq!( - identify_from_tsv(vec![(outpoint(1), vec![(0, 1)])], "0\n===\n") + satoshis_from_tsv(vec![(outpoint(1), vec![(0, 1)])], "0\n===\n") .unwrap_err() .to_string(), "failed to parse ordinal from string \"===\" on line 2: invalid digit found in string", @@ -282,7 +282,7 @@ mod tests { let start = Instant::now(); assert_eq!( - identify_from_tsv(utxos, &tsv) + satoshis_from_tsv(utxos, &tsv) .unwrap() .into_iter() .map(|(outpoint, s)| (outpoint, s.parse().unwrap())) diff --git a/tests/wallet.rs b/tests/wallet.rs index 3091476172..0d4e654007 100644 --- a/tests/wallet.rs +++ b/tests/wallet.rs @@ -13,11 +13,11 @@ fn reveal_txid_from_inscribe_stdout(stdout: &str) -> Txid { } #[test] -fn identify() { +fn satoshis() { let rpc_server = test_bitcoincore_rpc::spawn(); let second_coinbase = rpc_server.mine_blocks(1)[0].txdata[0].txid(); - CommandBuilder::new("--index-ordinals wallet identify") + CommandBuilder::new("--index-ordinals wallet satoshis") .rpc_server(&rpc_server) .expected_stdout(format!( "{}\t{}\t0\tuncommon\n", @@ -28,11 +28,11 @@ fn identify() { } #[test] -fn identify_from_tsv_success() { +fn satoshis_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-ordinals wallet identify --ordinals foo.tsv") + CommandBuilder::new("--index-ordinals wallet satoshis --tsv foo.tsv") .write("foo.tsv", "nvtcsezkbtg") .rpc_server(&rpc_server) .expected_stdout(format!( @@ -43,9 +43,9 @@ fn identify_from_tsv_success() { } #[test] -fn identify_from_tsv_parse_error() { +fn satoshis_from_tsv_parse_error() { let rpc_server = test_bitcoincore_rpc::spawn(); - CommandBuilder::new("wallet identify --ordinals foo.tsv") + CommandBuilder::new("wallet satoshis --tsv foo.tsv") .write("foo.tsv", "===") .rpc_server(&rpc_server) .expected_exit_code(1) @@ -56,9 +56,9 @@ fn identify_from_tsv_parse_error() { } #[test] -fn identify_from_tsv_file_not_found() { +fn satoshis_from_tsv_file_not_found() { let rpc_server = test_bitcoincore_rpc::spawn(); - CommandBuilder::new("wallet identify --ordinals foo.tsv") + CommandBuilder::new("wallet satoshis --tsv foo.tsv") .rpc_server(&rpc_server) .expected_exit_code(1) .stderr_regex("error: I/O error reading `.*`\nbecause: .*\n")