From c0210230d105f253b693496b9440b347bfc4913d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zoe=20Faltib=C3=A0?= Date: Thu, 25 Apr 2024 12:15:06 +0200 Subject: [PATCH] WIP bootstrap project --- .github/workflows/checks.yml | 70 + .gitignore | 3 + .gitmodules | 66 + Cargo.lock | 3140 ++++++++++++++++++++++++++++++++++ Cargo.toml | 134 ++ LICENSE | 201 +++ README.md | 74 + amplify-derive | 1 + amplify-num | 1 + ascii-armor | 1 + bitcoin_foundation | 1 + bp-core | 1 + bp-electrum-client | 1 + bp-esplora-client | 1 + bp-std | 1 + bp-wallet | 1 + client_side_validation | 1 + codecov.yml | 6 + descriptor-wallet | 1 + rgb | 1 + rgb-core | 1 + rgb-interfaces | 1 + rgb-schemata | 1 + rgb-std | 1 + rust-aluvm | 1 + rust-amplify | 1 + rust-baid64 | 1 + strict-encoding | 1 + strict-types | 1 + tests/coverage.sh | 59 + tests/docker-compose.yml | 26 + tests/fixtures/rgb_logo.jpeg | Bin 0 -> 4553 bytes tests/issuance.rs | 192 +++ tests/start_services.sh | 69 + tests/transfers.rs | 471 +++++ tests/utils/chain.rs | 242 +++ tests/utils/helpers.rs | 855 +++++++++ tests/utils/mod.rs | 92 + vesper | 1 + 39 files changed, 5722 insertions(+) create mode 100644 .github/workflows/checks.yml create mode 100644 .gitignore create mode 100644 .gitmodules create mode 100644 Cargo.lock create mode 100644 Cargo.toml create mode 100644 LICENSE create mode 160000 amplify-derive create mode 160000 amplify-num create mode 160000 ascii-armor create mode 160000 bitcoin_foundation create mode 160000 bp-core create mode 160000 bp-electrum-client create mode 160000 bp-esplora-client create mode 160000 bp-std create mode 160000 bp-wallet create mode 160000 client_side_validation create mode 100644 codecov.yml create mode 160000 descriptor-wallet create mode 160000 rgb create mode 160000 rgb-core create mode 160000 rgb-interfaces create mode 160000 rgb-schemata create mode 160000 rgb-std create mode 160000 rust-aluvm create mode 160000 rust-amplify create mode 160000 rust-baid64 create mode 160000 strict-encoding create mode 160000 strict-types create mode 100755 tests/coverage.sh create mode 100644 tests/docker-compose.yml create mode 100644 tests/fixtures/rgb_logo.jpeg create mode 100644 tests/issuance.rs create mode 100755 tests/start_services.sh create mode 100644 tests/transfers.rs create mode 100644 tests/utils/chain.rs create mode 100644 tests/utils/helpers.rs create mode 100644 tests/utils/mod.rs create mode 160000 vesper diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml new file mode 100644 index 0000000..2d67a69 --- /dev/null +++ b/.github/workflows/checks.yml @@ -0,0 +1,70 @@ +name: Code checks + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +env: + CARGO_TERM_COLOR: always + +jobs: + lint: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v4 + with: + submodules: true + - uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + components: clippy + - name: Lint + run: cargo clippy --all-targets -- -D warnings + + format: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v4 + - uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + components: rustfmt + - name: Format + run: cargo fmt --all -- --check + + test_and_coverage: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: true + + - name: Setup rust toolchain + uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + components: llvm-tools-preview + toolchain: stable + + - name: Install llvm-cov + env: + LLVM_COV_RELEASES: https://github.com/taiki-e/cargo-llvm-cov/releases + run: | + host=$(rustc -Vv | grep host | sed 's/host: //') + curl -fsSL $LLVM_COV_RELEASES/latest/download/cargo-llvm-cov-$host.tar.gz | tar xzf - -C "$HOME/.cargo/bin" + + - name: Test and generate coverage report + run: | + INDEXER=esplora cargo llvm-cov --output-path coverage.lcov + INDEXER=electrum cargo llvm-cov --no-clean --output-path coverage.lcov + + - name: Upload coverage report + uses: codecov/codecov-action@v4 + with: + fail_ci_if_error: true + file: coverage.lcov + flags: rust + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..12c72d6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +**/target +**/tests/tmp +/.vim diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..0cdc6cf --- /dev/null +++ b/.gitmodules @@ -0,0 +1,66 @@ +[submodule "rgb-std"] + path = rgb-std + url = https://github.com/RGB-WG/rgb-std.git +[submodule "rust-aluvm"] + path = rust-aluvm + url = https://github.com/aluvm/rust-aluvm +[submodule "rgb-interfaces"] + path = rgb-interfaces + url = https://github.com/RGB-WG/rgb-interfaces +[submodule "client_side_validation"] + path = client_side_validation + url = https://github.com/LNP-BP/client_side_validation/ +[submodule "bp-core"] + path = bp-core + url = https://github.com/BP-WG/bp-core +[submodule "rgb-core"] + path = rgb-core + url = https://github.com/RGB-WG/rgb-core +[submodule "bp-std"] + path = bp-std + url = https://github.com/BP-WG/bp-std +[submodule "rgb-schemata"] + path = rgb-schemata + url = https://github.com/RGB-WG/rgb-schemata +[submodule "strict-types"] + path = strict-types + url = https://github.com/strict-types/strict-types +[submodule "strict-encoding"] + path = strict-encoding + url = https://github.com/strict-types/strict-encoding +[submodule "bp-electrum-client"] + path = bp-electrum-client + url = https://github.com/BP-WG/bp-electrum-client/ +[submodule "rust-amplify"] + path = rust-amplify + url = https://github.com/rust-amplify/rust-amplify +[submodule "rgb"] + path = rgb + url = https://github.com/RGB-WG/rgb +[submodule "descriptor-wallet"] + path = descriptor-wallet + url = https://github.com/BP-WG/descriptor-wallet +[submodule "bp-wallet"] + path = bp-wallet + url = https://github.com/BP-WG/bp-wallet +[submodule "amplify-num"] + path = amplify-num + url = https://github.com/rust-amplify/amplify-num.git +[submodule "amplify-derive"] + path = amplify-derive + url = https://github.com/rust-amplify/amplify-derive.git +[submodule "ascii-armor"] + path = ascii-armor + url = https://github.com/UBIDECO/ascii-armor.git +[submodule "bitcoin_foundation"] + path = bitcoin_foundation + url = https://github.com/BP-WG/bitcoin_foundation.git +[submodule "bp-esplora-client"] + path = bp-esplora-client + url = https://github.com/BP-WG/bp-esplora-client.git +[submodule "vesper"] + path = vesper + url = https://github.com/UBIDECO/vesper.git +[submodule "rust-baid64"] + path = rust-baid64 + url = https://github.com/UBIDECO/rust-baid64.git diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..6921fc9 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,3140 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "aluvm" +version = "0.11.0-beta.6" +dependencies = [ + "amplify 4.6.0", + "ascii-armor", + "baid64", + "blake3", + "getrandom", + "half", + "paste", + "ripemd", + "serde", + "sha2", + "strict_encoding 2.7.0-beta.4", + "strict_types", + "wasm-bindgen", +] + +[[package]] +name = "amplify" +version = "3.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba2ec14f4fb838e9ddace42fa5944bb1ee4dff8477494ba48c5f874e16caf27a" +dependencies = [ + "amplify_derive 2.11.3", + "amplify_num 0.4.1", + "amplify_syn 1.1.6", + "wasm-bindgen", +] + +[[package]] +name = "amplify" +version = "4.6.0" +dependencies = [ + "amplify_apfloat", + "amplify_derive 4.0.0", + "amplify_num 0.5.2", + "amplify_syn 2.0.1", + "ascii", + "rand", + "serde", + "stringly_conversions", + "wasm-bindgen", +] + +[[package]] +name = "amplify_apfloat" +version = "0.3.0" +dependencies = [ + "amplify_num 0.5.2", + "bitflags 2.5.0", + "wasm-bindgen", +] + +[[package]] +name = "amplify_derive" +version = "2.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c3de270e75f27a4468a7c344070109046656e85cb522141f7d40ab4b83803ac" +dependencies = [ + "amplify_syn 1.1.6", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "amplify_derive" +version = "4.0.0" +dependencies = [ + "amplify_syn 2.0.1", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "amplify_num" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f27d3d00d3d115395a7a8a4dc045feb7aa82b641e485f7e15f4e67ac16f4f56d" + +[[package]] +name = "amplify_num" +version = "0.5.2" +dependencies = [ + "serde", + "wasm-bindgen", +] + +[[package]] +name = "amplify_syn" +version = "1.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da24db1445cc7bc3842fa072c2d51fe5b25b812b6a572d65842a4c72e87221ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "amplify_syn" +version = "2.0.1" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "arrayref" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "ascii" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d92bec98840b8f03a5ff5413de5293bfcd8bf96467cf5452609f939ec6f5de16" +dependencies = [ + "serde", +] + +[[package]] +name = "ascii-armor" +version = "0.7.1" +dependencies = [ + "amplify 4.6.0", + "baid64", + "base85", + "sha2", + "strict_encoding 2.7.0-beta.4", +] + +[[package]] +name = "autocfg" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" + +[[package]] +name = "aws-lc-rs" +version = "1.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf7d844e282b4b56750b2d4e893b2205581ded8709fddd2b6aa5418c150ca877" +dependencies = [ + "aws-lc-sys", + "mirai-annotations", + "paste", + "zeroize", +] + +[[package]] +name = "aws-lc-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3a2c29203f6bf296d01141cc8bb9dbd5ecd4c27843f2ee0767bcd5985a927da" +dependencies = [ + "bindgen", + "cc", + "cmake", + "dunce", + "fs_extra", + "libc", + "paste", +] + +[[package]] +name = "backtrace" +version = "0.3.71" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "baid64" +version = "0.2.2" +dependencies = [ + "amplify 4.6.0", + "base64 0.22.1", + "mnemonic", + "sha2", +] + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "base85" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36915bbaca237c626689b5bd14d02f2ba7a5a359d30a2a08be697392e3718079" +dependencies = [ + "thiserror", +] + +[[package]] +name = "bech32" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445" + +[[package]] +name = "bindgen" +version = "0.69.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" +dependencies = [ + "bitflags 2.5.0", + "cexpr", + "clang-sys", + "itertools", + "lazy_static", + "lazycell", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.66", + "which", +] + +[[package]] +name = "bitcoin" +version = "0.29.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0694ea59225b0c5f3cb405ff3f670e4828358ed26aec49dc352f730f0cb1a8a3" +dependencies = [ + "base64 0.13.1", + "bech32", + "bitcoin_hashes 0.11.0", + "secp256k1 0.24.3", +] + +[[package]] +name = "bitcoin-io" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "340e09e8399c7bd8912f495af6aa58bea0c9214773417ffaa8f6460f93aaee56" + +[[package]] +name = "bitcoin-private" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73290177011694f38ec25e165d0387ab7ea749a4b81cd4c80dae5988229f7a57" + +[[package]] +name = "bitcoin_blockchain" +version = "0.10.0" +dependencies = [ + "amplify 3.14.2", + "chrono", + "strict_encoding 0.9.0", +] + +[[package]] +name = "bitcoin_hashes" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90064b8dee6815a6470d60bad07bbbaee885c0e12d04177138fa3291a01b7bc4" + +[[package]] +name = "bitcoin_hashes" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb18c03d0db0247e147a21a6faafd5a7eb851c743db062de72018b6b7e8e4d16" +dependencies = [ + "bitcoin-io", + "hex-conservative", +] + +[[package]] +name = "bitcoin_hd" +version = "0.10.2" +dependencies = [ + "amplify 3.14.2", + "bitcoin", + "miniscript", + "secp256k1 0.24.3", + "slip132", + "strict_encoding 0.9.0", +] + +[[package]] +name = "bitcoin_onchain" +version = "0.10.2" +dependencies = [ + "amplify 3.14.2", + "bitcoin", + "bitcoin_hd", + "chrono", + "strict_encoding 0.9.0", +] + +[[package]] +name = "bitcoin_scripts" +version = "0.10.0" +dependencies = [ + "amplify 3.14.2", + "bitcoin", + "secp256k1 0.24.3", + "stability", + "strict_encoding 0.9.0", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "blake3" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30cca6d3674597c30ddf2c587bf8d9d65c9a84d2326d941cc79c9842dfe0ef52" +dependencies = [ + "arrayref", + "arrayvec", + "cc", + "cfg-if", + "constant_time_eq", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bp-consensus" +version = "0.11.0-beta.6" +dependencies = [ + "amplify 4.6.0", + "chrono", + "commit_verify", + "secp256k1 0.29.0", + "serde", + "strict_encoding 2.7.0-beta.4", + "strict_types", +] + +[[package]] +name = "bp-core" +version = "0.11.0-beta.6" +dependencies = [ + "amplify 4.6.0", + "bp-consensus", + "bp-dbc", + "bp-seals", + "commit_verify", + "getrandom", + "serde", + "single_use_seals", + "strict_encoding 2.7.0-beta.4", + "strict_types", + "wasm-bindgen", +] + +[[package]] +name = "bp-dbc" +version = "0.11.0-beta.6" +dependencies = [ + "amplify 4.6.0", + "base85", + "bp-consensus", + "commit_verify", + "secp256k1 0.29.0", + "serde", + "strict_encoding 2.7.0-beta.4", +] + +[[package]] +name = "bp-derive" +version = "0.11.0-beta.6" +dependencies = [ + "amplify 4.6.0", + "bitcoin_hashes 0.14.0", + "bp-consensus", + "bp-invoice", + "commit_verify", + "indexmap 2.2.6", + "serde", +] + +[[package]] +name = "bp-electrum" +version = "0.11.0-beta.6" +dependencies = [ + "amplify 4.6.0", + "bp-std", + "byteorder", + "libc", + "log", + "rustls 0.23.7", + "serde", + "serde_json", + "sha2", + "webpki-roots 0.25.4", + "winapi", +] + +[[package]] +name = "bp-esplora" +version = "0.11.0-beta.6" +dependencies = [ + "amplify 4.6.0", + "bp-std", + "log", + "reqwest", + "serde", + "serde_with", + "sha2", + "ureq", +] + +[[package]] +name = "bp-invoice" +version = "0.11.0-beta.6" +dependencies = [ + "amplify 4.6.0", + "bech32", + "bitcoin_hashes 0.14.0", + "bp-consensus", + "serde", +] + +[[package]] +name = "bp-seals" +version = "0.11.0-beta.6" +dependencies = [ + "amplify 4.6.0", + "baid64", + "bp-consensus", + "bp-dbc", + "commit_verify", + "rand", + "serde", + "single_use_seals", + "strict_encoding 2.7.0-beta.4", +] + +[[package]] +name = "bp-std" +version = "0.11.0-beta.6" +dependencies = [ + "amplify 4.6.0", + "bp-consensus", + "bp-derive", + "bp-invoice", + "descriptors 0.11.0-beta.6", + "psbt 0.11.0-beta.6", + "serde", +] + +[[package]] +name = "bp-wallet" +version = "0.11.0-beta.6.1" +dependencies = [ + "amplify 4.6.0", + "bp-electrum", + "bp-esplora", + "bp-std", + "descriptors 0.11.0-beta.6", + "log", + "psbt 0.11.0-beta.6", + "serde", + "serde_json", + "serde_yaml", + "strict_encoding 2.7.0-beta.4", + "toml", +] + +[[package]] +name = "bumpalo" +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" + +[[package]] +name = "cc" +version = "1.0.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d32a725bc159af97c3e629873bb9f88fb8cf8a4867175f76dc987815ea07c83b" +dependencies = [ + "jobserver", + "libc", + "once_cell", +] + +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "serde", + "wasm-bindgen", + "windows-targets 0.52.5", +] + +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "cmake" +version = "0.1.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" +dependencies = [ + "cc", +] + +[[package]] +name = "commit_encoding_derive" +version = "0.11.0-beta.6" +dependencies = [ + "amplify 4.6.0", + "amplify_syn 2.0.1", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "commit_verify" +version = "0.11.0-beta.6" +dependencies = [ + "amplify 4.6.0", + "commit_encoding_derive", + "rand", + "ripemd", + "serde", + "sha2", + "strict_encoding 2.7.0-beta.4", + "strict_types", + "vesper-lang", +] + +[[package]] +name = "constant_time_eq" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" + +[[package]] +name = "cpufeatures" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "darling" +version = "0.20.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54e36fcd13ed84ffdfda6f5be89b31287cbb80c439841fe69e04841435464391" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c2cf1c23a687a1feeb728783b993c4e1ad83d99f351801977dd809b48d0a70f" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.66", +] + +[[package]] +name = "darling_macro" +version = "0.20.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" +dependencies = [ + "darling_core", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", + "serde", +] + +[[package]] +name = "descriptors" +version = "0.10.2" +dependencies = [ + "amplify 3.14.2", + "bitcoin", + "bitcoin_blockchain", + "bitcoin_hd", + "bitcoin_scripts", + "chrono", + "miniscript", + "strict_encoding 0.9.0", +] + +[[package]] +name = "descriptors" +version = "0.11.0-beta.6" +dependencies = [ + "amplify 4.6.0", + "bp-derive", + "indexmap 2.2.6", + "serde", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "dunce" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" + +[[package]] +name = "either" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" + +[[package]] +name = "encoding_derive_helpers" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8a2293d9a54744b73b753fad2e3c16295345504dc230696ee8aa5dbfd276ab4" +dependencies = [ + "amplify 3.14.2", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "fast32" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27ea9bdb2356e5a92403cf23ac493f9b43bd71e4ffd0f800862b841dd723994c" + +[[package]] +name = "fastrand" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" + +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + +[[package]] +name = "flate2" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "fluent-uri" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17c704e9dbe1ddd863da1e6ff3567795087b1eb201ce80d8fa81162e1516500d" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "fs_extra" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" + +[[package]] +name = "futures" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" + +[[package]] +name = "futures-executor" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" + +[[package]] +name = "futures-macro" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "futures-sink" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" + +[[package]] +name = "futures-task" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" + +[[package]] +name = "futures-timer" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" + +[[package]] +name = "futures-util" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi", + "wasm-bindgen", +] + +[[package]] +name = "gimli" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[package]] +name = "half" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" +dependencies = [ + "cfg-if", + "crunchy", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-conservative" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5313b072ce3c597065a808dbf612c4c8e8590bdbf8b579508bf7a762c5eae6cd" +dependencies = [ + "arrayvec", +] + +[[package]] +name = "home" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "http" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +dependencies = [ + "bytes", + "futures-util", + "http", + "http-body", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "hyper" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "httparse", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-tls" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +dependencies = [ + "bytes", + "http-body-util", + "hyper", + "hyper-util", + "native-tls", + "tokio", + "tokio-native-tls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b875924a60b96e5d7b9ae7b066540b1dd1cbd90d1828f54c92e02a283351c56" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "hyper", + "pin-project-lite", + "socket2", + "tokio", + "tower", + "tower-service", + "tracing", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", + "serde", +] + +[[package]] +name = "indexmap" +version = "2.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +dependencies = [ + "equivalent", + "hashbrown 0.14.3", + "serde", +] + +[[package]] +name = "ipnet" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" + +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + +[[package]] +name = "jobserver" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" +dependencies = [ + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + +[[package]] +name = "libc" +version = "0.2.153" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" + +[[package]] +name = "libloading" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" +dependencies = [ + "cfg-if", + "windows-targets 0.52.5", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" + +[[package]] +name = "log" +version = "0.4.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" + +[[package]] +name = "memchr" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniscript" +version = "9.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5b106477a0709e2da253e5559ba4ab20a272f8577f1eefff72f3a905b5d35f5" +dependencies = [ + "bitcoin", +] + +[[package]] +name = "miniz_oxide" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.48.0", +] + +[[package]] +name = "mirai-annotations" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9be0862c1b3f26a88803c4a49de6889c10e608b3ee9344e6ef5b45fb37ad3d1" + +[[package]] +name = "mnemonic" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2b8f3a258db515d5e91a904ce4ae3f73e091149b90cadbdb93d210bee07f63b" + +[[package]] +name = "native-tls" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +dependencies = [ + "lazy_static", + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-traits" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" +dependencies = [ + "autocfg", +] + +[[package]] +name = "object" +version = "0.32.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "openssl" +version = "0.10.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" +dependencies = [ + "bitflags 2.5.0", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.102" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "paste" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "petgraph" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" +dependencies = [ + "fixedbitset", + "indexmap 2.2.6", +] + +[[package]] +name = "pin-project" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "prettyplease" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" +dependencies = [ + "proc-macro2", + "syn 2.0.66", +] + +[[package]] +name = "proc-macro2" +version = "1.0.85" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "psbt" +version = "0.10.2" +dependencies = [ + "amplify 3.14.2", + "base64 0.21.7", + "bitcoin", + "bitcoin_blockchain", + "bitcoin_hd", + "bitcoin_onchain", + "bitcoin_scripts", + "descriptors 0.10.2", + "miniscript", + "strict_encoding 0.9.0", +] + +[[package]] +name = "psbt" +version = "0.11.0-beta.6" +dependencies = [ + "amplify 4.6.0", + "base64 0.22.1", + "bp-core", + "bp-derive", + "chrono", + "commit_verify", + "descriptors 0.11.0-beta.6", + "indexmap 2.2.6", + "serde", + "strict_encoding 2.7.0-beta.4", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "regex" +version = "1.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" + +[[package]] +name = "relative-path" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba39f3699c378cd8970968dcbff9c43159ea4cfbd88d43c00b22f2ef10a435d2" + +[[package]] +name = "reqwest" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "566cafdd92868e0939d3fb961bd0dc25fcfaaed179291093b3d43e6b3150ea10" +dependencies = [ + "base64 0.22.1", + "bytes", + "futures-core", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-tls", + "hyper-util", + "ipnet", + "js-sys", + "log", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "tokio", + "tokio-native-tls", + "tokio-socks", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "winreg", +] + +[[package]] +name = "rgb-core" +version = "0.11.0-beta.6" +dependencies = [ + "aluvm", + "amplify 4.6.0", + "baid64", + "bp-core", + "chrono", + "commit_verify", + "getrandom", + "mime", + "secp256k1-zkp", + "serde", + "single_use_seals", + "strict_encoding 2.7.0-beta.4", + "strict_types", + "wasm-bindgen", +] + +[[package]] +name = "rgb-integration-tests" +version = "0.1.0" +dependencies = [ + "amplify 4.6.0", + "bitcoin", + "bp-core", + "bp-electrum", + "bp-esplora", + "bp-invoice", + "bp-std", + "bp-wallet", + "descriptors 0.11.0-beta.6", + "miniscript", + "once_cell", + "psbt 0.10.2", + "psbt 0.11.0-beta.6", + "rand", + "rgb-interfaces", + "rgb-psbt", + "rgb-runtime", + "rgb-schemata", + "rgb-std", + "rstest", + "rstest_reuse", + "strict_encoding 2.7.0-beta.4", + "strict_types", + "strum", + "strum_macros", + "time", + "tree_magic_mini", +] + +[[package]] +name = "rgb-interfaces" +version = "0.11.0-beta.6" +dependencies = [ + "aluvm", + "amplify 4.6.0", + "bp-core", + "chrono", + "rgb-std", + "serde_json", + "sha2", + "strict_encoding 2.7.0-beta.4", + "strict_types", +] + +[[package]] +name = "rgb-invoice" +version = "0.11.0-beta.6" +dependencies = [ + "amplify 4.6.0", + "baid64", + "bp-core", + "bp-invoice", + "fast32", + "fluent-uri", + "indexmap 2.2.6", + "percent-encoding", + "rand", + "rgb-core", + "serde", + "strict_encoding 2.7.0-beta.4", + "strict_types", +] + +[[package]] +name = "rgb-psbt" +version = "0.11.0-beta.6" +dependencies = [ + "amplify 4.6.0", + "baid64", + "bp-core", + "bp-std", + "commit_verify", + "getrandom", + "psbt 0.11.0-beta.6", + "rgb-std", + "strict_encoding 2.7.0-beta.4", + "wasm-bindgen", +] + +[[package]] +name = "rgb-runtime" +version = "0.11.0-beta.6" +dependencies = [ + "amplify 4.6.0", + "baid64", + "bp-core", + "bp-electrum", + "bp-esplora", + "bp-std", + "bp-wallet", + "chrono", + "commit_verify", + "descriptors 0.11.0-beta.6", + "indexmap 2.2.6", + "rgb-interfaces", + "rgb-psbt", + "rgb-std", + "serde", + "serde_yaml", + "strict_types", +] + +[[package]] +name = "rgb-schemata" +version = "0.11.0-beta.6" +dependencies = [ + "aluvm", + "amplify 4.6.0", + "bp-core", + "chrono", + "rgb-interfaces", + "rgb-std", + "serde", + "serde_json", + "sha2", + "strict_encoding 2.7.0-beta.4", + "strict_types", +] + +[[package]] +name = "rgb-std" +version = "0.11.0-beta.6" +dependencies = [ + "aluvm", + "amplify 4.6.0", + "ascii-armor", + "baid64", + "base85", + "bp-core", + "chrono", + "commit_verify", + "getrandom", + "indexmap 2.2.6", + "rand", + "rgb-core", + "rgb-invoice", + "serde", + "strict_encoding 2.7.0-beta.4", + "strict_types", + "wasm-bindgen", +] + +[[package]] +name = "ring" +version = "0.17.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +dependencies = [ + "cc", + "cfg-if", + "getrandom", + "libc", + "spin", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "ripemd" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f" +dependencies = [ + "digest", +] + +[[package]] +name = "rstest" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d5316d2a1479eeef1ea21e7f9ddc67c191d497abc8fc3ba2467857abbb68330" +dependencies = [ + "futures", + "futures-timer", + "rstest_macros", + "rustc_version", +] + +[[package]] +name = "rstest_macros" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04a9df72cc1f67020b0d63ad9bfe4a323e459ea7eb68e03bd9824db49f9a4c25" +dependencies = [ + "cfg-if", + "glob", + "proc-macro2", + "quote", + "regex", + "relative-path", + "rustc_version", + "syn 2.0.66", + "unicode-ident", +] + +[[package]] +name = "rstest_reuse" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88530b681abe67924d42cca181d070e3ac20e0740569441a9e35a7cedd2b34a4" +dependencies = [ + "quote", + "rand", + "rustc_version", + "syn 2.0.66", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "0.38.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +dependencies = [ + "bitflags 2.5.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustls" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" +dependencies = [ + "log", + "ring", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls" +version = "0.23.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebbbdb961df0ad3f2652da8f3fdc4b36122f568f968f45ad3316f26c025c677b" +dependencies = [ + "aws-lc-rs", + "log", + "once_cell", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-pemfile" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" +dependencies = [ + "base64 0.22.1", + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "beb461507cee2c2ff151784c52762cf4d9ff6a61f3e80968600ed24fa837fa54" + +[[package]] +name = "rustls-webpki" +version = "0.102.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3bce581c0dd41bce533ce695a1437fa16a7ab5ac3ccfa99fe1a620a7885eabf" +dependencies = [ + "aws-lc-rs", + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "rustversion" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80af6f9131f277a45a3fba6ce8e2258037bb0477a67e610d3c1fe046ab31de47" + +[[package]] +name = "ryu" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" + +[[package]] +name = "schannel" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "secp256k1" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b1629c9c557ef9b293568b338dddfc8208c98a18c59d722a9d53f859d9c9b62" +dependencies = [ + "bitcoin_hashes 0.11.0", + "rand", + "secp256k1-sys 0.6.1", +] + +[[package]] +name = "secp256k1" +version = "0.28.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d24b59d129cdadea20aea4fb2352fa053712e5d713eee47d700cd4b2bc002f10" +dependencies = [ + "rand", + "secp256k1-sys 0.9.2", + "serde", +] + +[[package]] +name = "secp256k1" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e0cc0f1cf93f4969faf3ea1c7d8a9faed25918d96affa959720823dfe86d4f3" +dependencies = [ + "rand", + "secp256k1-sys 0.10.0", + "serde", +] + +[[package]] +name = "secp256k1-sys" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83080e2c2fc1006e625be82e5d1eb6a43b7fd9578b617fcc55814daf286bba4b" +dependencies = [ + "cc", +] + +[[package]] +name = "secp256k1-sys" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5d1746aae42c19d583c3c1a8c646bfad910498e2051c551a7f2e3c0c9fbb7eb" +dependencies = [ + "cc", +] + +[[package]] +name = "secp256k1-sys" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1433bd67156263443f14d603720b082dd3121779323fce20cba2aa07b874bc1b" +dependencies = [ + "cc", +] + +[[package]] +name = "secp256k1-zkp" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4e48ef9c98bfbcb98bd15693ffa19676cb3e29426b75eda8b73c05cdd7959f8" +dependencies = [ + "bitcoin-private", + "rand", + "secp256k1 0.28.2", + "secp256k1-zkp-sys", + "serde", +] + +[[package]] +name = "secp256k1-zkp-sys" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ead52f43074bae2ddbd1e0e66e6b170135e76117f5ea9916f33d7bd0b36e29" +dependencies = [ + "cc", + "secp256k1-sys 0.9.2", +] + +[[package]] +name = "security-framework" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "770452e37cad93e0a50d5abc3990d2bc351c36d0328f86cefec2f2fb206eaef6" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41f3cc463c0ef97e11c3461a9d3787412d30e8e7eb907c79180c4a57bf7c04ef" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" + +[[package]] +name = "serde" +version = "1.0.198" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9846a40c979031340571da2545a4e5b7c4163bdae79b301d5f86d03979451fcc" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.198" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e88edab869b01783ba905e7d0153f9fc1a6505a96e4ad3018011eedb838566d9" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "serde_json" +version = "1.0.116" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e17db7126d17feb94eb3fad46bf1a96b034e8aacbc2e775fe81505f8b0b2813" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_spanned" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_str_helpers" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b744a7c94f2f3785496af33a0d93857dfc0c521e25c38e993e9c5bb45f09c841" +dependencies = [ + "serde", + "serde_derive", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_with" +version = "3.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ad483d2ab0149d5a5ebcd9972a3852711e0153d863bf5a5d0391d28883c4a20" +dependencies = [ + "base64 0.22.1", + "chrono", + "hex", + "indexmap 1.9.3", + "indexmap 2.2.6", + "serde", + "serde_derive", + "serde_json", + "serde_with_macros", + "time", +] + +[[package]] +name = "serde_with_macros" +version = "3.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65569b702f41443e8bc8bbb1c5779bd0450bbe723b56198980e80ec45780bce2" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "serde_yaml" +version = "0.9.34+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" +dependencies = [ + "indexmap 2.2.6", + "itoa", + "ryu", + "serde", + "unsafe-libyaml", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "single_use_seals" +version = "0.11.0-beta.6" +dependencies = [ + "amplify_derive 4.0.0", +] + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "slip132" +version = "0.10.2" +dependencies = [ + "amplify 3.14.2", + "bitcoin", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "socket2" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "socks" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0c3dbbd9ae980613c6dd8e28a9407b50509d3803b57624d5dfe8315218cd58b" +dependencies = [ + "byteorder", + "libc", + "winapi", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "stability" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebd1b177894da2a2d9120208c3386066af06a488255caabc5de8ddca22dbc3ce" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "strict_encoding" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0be7060b49729cd0b9b2391114632ef64c363a4055d91de049f5555b466193bb" +dependencies = [ + "amplify 3.14.2", + "bitcoin", + "bitcoin_hashes 0.11.0", + "chrono", + "strict_encoding_derive 0.9.0", +] + +[[package]] +name = "strict_encoding" +version = "2.7.0-beta.4" +dependencies = [ + "amplify 4.6.0", + "half", + "serde", + "strict_encoding_derive 2.7.0-beta.3", +] + +[[package]] +name = "strict_encoding_derive" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34c9cabafb397fc1144463228ad4ba57c3c670a0117505fe59b15d8c74449716" +dependencies = [ + "amplify_syn 1.1.6", + "encoding_derive_helpers", + "proc-macro2", + "syn 1.0.109", +] + +[[package]] +name = "strict_encoding_derive" +version = "2.7.0-beta.3" +dependencies = [ + "amplify_syn 2.0.1", + "heck", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "strict_types" +version = "2.7.0-beta.4" +dependencies = [ + "amplify 4.6.0", + "ascii-armor", + "baid64", + "half", + "indexmap 2.2.6", + "serde", + "serde_json", + "serde_yaml", + "sha2", + "strict_encoding 2.7.0-beta.4", + "toml", + "vesper-lang", +] + +[[package]] +name = "stringly_conversions" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff63080f492dd4d289ffcaed8d7ece38adfb423db910eb342c0e04d409536a7a" +dependencies = [ + "paste", + "serde_str_helpers", +] + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "strum" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.66", +] + +[[package]] +name = "subtle" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + +[[package]] +name = "tempfile" +version = "3.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +dependencies = [ + "cfg-if", + "fastrand", + "rustix", + "windows-sys 0.52.0", +] + +[[package]] +name = "thiserror" +version = "1.0.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0126ad08bff79f29fc3ae6a55cc72352056dfff61e3ff8bb7129476d44b23aa" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1cd413b5d558b4c5bf3680e324a6fa5014e7b7c067a51e69dbdf47eb7148b66" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "time" +version = "0.3.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "pin-project-lite", + "socket2", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-socks" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51165dfa029d2a65969413a6cc96f354b86b464498702f174a4efa13608fd8c0" +dependencies = [ + "either", + "futures-util", + "thiserror", + "tokio", +] + +[[package]] +name = "toml" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9dd1545e8208b4a5af1aa9bbd0b4cf7e9ea08fabc5d0a5c67fcaafa17433aa3" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.22.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3328d4f68a705b2a4498da1d580585d39a6510f98318a2cec3018a7ec61ddef" +dependencies = [ + "indexmap 2.2.6", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "pin-project", + "pin-project-lite", + "tokio", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-layer" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "pin-project-lite", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", +] + +[[package]] +name = "tree_magic_mini" +version = "3.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "469a727cac55b41448315cc10427c069c618ac59bb6a4480283fcd811749bdc2" +dependencies = [ + "fnv", + "home", + "memchr", + "nom", + "once_cell", + "petgraph", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "unicode-bidi" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-normalization" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unsafe-libyaml" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "ureq" +version = "2.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11f214ce18d8b2cbe84ed3aa6486ed3f5b285cf8d8fbdbce9f3f767a724adc35" +dependencies = [ + "base64 0.21.7", + "flate2", + "log", + "once_cell", + "rustls 0.22.4", + "rustls-pki-types", + "rustls-webpki", + "serde", + "serde_json", + "socks", + "url", + "webpki-roots 0.26.1", +] + +[[package]] +name = "url" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "vesper-lang" +version = "0.1.0" +dependencies = [ + "amplify 4.6.0", + "strict_encoding 2.7.0-beta.4", +] + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.66", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" + +[[package]] +name = "web-sys" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki-roots" +version = "0.25.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" + +[[package]] +name = "webpki-roots" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3de34ae270483955a94f4b21bdaaeb83d508bb84a01435f393818edb0012009" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "which" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +dependencies = [ + "either", + "home", + "once_cell", + "rustix", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.5", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.5", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +dependencies = [ + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" + +[[package]] +name = "winnow" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0c976aaaa0e1f90dbb21e9587cdaf1d9679a1cde8875c0d6bd83ab96a208352" +dependencies = [ + "memchr", +] + +[[package]] +name = "winreg" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + +[[package]] +name = "zeroize" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63381fa6624bf92130a6b87c0d07380116f80b565c42cf0d754136f0238359ef" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..329f311 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,134 @@ +[package] +name = "rgb-integration-tests" +version = "0.1.0" +authors = [ + "Zoe Faltibà ", + "Dr Maxim Orlovsky ", + "Nicola Busanello ", +] +edition = "2021" +rust-version = "1.75.0" +repository = "https://github.com/RGB-WG/rgb-integration-tests" +homepage = "https://github.com/RGB-WG/rgb-integration-tests" +license = "Apache-2.0" +description = "RGB integration tests" + +[dependencies] +bitcoin = "0.29.2" +miniscript = "9.0.1" +once_cell = "1.19.0" +rand = "0.8.5" +rstest = "0.19.0" +rstest_reuse = "0.6.0" +strum = { version = "0.26.2", features = ["derive"] } +strum_macros = "0.26.2" +time = "0.3.34" +tree_magic_mini = "3.1.5" + +# RGB-related deps +## bp-core +bp-core = { path = "./bp-core" } +## bp-electrum-client +bp-electrum = { path = "./bp-electrum-client" } +## bp-esplora +bp-esplora = { path = "./bp-esplora-client" } +## bp-std +bp-std = { path = "./bp-std" } +descriptors = { path = "./bp-std/descriptors" } +bp-invoice = { path = "./bp-std/invoice" } +psbt = { path = "./bp-std/psbt" } +## bp-wallet +bp-wallet = { path = "./bp-wallet", features = [ + "electrum", + "esplora", + "fs", +] } +## descriptor-wallet +dw_psbt = { path = "./descriptor-wallet/psbt", package = "psbt", features = [ + "sign", +] } +## rgb +rgb-runtime = { path = "./rgb", features = [ + "electrum_blocking", + "esplora_blocking", + "fs", + "serde", +] } +rgb-psbt = { path = "./rgb/psbt" } +## rgb-interfaces +rgb-interfaces = { path = "./rgb-interfaces" } +## rgb-schemata +rgb-schemata = { path = "./rgb-schemata" } +## rgb-std +rgb-std = { path = "./rgb-std" } +## rust-amplify +amplify = { path = "./rust-amplify" } +## strict-encoding +strict_encoding = { path = "./strict-encoding/rust" } +## strict-types +strict_types = { path = "./strict-types" } + +[patch.crates-io] +# patching all RGB-related deps, to measure code coverage +## amplify-derive +amplify_derive = { path = "./amplify-derive" } +amplify_syn = { path = "./amplify-derive/syn" } +## amplify-num +amplify_apfloat = { path = "./amplify-num/apfloat" } +amplify_num = { path = "./amplify-num/num" } +## ascii-armor +ascii-armor = { path = "./ascii-armor" } +## baid64 +baid64 = { path = "./rust-baid64" } +## bitcoin_foundation +bitcoin_blockchain = { path = "./bitcoin_foundation/bitcoin_blockchain" } +bitcoin_scripts = { path = "./bitcoin_foundation/bitcoin_scripts" } +## bp-core +bp-core = { path = "./bp-core" } +bp-consensus = { path = "./bp-core/consensus" } +bp-dbc = { path = "./bp-core/dbc" } +bp-seals = { path = "./bp-core/seals" } +## bp-electrum-client +bp-electrum = { path = "./bp-electrum-client" } +## bp-esplora-client +bp-esplora = { path = "./bp-esplora-client" } +## bp-std +bp-derive = { path = "./bp-std/derive" } +bp-std = { path = "./bp-std" } +descriptors = { path = "./bp-std/descriptors" } +bp-invoice = { path = "./bp-std/invoice" } +psbt = { path = "./bp-std/psbt" } +## bp-wallet +bp-wallet = { path = "./bp-wallet" } +## client_side_validation +commit_verify = { path = "./client_side_validation/commit_verify" } +commit_encoding_derive = { path = "./client_side_validation/commit_verify/derive" } +single_use_seals = { path = "./client_side_validation/single_use_seals" } +## descriptor-wallet +bitcoin_hd = { path = "./descriptor-wallet/hd" } +bitcoin_onchain = { path = "./descriptor-wallet/onchain" } +dw_psbt = { path = "./descriptor-wallet/psbt", package = "psbt" } +slip132 = { path = "./descriptor-wallet/slip132" } +## rgb +rgb-runtime = { path = "./rgb" } +rgb-psbt = { path = "./rgb/psbt" } +## rgb-core +rgb-core = { path = "./rgb-core" } +## rgb-interfaces +rgb-interfaces = { path = "./rgb-interfaces" } +## rgb-schemata +rgb-schemata = { path = "./rgb-schemata" } +## rgb-std +rgb-std = { path = "./rgb-std" } +rgb-invoice = { path = "./rgb-std/invoice" } +## rust-aluvm +aluvm = { path = "./rust-aluvm" } +## rust-amplify +amplify = { path = "./rust-amplify" } +## strict-encoding +strict_encoding = { path = "./strict-encoding/rust" } +strict_encoding_derive = { path = "./strict-encoding/rust/derive" } +## strict-types +strict_types = { path = "./strict-types" } +## vesper +vesper-lang = { path = "./vesper" } diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..e1465cf --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright (c) 2024 RGB-Tools developers + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.md b/README.md index 7b59799..3abee8b 100644 --- a/README.md +++ b/README.md @@ -1 +1,75 @@ # RGB integration tests + +This repository contains integration tests for RGB. + +## Requirements +- Linux OS +- Docker with its `compose` plugin +- Rust + +## Run +Clone the project, including submodules: + +```sh +git clone https://github.com/RGB-WG/rgb-integration-tests --recurse-submodules +``` + +Note: after checking out to another commit, remember to run: +```sh +git submodule update +``` + +Then, from the project root, run the integration tests by running: +```sh +cargo test +``` + +:warning: **Warning:** if your machine has a lot of CPU cores, it could +happen that calls to indexers fail because of too many parallel requests. To +limit the test threads and avoid this issue set the `--test-threads` option +(e.g. `cargo test -- --test-threads=8`). + +### Test services + +Test services will be automatically (re)started by the test command and will +run in docker containers. +If you don't have the docker images they will be automatically pulled. Note +that in this case the first test execution will be slower. +Also note that there's no automatic shutdown of test services, you'll need to +manually remove the docker containers with: +```sh +docker compose -f tests/docker-compose.yml --profile='*' down -v --remove-orphans +``` + +The indexer used by the tests is configurable, currently esplora and electrum +are supported. You can change the indexer type by setting the `INDEXER` +environment variable, for example: +```sh +INDEXER=esplora cargo test # default +INDEXER=electrum cargo test +``` + +If you are developing new tests and want a faster execution, you can set +`SKIP_INIT=1` to avoid restarting the test services. Please note that you +cannot switch to another indexer when using this option, you'll have to use the +same indexer type from the previous test execution. + +### Coverage + +To run the tests and generate a code coverage report run: +```sh +./tests/coverage.sh +``` +This will generate a report in `target/llvm-cov/html/index.html` that you can +visualize on a browser (e.g. `firefox target/llvm-cov/html/index.html`). + +Coverage will be measured for all patched crates. + +The GitHub organizations of submodule repositories are: +- https://github.com/RGB-WG +- https://github.com/LNP-BP +- https://github.com/BP-WG +- https://github.com/aluvm +- https://github.com/strict-types +- https://github.com/rust-amplify +- https://github.com/UBIDECO diff --git a/amplify-derive b/amplify-derive new file mode 160000 index 0000000..febd060 --- /dev/null +++ b/amplify-derive @@ -0,0 +1 @@ +Subproject commit febd060237c9d1185b34abe98d40b7e16dc633a7 diff --git a/amplify-num b/amplify-num new file mode 160000 index 0000000..4f023e6 --- /dev/null +++ b/amplify-num @@ -0,0 +1 @@ +Subproject commit 4f023e6666a308824cfd4d9592d412fb1d38dbda diff --git a/ascii-armor b/ascii-armor new file mode 160000 index 0000000..f97a99a --- /dev/null +++ b/ascii-armor @@ -0,0 +1 @@ +Subproject commit f97a99af8a1d9313b9b355f7d4d3ef502c749272 diff --git a/bitcoin_foundation b/bitcoin_foundation new file mode 160000 index 0000000..3f8e1bc --- /dev/null +++ b/bitcoin_foundation @@ -0,0 +1 @@ +Subproject commit 3f8e1bcc58f365dec7a33888739e366eb4037799 diff --git a/bp-core b/bp-core new file mode 160000 index 0000000..704c9b5 --- /dev/null +++ b/bp-core @@ -0,0 +1 @@ +Subproject commit 704c9b59cb48afbb74223adbd272b96bfe96b808 diff --git a/bp-electrum-client b/bp-electrum-client new file mode 160000 index 0000000..8aaeec8 --- /dev/null +++ b/bp-electrum-client @@ -0,0 +1 @@ +Subproject commit 8aaeec84af8c43d6adc7410da0bd912138d0f22b diff --git a/bp-esplora-client b/bp-esplora-client new file mode 160000 index 0000000..7c012b5 --- /dev/null +++ b/bp-esplora-client @@ -0,0 +1 @@ +Subproject commit 7c012b551126060815ffb6274b312690e8dfa6fa diff --git a/bp-std b/bp-std new file mode 160000 index 0000000..8177aab --- /dev/null +++ b/bp-std @@ -0,0 +1 @@ +Subproject commit 8177aab7c0badf5295b6b9664d2f652a94f7093e diff --git a/bp-wallet b/bp-wallet new file mode 160000 index 0000000..776daa6 --- /dev/null +++ b/bp-wallet @@ -0,0 +1 @@ +Subproject commit 776daa69ca1a50cf2d9de5556f205edeecef2975 diff --git a/client_side_validation b/client_side_validation new file mode 160000 index 0000000..005d64c --- /dev/null +++ b/client_side_validation @@ -0,0 +1 @@ +Subproject commit 005d64c114b2fcabbaf580a0cd80d57c704e015b diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..a973dba --- /dev/null +++ b/codecov.yml @@ -0,0 +1,6 @@ +coverage: + status: + project: + default: + target: 100% + threshold: 3% diff --git a/descriptor-wallet b/descriptor-wallet new file mode 160000 index 0000000..ef863eb --- /dev/null +++ b/descriptor-wallet @@ -0,0 +1 @@ +Subproject commit ef863eb5166cf4fc0c1dafac54da26ed1cd9f0db diff --git a/rgb b/rgb new file mode 160000 index 0000000..1c1844c --- /dev/null +++ b/rgb @@ -0,0 +1 @@ +Subproject commit 1c1844c4b95f69aeb3f5f4796a4e7852fb1c3719 diff --git a/rgb-core b/rgb-core new file mode 160000 index 0000000..cb6892b --- /dev/null +++ b/rgb-core @@ -0,0 +1 @@ +Subproject commit cb6892b683193b42b28222c094f3a5b448dee3ce diff --git a/rgb-interfaces b/rgb-interfaces new file mode 160000 index 0000000..baafff6 --- /dev/null +++ b/rgb-interfaces @@ -0,0 +1 @@ +Subproject commit baafff60c97de97c9edb89346e87cdeb27d91300 diff --git a/rgb-schemata b/rgb-schemata new file mode 160000 index 0000000..3469f18 --- /dev/null +++ b/rgb-schemata @@ -0,0 +1 @@ +Subproject commit 3469f185444643fe161758d58f71a1daedd531b2 diff --git a/rgb-std b/rgb-std new file mode 160000 index 0000000..83abb13 --- /dev/null +++ b/rgb-std @@ -0,0 +1 @@ +Subproject commit 83abb1385cf4af6d95e129cc65ac426de493b496 diff --git a/rust-aluvm b/rust-aluvm new file mode 160000 index 0000000..22d7ee8 --- /dev/null +++ b/rust-aluvm @@ -0,0 +1 @@ +Subproject commit 22d7ee83aae2b43a5922ef71915af77bb649ca3a diff --git a/rust-amplify b/rust-amplify new file mode 160000 index 0000000..86e248f --- /dev/null +++ b/rust-amplify @@ -0,0 +1 @@ +Subproject commit 86e248f9875cb80b35b281fee2c12c7e908f626d diff --git a/rust-baid64 b/rust-baid64 new file mode 160000 index 0000000..983854a --- /dev/null +++ b/rust-baid64 @@ -0,0 +1 @@ +Subproject commit 983854a1b9be7c2cd7d98b00ab4df3e633be393a diff --git a/strict-encoding b/strict-encoding new file mode 160000 index 0000000..11b3fca --- /dev/null +++ b/strict-encoding @@ -0,0 +1 @@ +Subproject commit 11b3fca5e75131a15b525e93bef1fff1aac31bcf diff --git a/strict-types b/strict-types new file mode 160000 index 0000000..827b1f1 --- /dev/null +++ b/strict-types @@ -0,0 +1 @@ +Subproject commit 827b1f1b1b1bd3a70e45815493361dc70400f961 diff --git a/tests/coverage.sh b/tests/coverage.sh new file mode 100755 index 0000000..66a4ba4 --- /dev/null +++ b/tests/coverage.sh @@ -0,0 +1,59 @@ +#!/bin/bash -e +# +# script to run project tests and report code coverage +# uses llvm-cov (https://github.com/taiki-e/cargo-llvm-cov) + +LLVM_COV_OPTS="" +CARGO_TEST_OPTS="" + +_die() { + echo "err $*" + exit 1 +} + +_tit() { + echo + echo "========================================" + echo "$@" + echo "========================================" +} + +help() { + echo "$NAME [-h|--help] [-t|--test] [--no-clean]" + echo "" + echo "options:" + echo " -h --help show this help message" + echo " -t --test only run these test(s)" + echo " --no-clean don't cleanup before the run" +} + +# cmdline arguments +while [ -n "$1" ]; do + case $1 in + -h|--help) + help + exit 0 + ;; + -t|--test) + CARGO_TEST_OPTS="-- $2" + shift + ;; + *) + help + _die "unsupported argument \"$1\"" + ;; + esac + shift +done + +_tit "installing requirements" +rustup component add llvm-tools-preview +cargo install cargo-llvm-cov + +_tit "generating coverage report" +# shellcheck disable=2086 +INDEXER=esplora cargo llvm-cov --html $LLVM_COV_OPTS $CARGO_TEST_OPTS +INDEXER=electrum cargo llvm-cov --no-clean --html $LLVM_COV_OPTS $CARGO_TEST_OPTS + +## show html report location +echo "generated html report: target/llvm-cov/html/index.html" diff --git a/tests/docker-compose.yml b/tests/docker-compose.yml new file mode 100644 index 0000000..197c884 --- /dev/null +++ b/tests/docker-compose.yml @@ -0,0 +1,26 @@ +version: '3.2' + +services: + bitcoind: + image: registry.gitlab.com/hashbeam/docker/bitcoind:25.0 + profiles: [electrum] + command: "-fallbackfee=0.0002" + electrs: + image: registry.gitlab.com/hashbeam/docker/electrs:0.9.14 + profiles: [electrum] + ports: + - 50001:50001 + depends_on: + - bitcoind + esplora: + image: blockstream/esplora:956c74f42eb6ad803d8aedc272ba83d3aa6dcf5c + profiles: [esplora] + command: /srv/explorer/run.sh bitcoin-regtest explorer + environment: + DEBUG: verbose + NO_PRECACHE: 1 + NO_ADDRESS_SEARCH: 1 + NO_REGTEST_MINING: 1 + ports: + - 50002:50001 + - 8094:80 diff --git a/tests/fixtures/rgb_logo.jpeg b/tests/fixtures/rgb_logo.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..00b3c3e8a05cee429c5025df44e76d2435c12eaa GIT binary patch literal 4553 zcmbW4cTiL7y2cm12qG9zM7l^5l_pKd1_T6*5FkXlfYOTyNG~FYM2fUf1qlQUErNg) zQRzqvJpzK#t4Il*=FZ%?_r5dFn)zmZ|NP!(eebs($~Vds5DhRhGBPnT zFf%bRv9K_+vVqvyPMu=oz>|4Be#Q1G+pnCG!C;t(mRY3ay}%&crwVG+8xj?S*`uRX&fqhsUvZxfTVbMp&}OUo;(Yuh`!ggxT^!Ql}NK=&^k>hoVf|AmK> z%0o*}Pe;%6Cl3v609ACH^bEqXj9i*fCVQW=B63feL0ZWLRV^%{@+Mo{4v&Xec`hl; zif#Xi^iQJy9Z=N&i|8+)zj!E<02>_*)i63v01RveOQ0I#TM-g(X#Z9R9jl}Z>Wdht z#*{_^UDP2BKy^TWidh1M0RFq;jjy9SK&I~)K(&{y8~RFhuzBn#=|GKcnK>+MAd6rH z#Vh#6!Z~JKM&1K2P(*@Xw%)Te&m3dVU-%x=uDK9=f$JxMS^+iSUk+V5`OCaF=yQCzJ-WNrh=nj__b1(bCafLuRNUnCB>H1 zHQcRtZ$(-+E&#>w-eQrAL<`FFYJCy!=g6Eu>*qZ{Ft9 z(^>Wrl$BNUG=9IT_4tSbQ|^XOP*-xUi2S-fe-7Msx;iAZDYq_XwkfB-+9*?4qi_kV zY5Q{aGs{;6#|`sdkm&QgyELTW)D7wCVG^gOOOy>HrhPgTt*mpjuQm3Eq&iMpEL>T=&faP_eNU}uZtf=*aaoo7fiZ#Uq`t%^~{$HJ|X-2Aj>(k?JalK zMxjHzJw?Tb#hX3x>2zI|3{sa9Kd$1hDqeZmd*R*W3V#>}LA^}WbZfe|v)KZ-3tojIIOYh4?6dK>xw+Z)>|3AI04R8vW^fR(;Mz?8jp9*+*9d9xQH- z;&CM0HST0xY;)`oF$Ao4B;V^QMJ_0scE!b+`h^wQ#*(BGLS$1?8a141FQhrmLM;j; zC0z;%h5y4HO9s&3*9w`d*SvU6xnx^dq289kvqL9u6uq)*XR)d5Ijt?ZPwEIB&p=PO zB72a?Re?Xgf9q8m-7in#b$Mnw!rmvDlXL%`W7##I6Ze*q*Sf{Rnq``+OOH&u$cL_P zvi*?vHHBY%b&u52os!e2SFYUb?aKB~D4nu$sqp3^>TBW}x)<+OROYOm`-s{c%V2FXu&!bK9q(%dAm{L>WrP4f+jhVE)>zgK3S6}KH zO14x+ZE$8U`!jxVBX0RFx$IxhelKF2;>A|>tmXVqGI!rvIFJ4*!w0uK@x9)S;jy)T z4Mo^DB__rJFV(8D!UcIx8w`D3YUW*n^XyFaION^XBxw=1s3RljD=7L20EU^Q4?Y*-3lMS z`esd8Q`*-XrSX4|S1+AC@PYYcZ)gZGfB(@T^*r%5)WXQ8|GrzcuWNQLF`--c(5N&o zb_e^kOl!0d=HD0*v^!?s3o)}X;@j3pIby7PKlRW)?J${>Bz_ZnxZw((m1&>=`7WR3 zZR6%-xcw_c3?Bhm;enY%d$PK8*Mqp(^!a3iMy~RbD(*d%hb|5)Xj2P4?Um}#<+FEF z6L=@~D1dwfnQJQlaPQ@=qT7!yIP##QNM_H`8qK|8$fRX3AYO50T~N#!MiyKMNDejm z9PLwLC3tWa)_%}}5hu0&;vlh?4M>c( zl|;0zkAYV>ohd+AZBPt%29eQ<0%&B+P=G$%I_z^Mp_95h|1f%j0{rka{@lr~PXU(B zxqyFq+WP849#}k{Od&<|x%1k1iZwe*t+H^L>a*<`-5P;py)OTa2s+YQZ1m~gkYeJC@B|wW+9_@>95#x< zCZoA;Dv9oraEvlW9Ni?UXSh~;HtCN+NX56Y`$p4ueQtnbP9g-C_pqkf(-q5sIi1R-7D0h&(yCh-aNZ{_d^IK!1c~kOVR^0{)?KQIALYyDT zUV_vd32Lb)m}BeX)6&PgCOZxE^*ve<3^Ep)h&v`jf3WBZV(f zkHWCjHB+l0UEw%KTZF9bbDQVH)MaGvu8I%03S4SBsYFB}MM_94^Cu0Y;x*5ddl>qN zpn2jxliL6r09D#G)f!%7gV64Tn{V(`nLo~x-!TZ<4QitJz2$zpS=B?I{pRuj=(roY%NHf zBO6(Y7zH1!nbdHRKWJDg%0RBIKd!7|c1V4@y!nApUT#jvMBdO{(Us;-E96$!?69}g z*jMuH>I@C-#e5;@46^r^x{a@93Gq1rk4>vc;AA3J7K?h2AeK;=tSw4gUQ)nR8|WOT z03WQ)syKb;*6)}kKXvfc{FpFC$jhaqcgS^b?UlzDy>AK#gj6(xfAVS}G!1Q63HCZ5 zQxAYp^k(d(ny=3dj_v+_OX4np$XRvd)?po>&x?XA`1a%@-_TbV%>7x1&}F%D#btMOS%Ghjfxe zyOXjMpx`aJcBz8e+m9Z-F4Qkb8_Usj!R5`6t^TkW2x=mPE_!1eX=!O-S&*;4vg0|j zU}qjrPJlZFWeI^g7aTPMzQ6*;9WS4ncZOgUgWaY`}7^C3F0eWJv zzH+ll$Ic_(aX;NaM|OYD!5q(UdxtW_(^7MK8wYv#06Scx+g!J3( zf#(Vp4{-D$o?g}KiHINVVC=kgb65xKPzA&+vG3$`jLUd&sh-nSS9u-os&{XAglJL% zX&d?6?W!%Km1lw+f5ZIL&Wh%I5EOZowHa|Vh5-i?A5Zewj**g-xUI5n`~9TN-eLRe ziK|eWRK&Z_5?`=3nLNp*fs>d*vz4(_opWLys{s^XuOous0MGqEZQ5^i>V>dDGU0y2 z{8|M1k@#=Hiok~KVK8`bt!?ju3+kDzw(2buLh2R>s`KZhhng`B)1x23F`;P{lUp5mXw;uPgOV}m zPc}wkJa7|k&hAHM!Q-ilIX_kS3cWY$SKQkd6MkmRr5kj|!_xNX;mt^_%E43AizSFT zeQWmJ>H1)Jp+q`9GmPZXz41l%y3l9XHQbCrU>n6;qVp zy1Z;9LWqor=D@@x?2ncAUUeC=`ORl{Vz++najzVSza*U4J<$1t^NUza%_})c{c(uz zotNwR77-LO^qcG)_o8>%5LT)hM(Ff%lOgb6A(A? za)Xe{wAGun;TQmStcP~S`OCCDoJ#CbHB+2(@KrIKMx%a@u9w6bTCi>o%Q`#sg=Bkz z;IF2VdM^ zxT^f066#FT|x%HDE0bOU< z?De(yaLG*)LP;Is_&uQFWnOVrWfs&TGm`02YCL>&baKmJ29Vjwn4Nr`^7$c73V(RS6u zxXYg68c-D%yEN~%52NNVZUcxKO3F0m_D;Wz0Afb{UB+Fxk8(12BOyQWiDv2eF~#0# z7%unN0mmuM3hsRGQsMjpqu4XiuT7)%>~RzYh~z~f?u;v`F`!ZqaH^k@|3e!7D/dev/null; then + echo "could not call docker compose (hint: install docker compose plugin)" + exit 1 +fi +COMPOSE_BASE="$COMPOSE_BASE -f tests/docker-compose.yml" +PROFILE=${PROFILE:-"esplora"} +COMPOSE="$COMPOSE_BASE --profile $PROFILE" +TEST_DIR="./tests/tmp" + +# see docker-compose.yml for the exposed ports +if [ "$PROFILE" == "esplora" ]; then + BCLI="$COMPOSE exec -T esplora cli" + EXPOSED_PORTS=(8094 50002) +elif [ "$PROFILE" == "electrum" ]; then + BCLI="$COMPOSE exec -T -u blits bitcoind bitcoin-cli -regtest" + EXPOSED_PORTS=(50001) +else + _die "invalid profile" +fi + +# restart services (down + up) checking for ports availability +$COMPOSE_BASE --profile '*' down -v --remove-orphans +rm -rf $TEST_DIR +mkdir -p $TEST_DIR +for port in "${EXPOSED_PORTS[@]}"; do + if [ -n "$(ss -HOlnt "sport = :$port")" ];then + _die "port $port is already bound, services can't be started" + fi +done +$COMPOSE up -d + +# wait for services (pre-mining) +if [ "$PROFILE" == "esplora" ]; then + # wait for esplora to have completed setup + until $COMPOSE logs esplora |grep -q 'Bootstrapped 100%'; do + sleep 1 + done +elif [ "$PROFILE" == "electrum" ]; then + # wait for bitcoind to be up + until $COMPOSE logs bitcoind |grep 'Bound to'; do + sleep 1 + done +fi + +# prepare bitcoin funds +$BCLI createwallet miner +$BCLI -rpcwallet=miner -generate 103 + +# wait for services (post-mining) +if [ "$PROFILE" == "esplora" ]; then + # wait for esplora to have completed setup + until $COMPOSE logs esplora |grep -q 'Electrum RPC server running'; do + sleep 1 + done +elif [ "$PROFILE" == "electrum" ]; then + # wait for electrs to have completed startup + until $COMPOSE logs electrs |grep 'finished full compaction'; do + sleep 1 + done +fi diff --git a/tests/transfers.rs b/tests/transfers.rs new file mode 100644 index 0000000..d109c5c --- /dev/null +++ b/tests/transfers.rs @@ -0,0 +1,471 @@ +pub mod utils; + +use utils::*; + +type TT = TransferType; +type DT = DescriptorType; +type AS = AssetSchema; + +#[rstest] +// blinded: nia - nia +#[case(TT::Blinded, DT::Wpkh, DT::Wpkh, AS::Nia, AS::Nia)] +#[case(TT::Blinded, DT::Wpkh, DT::Tr, AS::Nia, AS::Nia)] +#[case(TT::Blinded, DT::Tr, DT::Wpkh, AS::Nia, AS::Nia)] +#[case(TT::Blinded, DT::Tr, DT::Tr, AS::Nia, AS::Nia)] +// blinded: nia - cfa +#[case(TT::Blinded, DT::Wpkh, DT::Wpkh, AS::Nia, AS::Cfa)] +#[case(TT::Blinded, DT::Wpkh, DT::Tr, AS::Nia, AS::Cfa)] +#[case(TT::Blinded, DT::Tr, DT::Wpkh, AS::Nia, AS::Cfa)] +#[case(TT::Blinded, DT::Tr, DT::Tr, AS::Nia, AS::Cfa)] +// blinded: nia - uda +#[case(TT::Blinded, DT::Wpkh, DT::Wpkh, AS::Nia, AS::Uda)] +#[case(TT::Blinded, DT::Wpkh, DT::Tr, AS::Nia, AS::Uda)] +#[case(TT::Blinded, DT::Tr, DT::Wpkh, AS::Nia, AS::Uda)] +#[case(TT::Blinded, DT::Tr, DT::Tr, AS::Nia, AS::Uda)] +// blinded: cfa - cfa +#[case(TT::Blinded, DT::Wpkh, DT::Wpkh, AS::Cfa, AS::Cfa)] +#[case(TT::Blinded, DT::Wpkh, DT::Tr, AS::Cfa, AS::Cfa)] +#[case(TT::Blinded, DT::Tr, DT::Wpkh, AS::Cfa, AS::Cfa)] +#[case(TT::Blinded, DT::Tr, DT::Tr, AS::Cfa, AS::Cfa)] +// blinded: cfa - nia +#[case(TT::Blinded, DT::Wpkh, DT::Wpkh, AS::Cfa, AS::Nia)] +#[case(TT::Blinded, DT::Wpkh, DT::Tr, AS::Cfa, AS::Nia)] +#[case(TT::Blinded, DT::Tr, DT::Wpkh, AS::Cfa, AS::Nia)] +#[case(TT::Blinded, DT::Tr, DT::Tr, AS::Cfa, AS::Nia)] +// blinded: cfa - uda +#[case(TT::Blinded, DT::Wpkh, DT::Wpkh, AS::Cfa, AS::Uda)] +#[case(TT::Blinded, DT::Wpkh, DT::Tr, AS::Cfa, AS::Uda)] +#[case(TT::Blinded, DT::Tr, DT::Wpkh, AS::Cfa, AS::Uda)] +#[case(TT::Blinded, DT::Tr, DT::Tr, AS::Cfa, AS::Uda)] +// blinded: uda - uda +#[case(TT::Blinded, DT::Wpkh, DT::Wpkh, AS::Uda, AS::Uda)] +#[case(TT::Blinded, DT::Wpkh, DT::Tr, AS::Uda, AS::Uda)] +#[case(TT::Blinded, DT::Tr, DT::Wpkh, AS::Uda, AS::Uda)] +#[case(TT::Blinded, DT::Tr, DT::Tr, AS::Uda, AS::Uda)] +// blinded: uda - nia +#[case(TT::Blinded, DT::Wpkh, DT::Wpkh, AS::Uda, AS::Nia)] +#[case(TT::Blinded, DT::Wpkh, DT::Tr, AS::Uda, AS::Nia)] +#[case(TT::Blinded, DT::Tr, DT::Wpkh, AS::Uda, AS::Nia)] +#[case(TT::Blinded, DT::Tr, DT::Tr, AS::Uda, AS::Nia)] +// blinded: uda - cfa +#[case(TT::Blinded, DT::Wpkh, DT::Wpkh, AS::Uda, AS::Cfa)] +#[case(TT::Blinded, DT::Wpkh, DT::Tr, AS::Uda, AS::Cfa)] +#[case(TT::Blinded, DT::Tr, DT::Wpkh, AS::Uda, AS::Cfa)] +#[case(TT::Blinded, DT::Tr, DT::Tr, AS::Uda, AS::Cfa)] +// witness: nia - nia +#[case(TT::Witness, DT::Wpkh, DT::Wpkh, AS::Nia, AS::Nia)] +#[case(TT::Witness, DT::Wpkh, DT::Tr, AS::Nia, AS::Nia)] +#[case(TT::Witness, DT::Tr, DT::Wpkh, AS::Nia, AS::Nia)] +#[case(TT::Witness, DT::Tr, DT::Tr, AS::Nia, AS::Nia)] +// witness: nia - cfa +#[case(TT::Witness, DT::Wpkh, DT::Wpkh, AS::Nia, AS::Cfa)] +#[case(TT::Witness, DT::Wpkh, DT::Tr, AS::Nia, AS::Cfa)] +#[case(TT::Witness, DT::Tr, DT::Wpkh, AS::Nia, AS::Cfa)] +#[case(TT::Witness, DT::Tr, DT::Tr, AS::Nia, AS::Cfa)] +// witness: nia - uda +#[case(TT::Witness, DT::Wpkh, DT::Wpkh, AS::Nia, AS::Uda)] +#[case(TT::Witness, DT::Wpkh, DT::Tr, AS::Nia, AS::Uda)] +#[case(TT::Witness, DT::Tr, DT::Wpkh, AS::Nia, AS::Uda)] +#[case(TT::Witness, DT::Tr, DT::Tr, AS::Nia, AS::Uda)] +// witness: cfa - cfa +#[case(TT::Witness, DT::Wpkh, DT::Wpkh, AS::Cfa, AS::Cfa)] +#[case(TT::Witness, DT::Wpkh, DT::Tr, AS::Cfa, AS::Cfa)] +#[case(TT::Witness, DT::Tr, DT::Wpkh, AS::Cfa, AS::Cfa)] +#[case(TT::Witness, DT::Tr, DT::Tr, AS::Cfa, AS::Cfa)] +// witness: cfa - nia +#[case(TT::Witness, DT::Wpkh, DT::Wpkh, AS::Cfa, AS::Nia)] +#[case(TT::Witness, DT::Wpkh, DT::Tr, AS::Cfa, AS::Nia)] +#[case(TT::Witness, DT::Tr, DT::Wpkh, AS::Cfa, AS::Nia)] +#[case(TT::Witness, DT::Tr, DT::Tr, AS::Cfa, AS::Nia)] +// witness: cfa - uda +#[case(TT::Witness, DT::Wpkh, DT::Wpkh, AS::Cfa, AS::Uda)] +#[case(TT::Witness, DT::Wpkh, DT::Tr, AS::Cfa, AS::Uda)] +#[case(TT::Witness, DT::Tr, DT::Wpkh, AS::Cfa, AS::Uda)] +#[case(TT::Witness, DT::Tr, DT::Tr, AS::Cfa, AS::Uda)] +// witness: uda - uda +#[case(TT::Witness, DT::Wpkh, DT::Wpkh, AS::Uda, AS::Uda)] +#[case(TT::Witness, DT::Wpkh, DT::Tr, AS::Uda, AS::Uda)] +#[case(TT::Witness, DT::Tr, DT::Wpkh, AS::Uda, AS::Uda)] +#[case(TT::Witness, DT::Tr, DT::Tr, AS::Uda, AS::Uda)] +// witness: uda - nia +#[case(TT::Witness, DT::Wpkh, DT::Wpkh, AS::Uda, AS::Nia)] +#[case(TT::Witness, DT::Wpkh, DT::Tr, AS::Uda, AS::Nia)] +#[case(TT::Witness, DT::Tr, DT::Wpkh, AS::Uda, AS::Nia)] +#[case(TT::Witness, DT::Tr, DT::Tr, AS::Uda, AS::Nia)] +// witness: uda - cfa +#[case(TT::Witness, DT::Wpkh, DT::Wpkh, AS::Uda, AS::Cfa)] +#[case(TT::Witness, DT::Wpkh, DT::Tr, AS::Uda, AS::Cfa)] +#[case(TT::Witness, DT::Tr, DT::Wpkh, AS::Uda, AS::Cfa)] +#[case(TT::Witness, DT::Tr, DT::Tr, AS::Uda, AS::Cfa)] +fn transfer_loop( + #[case] transfer_type: TransferType, + #[case] wlt_1_desc: DescriptorType, + #[case] wlt_2_desc: DescriptorType, + #[case] asset_schema_1: AssetSchema, + #[case] asset_schema_2: AssetSchema, +) { + println!( + "transfer_type {transfer_type:?} wlt_1_desc {wlt_1_desc:?} wlt_2_desc {wlt_2_desc:?} \ + asset_schema_1 {asset_schema_1:?} asset_schema_2 {asset_schema_2:?}" + ); + + initialize(); + + let mut wlt_1 = get_wallet(&wlt_1_desc); + let mut wlt_2 = get_wallet(&wlt_2_desc); + + let issued_supply_1 = 999; + let issued_supply_2 = 666; + + let mut sats = 9000; + + // wlt_1 issues 2 assets on the same UTXO + let utxo = wlt_1.get_utxo(); + let (contract_id_1, iface_type_name_1) = match asset_schema_1 { + AssetSchema::Nia => wlt_1.issue_nia(issued_supply_1, wlt_1.close_method(), Some(&utxo)), + AssetSchema::Uda => wlt_1.issue_uda(wlt_1.close_method(), Some(&utxo)), + AssetSchema::Cfa => wlt_1.issue_cfa(issued_supply_1, wlt_1.close_method(), Some(&utxo)), + }; + let (contract_id_2, iface_type_name_2) = match asset_schema_2 { + AssetSchema::Nia => wlt_1.issue_nia(issued_supply_2, wlt_1.close_method(), Some(&utxo)), + AssetSchema::Uda => wlt_1.issue_uda(wlt_1.close_method(), Some(&utxo)), + AssetSchema::Cfa => wlt_1.issue_cfa(issued_supply_2, wlt_1.close_method(), Some(&utxo)), + }; + wlt_1.check_allocations( + contract_id_1, + &iface_type_name_1, + asset_schema_1, + vec![issued_supply_1], + true, + ); + wlt_1.check_allocations( + contract_id_2, + &iface_type_name_2, + asset_schema_2, + vec![issued_supply_2], + true, + ); + + // wlt_1 spends asset 1, moving the other with a blank transition + let amount_1 = if asset_schema_1 == AssetSchema::Uda { + 1 + } else { + 99 + }; + wlt_1.send( + &mut wlt_2, + transfer_type, + contract_id_1, + &iface_type_name_1, + amount_1, + sats, + ); + wlt_1.check_allocations( + contract_id_1, + &iface_type_name_1, + asset_schema_1, + vec![issued_supply_1 - amount_1], + false, + ); + wlt_1.check_allocations( + contract_id_2, + &iface_type_name_2, + asset_schema_2, + vec![issued_supply_2], + true, + ); + wlt_2.check_allocations( + contract_id_1, + &iface_type_name_1, + asset_schema_1, + vec![amount_1], + true, + ); + + // wlt_1 spends asset 1 change (only if possible) + let amount_2 = 33; + if asset_schema_1 != AssetSchema::Uda { + wlt_1.send( + &mut wlt_2, + transfer_type, + contract_id_1, + &iface_type_name_1, + amount_2, + sats, + ); + wlt_1.check_allocations( + contract_id_1, + &iface_type_name_1, + asset_schema_1, + vec![issued_supply_1 - amount_1 - amount_2], + false, + ); + wlt_1.check_allocations( + contract_id_2, + &iface_type_name_2, + asset_schema_2, + vec![issued_supply_2], + true, + ); + wlt_2.check_allocations( + contract_id_1, + &iface_type_name_1, + asset_schema_1, + vec![amount_1, amount_2], + true, + ); + } + + // wlt_1 spends asset 2 + let amount_3 = if asset_schema_2 == AssetSchema::Uda { + 1 + } else { + 22 + }; + wlt_1.send( + &mut wlt_2, + transfer_type, + contract_id_2, + &iface_type_name_2, + amount_3, + sats, + ); + wlt_1.check_allocations( + contract_id_1, + &iface_type_name_1, + asset_schema_1, + vec![issued_supply_1 - amount_1 - amount_2], + false, + ); + wlt_1.check_allocations( + contract_id_2, + &iface_type_name_2, + asset_schema_2, + vec![issued_supply_2 - amount_3], + false, + ); + wlt_2.check_allocations( + contract_id_1, + &iface_type_name_1, + asset_schema_1, + vec![amount_1, amount_2], + true, + ); + wlt_2.check_allocations( + contract_id_2, + &iface_type_name_2, + asset_schema_2, + vec![amount_3], + true, + ); + + // wlt_2 spends received allocation(s) of asset 1 + let amount_4 = if asset_schema_1 == AssetSchema::Uda { + 1 + } else { + 111 + }; + sats -= 1000; + wlt_2.send( + &mut wlt_1, + transfer_type, + contract_id_1, + &iface_type_name_1, + amount_4, + sats, + ); + wlt_1.check_allocations( + contract_id_1, + &iface_type_name_1, + asset_schema_1, + vec![issued_supply_1 - amount_1 - amount_2, amount_4], + true, + ); + wlt_1.check_allocations( + contract_id_2, + &iface_type_name_2, + asset_schema_2, + vec![issued_supply_2 - amount_3], + false, + ); + wlt_2.check_allocations( + contract_id_1, + &iface_type_name_1, + asset_schema_1, + vec![amount_1 + amount_2 - amount_4], + false, + ); + wlt_2.check_allocations( + contract_id_2, + &iface_type_name_2, + asset_schema_2, + vec![amount_3], + true, + ); + + // wlt_2 spends asset 2 + let amount_5 = if asset_schema_2 == AssetSchema::Uda { + 1 + } else { + 11 + }; + sats -= 1000; + wlt_2.send( + &mut wlt_1, + transfer_type, + contract_id_2, + &iface_type_name_2, + amount_5, + sats, + ); + wlt_1.check_allocations( + contract_id_1, + &iface_type_name_1, + asset_schema_1, + vec![issued_supply_1 - amount_1 - amount_2, amount_4], + true, + ); + wlt_1.check_allocations( + contract_id_2, + &iface_type_name_2, + asset_schema_2, + vec![issued_supply_2 - amount_3, amount_5], + true, + ); + wlt_2.check_allocations( + contract_id_1, + &iface_type_name_1, + asset_schema_1, + vec![amount_1 + amount_2 - amount_4], + false, + ); + wlt_2.check_allocations( + contract_id_2, + &iface_type_name_2, + asset_schema_2, + vec![amount_3 - amount_5], + false, + ); + + // wlt_1 spends asset 1, received back + let amount_6 = if asset_schema_1 == AssetSchema::Uda { + 1 + } else { + issued_supply_1 - amount_1 - amount_2 + amount_4 + }; + sats -= 1000; + wlt_1.send( + &mut wlt_2, + transfer_type, + contract_id_1, + &iface_type_name_1, + amount_6, + sats, + ); + wlt_1.check_allocations( + contract_id_1, + &iface_type_name_1, + asset_schema_1, + vec![], + false, + ); + wlt_1.check_allocations( + contract_id_2, + &iface_type_name_2, + asset_schema_2, + vec![issued_supply_2 - amount_3, amount_5], + true, + ); + wlt_2.check_allocations( + contract_id_1, + &iface_type_name_1, + asset_schema_1, + vec![amount_1 + amount_2 - amount_4, amount_6], + true, + ); + wlt_2.check_allocations( + contract_id_2, + &iface_type_name_2, + asset_schema_2, + vec![amount_3 - amount_5], + false, + ); + + // wlt_1 spends asset 2, received back + let amount_7 = if asset_schema_2 == AssetSchema::Uda { + 1 + } else { + issued_supply_2 - amount_3 + amount_5 + }; + sats -= 1000; + wlt_1.send( + &mut wlt_2, + transfer_type, + contract_id_2, + &iface_type_name_2, + amount_7, + sats, + ); + wlt_1.check_allocations( + contract_id_1, + &iface_type_name_1, + asset_schema_1, + vec![], + false, + ); + wlt_1.check_allocations( + contract_id_2, + &iface_type_name_2, + asset_schema_2, + vec![], + false, + ); + wlt_2.check_allocations( + contract_id_1, + &iface_type_name_1, + asset_schema_1, + vec![amount_1 + amount_2 - amount_4, amount_6], + true, + ); + wlt_2.check_allocations( + contract_id_2, + &iface_type_name_2, + asset_schema_2, + vec![amount_3 - amount_5, amount_7], + true, + ); +} + +#[test] +fn same_transfer_twice() { + initialize(); + + let mut wlt_1 = get_wallet(&DescriptorType::Wpkh); + let mut wlt_2 = get_wallet(&DescriptorType::Wpkh); + + let amount = 600; + + let (contract_id, iface_type_name) = wlt_1.issue_nia(amount, wlt_1.close_method(), None); + + stop_mining(); + let initial_height = get_height(); + + let invoice = wlt_2.invoice( + contract_id, + &iface_type_name, + amount, + wlt_2.close_method(), + InvoiceType::Witness, + ); + let _ = wlt_1.transfer(invoice.clone(), None, Some(500)); + + // retry with higher fees, TX hasn't been mined + let mid_height = get_height(); + assert_eq!(initial_height, mid_height); + + let _ = wlt_1.transfer(invoice, None, Some(1000)); + + let final_height = get_height(); + assert_eq!(initial_height, final_height); + resume_mining(); +} diff --git a/tests/utils/chain.rs b/tests/utils/chain.rs new file mode 100644 index 0000000..1d289e2 --- /dev/null +++ b/tests/utils/chain.rs @@ -0,0 +1,242 @@ +use super::*; + +static INIT: Once = Once::new(); + +pub static INDEXER: OnceLock = OnceLock::new(); + +#[derive(Clone, Default, PartialEq, Eq, Debug)] +pub enum Indexer { + Electrum, + #[default] + Esplora, +} + +impl fmt::Display for Indexer { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "{}", format!("{:?}", self).to_lowercase()) + } +} + +pub fn initialize() { + INIT.call_once(|| { + INDEXER.get_or_init(|| match std::env::var("INDEXER") { + Ok(val) if val.to_lowercase() == Indexer::Esplora.to_string() => Indexer::Esplora, + Ok(val) if val.to_lowercase() == Indexer::Electrum.to_string() => Indexer::Electrum, + Err(VarError::NotPresent) => Indexer::Esplora, + _ => { + panic!("invalid indexer. possible values: `esplora` (default), `electrum`") + } + }); + if std::env::var("SKIP_INIT").is_ok() { + println!("skipping services initialization"); + return; + } + let start_services_file = PathBuf::from("tests").join("start_services.sh"); + println!("starting test services..."); + let output = Command::new(start_services_file) + .env("PROFILE", INDEXER.get().unwrap().to_string()) + .output() + .expect("failed to start test services"); + if !output.status.success() { + println!("{output:?}"); + panic!("failed to start test services"); + } + _wait_indexer_sync(); + }); +} + +static MINER: Lazy> = Lazy::new(|| RwLock::new(Miner { no_mine_count: 0 })); + +#[derive(Clone, Debug)] +pub struct Miner { + no_mine_count: u32, +} + +fn _bitcoin_cli() -> Vec { + let compose_file = PathBuf::from("tests").join("docker-compose.yml"); + let mut cmd = vec![ + s!("-f"), + compose_file.to_string_lossy().to_string(), + s!("exec"), + s!("-T"), + ]; + match INDEXER.get().unwrap() { + Indexer::Electrum => cmd.extend(vec![ + "-u".to_string(), + "blits".to_string(), + "bitcoind".to_string(), + "bitcoin-cli".to_string(), + "-regtest".to_string(), + ]), + Indexer::Esplora => cmd.extend(vec!["esplora".to_string(), "cli".to_string()]), + }; + cmd +} + +impl Miner { + fn mine(&self) -> bool { + if self.no_mine_count > 0 { + return false; + } + self.force_mine() + } + + fn force_mine(&self) -> bool { + let output = Command::new("docker") + .stdin(Stdio::null()) + .arg("compose") + .args(_bitcoin_cli()) + .arg("-rpcwallet=miner") + .arg("-generate") + .arg("1") + .output() + .expect("failed to mine"); + if !output.status.success() { + println!("{output:?}"); + panic!("failed to mine"); + } + _wait_indexer_sync(); + true + } + + fn stop_mining(&mut self) { + self.no_mine_count += 1; + } + + fn resume_mining(&mut self) { + if self.no_mine_count > 0 { + self.no_mine_count -= 1; + } + } +} + +pub fn mine(resume: bool) { + let t_0 = OffsetDateTime::now_utc(); + if resume { + resume_mining(); + } + loop { + if (OffsetDateTime::now_utc() - t_0).as_seconds_f32() > 120.0 { + println!("forcibly breaking mining wait"); + resume_mining(); + } + let mined = MINER.read().as_ref().unwrap().mine(); + if mined { + break; + } + std::thread::sleep(std::time::Duration::from_millis(500)); + } +} + +pub fn mine_but_no_resume() { + let t_0 = OffsetDateTime::now_utc(); + loop { + if (OffsetDateTime::now_utc() - t_0).as_seconds_f32() > 120.0 { + println!("forcibly breaking mining wait"); + resume_mining(); + } + let miner = MINER.write().unwrap(); + if miner.no_mine_count <= 1 { + miner.force_mine(); + break; + } + drop(miner); + std::thread::sleep(std::time::Duration::from_millis(500)); + } +} + +pub fn stop_mining() { + MINER.write().unwrap().stop_mining() +} + +pub fn stop_mining_when_alone() { + let t_0 = OffsetDateTime::now_utc(); + loop { + if (OffsetDateTime::now_utc() - t_0).as_seconds_f32() > 120.0 { + println!("forcibly breaking stop wait"); + stop_mining(); + } + let mut miner = MINER.write().unwrap(); + if miner.no_mine_count == 0 { + miner.stop_mining(); + break; + } + drop(miner); + std::thread::sleep(std::time::Duration::from_millis(500)); + } +} + +pub fn resume_mining() { + MINER.write().unwrap().resume_mining() +} + +pub fn get_height() -> u32 { + let output = Command::new("docker") + .stdin(Stdio::null()) + .stderr(Stdio::null()) + .arg("compose") + .args(_bitcoin_cli()) + .arg("getblockcount") + .output() + .expect("failed to call getblockcount"); + if !output.status.success() { + println!("{output:?}"); + panic!("failed to get block count"); + } + let blockcount_str = + std::str::from_utf8(&output.stdout).expect("could not parse blockcount output"); + blockcount_str + .trim() + .parse::() + .expect("could not parse blockcount") +} + +fn _wait_indexer_sync() { + let t_0 = OffsetDateTime::now_utc(); + let blockcount = get_height(); + loop { + std::thread::sleep(std::time::Duration::from_millis(100)); + match INDEXER.get().unwrap() { + Indexer::Electrum => { + let electrum_client = + ElectrumClient::new(ELECTRUM_URL).expect("cannot get electrum client"); + if electrum_client.block_header(blockcount as usize).is_ok() { + break; + } + } + Indexer::Esplora => { + let esplora_client = EsploraClient::new(ESPLORA_URL).build_blocking().unwrap(); + if esplora_client.block_hash(blockcount).is_ok() { + break; + } + } + } + if (OffsetDateTime::now_utc() - t_0).as_seconds_f32() > 15.0 { + panic!("indexer not syncing with bitcoind"); + } + } +} + +pub fn send_to_address(address: String) -> String { + let output = Command::new("docker") + .stdin(Stdio::null()) + .arg("compose") + .args(_bitcoin_cli()) + .arg("-rpcwallet=miner") + .arg("sendtoaddress") + .arg(address) + .arg("1") + .output() + .expect("failed to fund wallet"); + if !output.status.success() { + println!("{output:?}"); + panic!("failed to send to address"); + } + String::from_utf8(output.stdout).unwrap().trim().to_string() +} + +pub fn fund_wallet(address: String) -> String { + let address = send_to_address(address); + mine(false); + address +} diff --git a/tests/utils/helpers.rs b/tests/utils/helpers.rs new file mode 100644 index 0000000..dde0a2c --- /dev/null +++ b/tests/utils/helpers.rs @@ -0,0 +1,855 @@ +use super::*; + +pub struct Wallet { + stored_wallet: StoredWallet>, + account: MemorySigningAccount, +} + +#[derive(Debug, Copy, Clone)] +pub enum DescriptorType { + Wpkh, + Tr, +} + +impl fmt::Display for DescriptorType { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "{}", format!("{:?}", self).to_lowercase()) + } +} + +#[derive(Debug, Copy, Clone)] +pub enum TransferType { + Blinded, + Witness, +} + +impl fmt::Display for TransferType { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "{}", format!("{:?}", self).to_lowercase()) + } +} + +pub enum InvoiceType { + Blinded(Option), + Witness, +} + +#[derive(Debug, EnumIter, Copy, Clone, PartialEq)] +pub enum AssetSchema { + Nia, + Uda, + Cfa, +} + +impl fmt::Display for AssetSchema { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "{}", format!("{:?}", self).to_lowercase()) + } +} + +#[derive(Debug)] +pub enum AssetInfo { + Nia { + spec: AssetSpec, + terms: ContractTerms, + issued_supply: u64, + }, + Uda { + spec: AssetSpec, + terms: ContractTerms, + token_data: TokenData, + }, + Cfa { + name: Name, + precision: Precision, + details: Option
, + terms: ContractTerms, + issued_supply: u64, + }, +} + +impl AssetSchema { + fn iface_type_name(&self) -> TypeName { + tn!(match self { + Self::Nia => "RGB20Fixed", + Self::Uda => "RGB21Unique", + Self::Cfa => "RGB25Base", + }) + } + + fn schema(&self) -> Schema { + match self { + Self::Nia => NonInflatableAsset::schema(), + Self::Uda => UniqueDigitalAsset::schema(), + Self::Cfa => CollectibleFungibleAsset::schema(), + } + } + + fn issue_impl(&self) -> IfaceImpl { + match self { + Self::Nia => NonInflatableAsset::issue_impl(), + Self::Uda => UniqueDigitalAsset::issue_impl(), + Self::Cfa => CollectibleFungibleAsset::issue_impl(), + } + } + + fn scripts(&self) -> Scripts { + match self { + Self::Nia => NonInflatableAsset::scripts(), + Self::Uda => UniqueDigitalAsset::scripts(), + Self::Cfa => CollectibleFungibleAsset::scripts(), + } + } + + fn types(&self) -> TypeSystem { + match self { + Self::Nia => NonInflatableAsset::types(), + Self::Uda => UniqueDigitalAsset::types(), + Self::Cfa => CollectibleFungibleAsset::types(), + } + } + + fn iface(&self) -> Iface { + match self { + Self::Nia => Rgb20::iface(rgb20::Features::FIXED), + Self::Uda => Rgb21::iface(rgb21::Features::NONE), + Self::Cfa => Rgb25::iface(rgb25::Features::NONE), + } + } + + fn get_valid_kit(&self) -> ValidKit { + let mut kit = Kit::default(); + kit.schemata.push(self.schema()).unwrap(); + kit.ifaces.push(self.iface()).unwrap(); + kit.iimpls.push(self.issue_impl()).unwrap(); + kit.scripts.extend(self.scripts().into_values()).unwrap(); + kit.types = self.types(); + kit.validate().unwrap() + } +} + +impl AssetInfo { + fn asset_schema(&self) -> AssetSchema { + match self { + Self::Nia { .. } => AssetSchema::Nia, + Self::Uda { .. } => AssetSchema::Uda, + Self::Cfa { .. } => AssetSchema::Cfa, + } + } + + fn iface_type_name(&self) -> TypeName { + self.asset_schema().iface_type_name() + } + + fn schema(&self) -> Schema { + self.asset_schema().schema() + } + + fn issue_impl(&self) -> IfaceImpl { + self.asset_schema().issue_impl() + } + + fn scripts(&self) -> Scripts { + self.asset_schema().scripts() + } + + fn types(&self) -> TypeSystem { + self.asset_schema().types() + } + + fn iface(&self) -> Iface { + self.asset_schema().iface() + } + + pub fn nia( + ticker: &str, + name: &str, + precision: u8, + details: Option<&str>, + terms_text: &str, + terms_media_fpath: Option<&str>, + issued_supply: u64, + ) -> Self { + let spec = AssetSpec::with( + ticker, + name, + Precision::try_from(precision).unwrap(), + details, + ) + .unwrap(); + let text = RicardianContract::from_str(terms_text).unwrap(); + let attachment = terms_media_fpath.map(attachment_from_fpath); + let terms = ContractTerms { + text, + media: attachment, + }; + Self::Nia { + spec, + terms, + issued_supply, + } + } + + pub fn uda( + ticker: &str, + name: &str, + details: Option<&str>, + terms_text: &str, + terms_media_fpath: Option<&str>, + token_data: TokenData, + ) -> AssetInfo { + let spec = AssetSpec::with(ticker, name, Precision::try_from(0).unwrap(), details).unwrap(); + let text = RicardianContract::from_str(terms_text).unwrap(); + let attachment = terms_media_fpath.map(attachment_from_fpath); + let terms = ContractTerms { + text, + media: attachment.clone(), + }; + Self::Uda { + spec, + terms, + token_data, + } + } + + pub fn cfa( + name: &str, + precision: u8, + details: Option<&str>, + terms_text: &str, + terms_media_fpath: Option<&str>, + issued_supply: u64, + ) -> AssetInfo { + let text = RicardianContract::from_str(terms_text).unwrap(); + let attachment = terms_media_fpath.map(attachment_from_fpath); + let terms = ContractTerms { + text, + media: attachment, + }; + Self::Cfa { + name: Name::try_from(name.to_owned()).unwrap(), + precision: Precision::try_from(precision).unwrap(), + details: details.map(|d| Details::try_from(d.to_owned()).unwrap()), + terms, + issued_supply, + } + } + + fn add_global_state(&self, mut builder: ContractBuilder) -> ContractBuilder { + match self { + Self::Nia { + spec, + terms, + issued_supply, + } => builder + .add_global_state("spec", spec.clone()) + .unwrap() + .add_global_state("terms", terms.clone()) + .unwrap() + .add_global_state("issuedSupply", Amount::from(*issued_supply)) + .unwrap(), + Self::Uda { + spec, + terms, + token_data, + } => builder + .add_global_state("spec", spec.clone()) + .unwrap() + .add_global_state("terms", terms.clone()) + .unwrap() + .add_global_state("tokens", token_data.clone()) + .unwrap(), + Self::Cfa { + name, + precision, + details, + terms, + issued_supply, + } => { + builder = builder + .add_global_state("name", name.clone()) + .unwrap() + .add_global_state("precision", *precision) + .unwrap() + .add_global_state("terms", terms.clone()) + .unwrap() + .add_global_state("issuedSupply", Amount::from(*issued_supply)) + .unwrap(); + if let Some(details) = details { + builder = builder + .add_global_state("details", details.clone()) + .unwrap() + } + builder + } + } + } + + fn add_asset_owner( + &self, + builder: ContractBuilder, + builder_seal: BuilderSeal>, + ) -> ContractBuilder { + match self { + Self::Nia { issued_supply, .. } | Self::Cfa { issued_supply, .. } => builder + .add_fungible_state("assetOwner", builder_seal, *issued_supply) + .unwrap(), + Self::Uda { token_data, .. } => { + let fraction = OwnedFraction::from_inner(1); + let allocation = Allocation::with(token_data.index, fraction); + builder + .add_data("assetOwner", builder_seal, allocation) + .unwrap() + } + } + } +} + +pub fn get_wallet(descriptor_type: &DescriptorType) -> Wallet { + let mut seed = vec![0u8; 128]; + rand::thread_rng().fill_bytes(&mut seed); + + let secp = Secp256k1::new(); + + let master_xpriv = ExtendedPrivKey::new_master(bitcoin::Network::Regtest, &seed).unwrap(); + + let master_xpub = ExtendedPubKey::from_priv(&secp, &master_xpriv); + + let derivation: DerivationPath = vec![ + ChildNumber::from_hardened_idx(86).unwrap(), + ChildNumber::from_hardened_idx(1).unwrap(), + ChildNumber::from_hardened_idx(0).unwrap(), + ] + .into(); + + let account_xpriv = master_xpriv.derive_priv(&secp, &derivation).unwrap(); + + let account = + MemorySigningAccount::with(&secp, master_xpub.identifier(), derivation, account_xpriv); + + let derivation_account = account.to_account(); + let derivation_account_rgb = derivation_account + .to_string() + .replace("/*/*", "/<0;1;9;10>/*"); + let xpub_derivable = XpubDerivable::from_str(&derivation_account_rgb).unwrap(); + + let descriptor = match descriptor_type { + DescriptorType::Wpkh => RgbDescr::Wpkh(Wpkh::from(xpub_derivable)), + DescriptorType::Tr => RgbDescr::TapretKey(TapretKey::from(xpub_derivable)), + }; + + let rgb_dir = PathBuf::from("tests") + .join("tmp") + .join(account.account_fingerprint().to_string()); + std::fs::create_dir_all(&rgb_dir).unwrap(); + println!("wallet dir: {rgb_dir:?}"); + + let mut bp_runtime: BpRuntime = BpRuntime::new_standard(descriptor, Network::Regtest); + + if bp_runtime.warnings().is_empty() { + eprintln!("success"); + } else { + eprintln!("complete with warnings:"); + for warning in bp_runtime.warnings() { + eprintln!("- {warning}"); + } + bp_runtime.reset_warnings(); + } + + let name = s!("wallet_name"); + let dir = rgb_dir.join(&name); + bp_runtime.set_name(name); + bp_runtime.store(&dir).unwrap(); + + let stock = Stock::default(); + stock.store(&rgb_dir).unwrap(); + let mut stored_stock = StoredStock::attach(rgb_dir.clone(), stock.clone()); + + let wallet_path = bp_runtime.path().clone(); + let stored_wallet = + StoredWallet::attach(rgb_dir.clone(), wallet_path, stock, bp_runtime.detach()); + + for asset_schema in AssetSchema::iter() { + let valid_kit = asset_schema.get_valid_kit(); + stored_stock.import_kit(valid_kit).unwrap(); + } + + let mut wallet = Wallet { + stored_wallet, + account, + }; + + wallet.sync(); + + wallet +} + +fn get_indexer() -> AnyIndexer { + match INDEXER.get().unwrap() { + Indexer::Electrum => { + AnyIndexer::Electrum(Box::new(ElectrumClient::new(ELECTRUM_URL).unwrap())) + } + Indexer::Esplora => AnyIndexer::Esplora(Box::new( + EsploraClient::new(ESPLORA_URL).build_blocking().unwrap(), + )), + } +} + +fn get_resolver() -> AnyResolver { + match INDEXER.get().unwrap() { + Indexer::Electrum => AnyResolver::electrum_blocking(ELECTRUM_URL, None).unwrap(), + Indexer::Esplora => AnyResolver::esplora_blocking(ESPLORA_URL, None).unwrap(), + } +} + +fn broadcast_tx(indexer: &AnyIndexer, tx: &Tx) { + match indexer { + AnyIndexer::Electrum(inner) => { + inner.transaction_broadcast(tx).unwrap(); + } + AnyIndexer::Esplora(inner) => { + inner.broadcast(tx).unwrap(); + } + _ => unreachable!("unsupported indexer"), + } +} + +pub fn attachment_from_fpath(fpath: &str) -> Attachment { + let file_bytes = std::fs::read(fpath).unwrap(); + let file_hash: sha256::Hash = Hash::hash(&file_bytes[..]); + let digest = file_hash.into_inner().into(); + let mime = tree_magic_mini::from_filepath(fpath.as_ref()) + .unwrap() + .to_string(); + let media_ty: &'static str = Box::leak(mime.clone().into_boxed_str()); + let media_type = MediaType::with(media_ty); + Attachment { + ty: media_type, + digest, + } +} + +fn uda_token_data_minimal() -> TokenData { + TokenData { + index: TokenIndex::from_inner(UDA_FIXED_INDEX), + ..Default::default() + } +} + +pub fn uda_token_data( + ticker: &str, + name: &str, + details: &str, + preview: EmbeddedMedia, + media: Attachment, + attachments: BTreeMap, + reserves: ProofOfReserves, +) -> TokenData { + let mut token_data = uda_token_data_minimal(); + token_data.preview = Some(preview); + token_data.media = Some(media); + token_data.attachments = Confined::try_from(attachments.clone()).unwrap(); + token_data.reserves = Some(reserves); + token_data.ticker = Some(Ticker::try_from(ticker.to_string()).unwrap()); + token_data.name = Some(Name::try_from(name.to_string()).unwrap()); + token_data.details = Some(Details::try_from(details.to_string()).unwrap()); + token_data +} + +impl Wallet { + pub fn get_utxo(&mut self) -> Outpoint { + let address = self + .stored_wallet + .wallet() + .addresses(RgbKeychain::for_method(self.close_method())) + .next() + .expect("no addresses left") + .addr + .to_string(); + let txid = fund_wallet(address); + self.sync(); + let mut vout = None; + let bp_runtime = self.stored_wallet.wallet(); + for (_derived_addr, utxos) in bp_runtime.address_coins() { + for utxo in utxos { + if utxo.outpoint.txid.to_string() == txid { + vout = Some(utxo.outpoint.vout_u32()); + } + } + } + Outpoint { + txid: Txid::from_str(&txid).unwrap(), + vout: Vout::from_u32(vout.unwrap()), + } + } + + pub fn sync(&mut self) { + let indexer = get_indexer(); + self.stored_wallet + .wallet_mut() + .update(&indexer) + .into_result() + .unwrap(); + self.stored_wallet.store(); + } + + pub fn close_method(&self) -> CloseMethod { + self.stored_wallet.wallet().seal_close_method() + } + + pub fn issue_with_info( + &mut self, + asset_info: AssetInfo, + close_method: CloseMethod, + outpoint: Option<&Outpoint>, + ) -> (ContractId, TypeName) { + let outpoint = if let Some(outpoint) = outpoint { + *outpoint + } else { + self.get_utxo() + }; + + let blind_seal = match close_method { + CloseMethod::TapretFirst => BlindSeal::tapret_first_rand(outpoint.txid, outpoint.vout), + CloseMethod::OpretFirst => BlindSeal::opret_first_rand(outpoint.txid, outpoint.vout), + }; + let genesis_seal = GenesisSeal::from(blind_seal); + let seal: XChain> = XChain::with(Layer1::Bitcoin, genesis_seal); + let builder_seal = BuilderSeal::from(seal); + + let mut builder = ContractBuilder::with( + Identity::default(), + asset_info.iface(), + asset_info.schema(), + asset_info.issue_impl(), + asset_info.types(), + asset_info.scripts(), + ); + + builder = asset_info.add_global_state(builder); + + builder = asset_info.add_asset_owner(builder, builder_seal); + + let contract = builder.issue_contract().expect("failure issuing contract"); + let mut resolver = get_resolver(); + self.stored_wallet + .stock_mut() + .import_contract(contract.clone(), &mut resolver) + .unwrap(); + + (contract.contract_id(), asset_info.iface_type_name()) + } + + pub fn issue_nia( + &mut self, + issued_supply: u64, + close_method: CloseMethod, + outpoint: Option<&Outpoint>, + ) -> (ContractId, TypeName) { + let asset_info = AssetInfo::nia( + "NIATCKR", + "NIA asset name", + 2, + None, + "NIA terms", + None, + issued_supply, + ); + self.issue_with_info(asset_info, close_method, outpoint) + } + + pub fn issue_uda( + &mut self, + close_method: CloseMethod, + outpoint: Option<&Outpoint>, + ) -> (ContractId, TypeName) { + let token_data = uda_token_data_minimal(); + let asset_info = AssetInfo::uda( + "UDATCKR", + "UDA asset name", + None, + "NIA terms", + None, + token_data, + ); + self.issue_with_info(asset_info, close_method, outpoint) + } + + pub fn issue_cfa( + &mut self, + issued_supply: u64, + close_method: CloseMethod, + outpoint: Option<&Outpoint>, + ) -> (ContractId, TypeName) { + let asset_info = + AssetInfo::cfa("CFA asset name", 0, None, "CFA terms", None, issued_supply); + self.issue_with_info(asset_info, close_method, outpoint) + } + + pub fn invoice( + &mut self, + contract_id: ContractId, + iface_type_name: &TypeName, + amount: u64, + close_method: CloseMethod, + invoice_type: InvoiceType, + ) -> RgbInvoice { + let network = self.stored_wallet.wallet().network(); + let beneficiary = match invoice_type { + InvoiceType::Blinded(outpoint) => { + let outpoint = if let Some(outpoint) = outpoint { + outpoint + } else { + self.get_utxo() + }; + let seal = XChain::Bitcoin(GraphSeal::new_random( + close_method, + outpoint.txid, + outpoint.vout, + )); + self.stored_wallet + .stock_mut() + .store_secret_seal(seal) + .unwrap(); + Beneficiary::BlindedSeal(*seal.to_secret_seal().as_reduced_unsafe()) + } + InvoiceType::Witness => { + let address = self + .stored_wallet + .wallet() + .addresses(RgbKeychain::Rgb) + .next() + .expect("no addresses left") + .addr; + Beneficiary::WitnessVout(Pay2Vout { + address: address.payload, + method: close_method, + }) + } + }; + + let mut builder = RgbInvoiceBuilder::new(XChainNet::bitcoin(network, beneficiary)) + .set_contract(contract_id) + .set_interface(iface_type_name.clone()); + if *iface_type_name == AssetSchema::Uda.iface_type_name() { + if amount != 1 { + panic!("UDA amount must be 1"); + } + builder = builder + .clone() + .set_allocation(UDA_FIXED_INDEX, amount) + .unwrap(); + } else { + builder = builder.clone().set_amount_raw(amount); + } + builder.finish() + } + + pub fn transfer( + &mut self, + invoice: RgbInvoice, + sats: Option, + fee: Option, + ) -> (Transfer, Tx) { + self.sync(); + + let fee = Sats::from_sats(fee.unwrap_or(400)); + let sats = Sats::from_sats(sats.unwrap_or(2000)); + let params = TransferParams::with(fee, sats); + let (psbt, _psbt_meta, consignment) = self.stored_wallet.pay(&invoice, params).unwrap(); + + let secp = Secp256k1::new(); + let mut key_provider = MemoryKeyProvider::with(&secp, true); + key_provider.add_account(self.account.clone()); + let mut psbt = DwPsbt::deserialize(&psbt.serialize(PsbtVer::V0)).unwrap(); + let _sig_count = psbt.sign_all(&key_provider).unwrap(); + let mut psbt = consensus::encode::deserialize::(&psbt.serialize()).unwrap(); + psbt.finalize_mut(&secp).unwrap(); + + let tx = Tx::consensus_deserialize(psbt.extract_tx().serialize()).unwrap(); + let indexer = get_indexer(); + broadcast_tx(&indexer, &tx); + + let txid = tx.txid().to_string(); + println!("transfer txid: {txid:?}"); + + (consignment, tx) + } + + pub fn accept_transfer(&mut self, consignment: Transfer) { + self.sync(); + let mut resolver = get_resolver(); + let validated_consignment = consignment.validate(&mut resolver, true).unwrap(); + let validation_status = validated_consignment.clone().into_validation_status(); + let validity = validation_status.validity(); + assert_eq!(validity, Validity::Valid); + let mut attempts = 0; + while let Err(e) = self + .stored_wallet + .stock_mut() + .accept_transfer(validated_consignment.clone(), &mut resolver) + { + attempts += 1; + if attempts > 3 { + panic!("error accepting transfer: {e}"); + } + std::thread::sleep(std::time::Duration::from_millis(100)); + } + } + + pub fn contract_iface( + &self, + contract_id: ContractId, + iface_type_name: &TypeName, + ) -> ContractIface { + self.stored_wallet + .stock() + .contract_iface(contract_id, iface_type_name.clone()) + .unwrap() + } + + pub fn contract_fungible_allocations( + &self, + contract_iface: &ContractIface, + ) -> Vec { + contract_iface + .fungible(fname!("assetOwner"), &self.stored_wallet.wallet().filter()) + .unwrap() + .collect() + } + + pub fn contract_data_allocations(&self, contract_iface: &ContractIface) -> Vec { + contract_iface + .data(fname!("assetOwner"), &self.stored_wallet.wallet().filter()) + .unwrap() + .collect() + } + + pub fn debug_logs(&self, contract_id: ContractId, iface_type_name: &TypeName) { + let contract = self.contract_iface(contract_id, iface_type_name); + + println!("Global:"); + for global in &contract.iface.global_state { + if let Ok(values) = contract.global(global.name.clone()) { + for val in values { + println!(" {} := {}", global.name, val); + } + } + } + + println!("\nOwned:"); + for owned in &contract.iface.assignments { + println!(" {}:", owned.name); + if let Ok(allocations) = + contract.fungible(owned.name.clone(), &self.stored_wallet.wallet().filter()) + { + for allocation in allocations { + println!( + " amount={}, utxo={}, witness={} # owned by the wallet", + allocation.state, allocation.seal, allocation.witness + ); + } + } + if let Ok(allocations) = contract.fungible( + owned.name.clone(), + &FilterExclude(&self.stored_wallet.wallet().filter()), + ) { + for allocation in allocations { + println!( + " amount={}, utxo={}, witness={} # owner unknown", + allocation.state, allocation.seal, allocation.witness + ); + } + } + } + + let bp_runtime = self.stored_wallet.wallet(); + println!("\nHeight\t{:>12}\t{:68}", "Amount, ṩ", "Outpoint"); + for (derived_addr, utxos) in bp_runtime.address_coins() { + println!("{}\t{}", derived_addr.addr, derived_addr.terminal); + for row in utxos { + println!("{}\t{: >12}\t{:68}", row.height, row.amount, row.outpoint); + } + println!() + } + + println!("\nWallet total balance: {} ṩ", bp_runtime.balance()); + } + + pub fn send( + &mut self, + recv_wlt: &mut Wallet, + transfer_type: TransferType, + contract_id: ContractId, + iface_type_name: &TypeName, + amount: u64, + sats: u64, + ) -> (Transfer, Tx) { + let invoice = match transfer_type { + TransferType::Blinded => recv_wlt.invoice( + contract_id, + iface_type_name, + amount, + recv_wlt.close_method(), + InvoiceType::Blinded(None), + ), + TransferType::Witness => recv_wlt.invoice( + contract_id, + iface_type_name, + amount, + recv_wlt.close_method(), + InvoiceType::Witness, + ), + }; + let (consignment, tx) = self.transfer(invoice, Some(sats), None); + mine(false); + recv_wlt.accept_transfer(consignment.clone()); + self.sync(); + (consignment, tx) + } + + pub fn check_allocations( + &self, + contract_id: ContractId, + iface_type_name: &TypeName, + asset_schema: AssetSchema, + expected_fungible_allocations: Vec, + nonfungible_allocation: bool, + ) { + let contract_iface = self.contract_iface(contract_id, iface_type_name); + match asset_schema { + AssetSchema::Nia | AssetSchema::Cfa => { + let allocations = self.contract_fungible_allocations(&contract_iface); + assert_eq!(allocations.len(), expected_fungible_allocations.len()); + assert!(allocations + .iter() + .all(|a| a.seal.method() == self.close_method())); + for amount in expected_fungible_allocations { + assert_eq!( + allocations + .iter() + .filter(|a| a.state == Amount::from(amount)) + .count(), + 1 + ); + } + } + AssetSchema::Uda => { + let allocations = self.contract_data_allocations(&contract_iface); + let expected_allocations = if nonfungible_allocation { + assert_eq!( + allocations + .iter() + .filter(|a| a.state.to_string() == "000000000100000000000000") + .count(), + 1 + ); + 1 + } else { + 0 + }; + assert_eq!(allocations.len(), expected_allocations); + } + } + } +} diff --git a/tests/utils/mod.rs b/tests/utils/mod.rs new file mode 100644 index 0000000..014aec8 --- /dev/null +++ b/tests/utils/mod.rs @@ -0,0 +1,92 @@ +pub mod chain; +pub mod helpers; + +pub const ELECTRUM_URL: &str = "127.0.0.1:50001"; +pub const ESPLORA_URL: &str = "http://127.0.0.1:8094/regtest/api"; +pub const FAKE_TXID: &str = "e5a3e577309df31bd606f48049049d2e1e02b048206ba232944fcc053a176ccb:0"; +pub const UDA_FIXED_INDEX: u32 = 0; + +pub use std::{ + cell::OnceCell, + collections::{BTreeMap, BTreeSet, HashMap}, + env::VarError, + ffi::OsString, + fmt::{self, Display}, + path::{PathBuf, MAIN_SEPARATOR}, + process::{Command, Stdio}, + str::FromStr, + sync::{Mutex, Once, OnceLock, RwLock}, +}; + +pub use amplify::{ + confinement::{Confined, U16}, + map, s, Wrapper, +}; +pub use bitcoin::{ + consensus, + hashes::{sha256, Hash}, + util::{ + bip32::{ChildNumber, DerivationPath, ExtendedPrivKey, ExtendedPubKey}, + key::Secp256k1, + psbt::{serialize::Serialize, Psbt as BitcoinPsbt}, + }, +}; +pub use bp::{ + seals::txout::{BlindSeal, CloseMethod}, + ConsensusDecode, Outpoint, Sats, Tx, Txid, Vout, +}; +pub use bpstd::{ + DerivationPath as BpDerivationPath, DerivationSeg, HardenedIndex, Keychain, Network, Xpub, + XpubDerivable, XpubFp, XpubOrigin, +}; +pub use bpwallet::{AnyIndexer, Runtime as BpRuntime, Wallet as BpWallet}; +pub use descriptors::Wpkh; +pub use dw_psbt::{ + serialize::Deserialize, + sign::{MemoryKeyProvider, MemorySigningAccount, SignAll}, + Psbt as DwPsbt, +}; +pub use electrum::{Client as ElectrumClient, ElectrumApi}; +pub use esplora::Builder as EsploraClient; +pub use ifaces::{ + rgb20, rgb21, + rgb21::{EmbeddedMedia, TokenData}, + rgb25, IssuerWrapper, Rgb20, Rgb21, Rgb25, +}; +pub use miniscript::psbt::PsbtExt; +pub use once_cell::sync::Lazy; +pub use psbt::PsbtVer; +pub use rand::RngCore; +pub use rgb::{ + invoice::Pay2Vout, stl::ContractTerms, AnyResolver, DescriptorRgb, GenesisSeal, GraphSeal, + Identity, RgbDescr, RgbKeychain, StoredStock, StoredWallet, TapretKey, TransferParams, + WalletProvider, +}; +pub use rgbstd::{ + containers::{BuilderSeal, FileContent, Kit, Transfer, ValidKit}, + interface::{ + ContractBuilder, ContractIface, DataAllocation, FilterExclude, FungibleAllocation, Iface, + IfaceClass, IfaceId, IfaceImpl, NamedField, + }, + invoice::{Beneficiary, RgbInvoice, RgbInvoiceBuilder, XChainNet}, + persistence::{ + fs::{LoadFs, StoreFs}, + PersistedState, SchemaIfaces, StashReadProvider, Stock, + }, + schema::SchemaId, + stl::{ + AssetSpec, Attachment, Details, MediaType, Name, ProofOfReserves, RicardianContract, Ticker, + }, + validation::{Scripts, Validity}, + Allocation, Amount, ContractId, GlobalStateType, Layer1, OwnedFraction, Precision, Schema, + TokenIndex, TxoSeal, XChain, +}; +pub use rstest::rstest; +pub use schemata::{CollectibleFungibleAsset, NonInflatableAsset, UniqueDigitalAsset}; +pub use strict_encoding::{fname, tn, FieldName, StrictSerialize, TypeName}; +pub use strict_types::{StrictVal, TypeSystem}; +pub use strum::IntoEnumIterator; +pub use strum_macros::EnumIter; +pub use time::OffsetDateTime; + +pub use crate::utils::{chain::*, helpers::*}; diff --git a/vesper b/vesper new file mode 160000 index 0000000..6e1c889 --- /dev/null +++ b/vesper @@ -0,0 +1 @@ +Subproject commit 6e1c889e9b951ac709d7db0e57d02dc427446527