diff --git a/.generated-sources/blocklist-openapi-gen/package.json b/.generated-sources/blocklist-openapi-gen/package.json deleted file mode 100644 index 247175583..000000000 --- a/.generated-sources/blocklist-openapi-gen/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "blocklist-api", - "scripts": { - "build-openapi": "openapi-generator-cli generate -i ./blocklist-client-openapi.json -g rust -o ../blocklist-api --config ./config.json", - "clean-openapi": "find ../blocklist-api ! -path '../blocklist-api/src/main.rs' ! -path '../blocklist-api/Cargo.toml' -mindepth 1 -delete", - "build": "pnpm build-openapi", - "clean": "pnpm clean-openapi" - }, - "devDependencies": { - "@openapitools/openapi-generator-cli": "^2.13.2" - } -} diff --git a/.generated-sources/emily/openapi/package.json b/.generated-sources/emily/openapi/package.json deleted file mode 100644 index baaa89dd6..000000000 --- a/.generated-sources/emily/openapi/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "emily-api", - "scripts": { - "build-testing-api-rust": "openapi-generator-cli generate -i ./generated-specs/testing-emily-openapi-spec.json -g rust -o ../client/rust/testing/ --config ./api-config/testing.json", - "build-private-api-rust": "openapi-generator-cli generate -i ./generated-specs/private-emily-openapi-spec.json -g rust -o ../client/rust/private/ --config ./api-config/private.json", - "build-public-api-rust": "openapi-generator-cli generate -i ./generated-specs/public-emily-openapi-spec.json -g rust -o ../client/rust/public/ --config ./api-config/public.json", - "clean-rust": "find ../client/rust ! -path '../client/rust/*/src/main.rs' ! -path '../client/rust/*/Cargo.toml' -mindepth 1 -delete", - "build": "pnpm build-testing-api-rust && pnpm build-public-api-rust && pnpm build-private-api-rust" - }, - "devDependencies": { - "@openapitools/openapi-generator-cli": "^2.13.2" - } -} diff --git a/.github/workflows/buf-ci.yaml b/.github/workflows/buf-ci.yaml deleted file mode 100644 index b77a09ad7..000000000 --- a/.github/workflows/buf-ci.yaml +++ /dev/null @@ -1,31 +0,0 @@ -name: Buf CI -on: [push] - -concurrency: - # limit concurrency of entire workflow runs for a specific branch - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - contents: read - -jobs: - buf: - name: Run protobuf lints - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2 - - uses: bufbuild/buf-action@3fb70352251376e958c4c2c92c3818de82a71c2b #v1.0.2 - with: - version: 1.42.0 - setup_only: true - - - name: Check for lints - run: | - cd protobufs - buf lint - - - name: Check the format - run: | - cd protobufs - buf format --diff --exit-code diff --git a/.github/workflows/contract-tests.yaml b/.github/workflows/contract-tests.yaml deleted file mode 100644 index 3496f7ff1..000000000 --- a/.github/workflows/contract-tests.yaml +++ /dev/null @@ -1,49 +0,0 @@ -name: Contract tests -on: [push] - -concurrency: - # limit concurrency of entire workflow runs for a specific branch - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - contents: write - -jobs: - contract_tests: - name: Contract tests - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2 - - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 #v4.0 - - - name: Set Node Version - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af #v4.1.0 - with: - node-version: 22.1.0 - cache: "pnpm" - - name: Install dependencies - run: pnpm install - working-directory: ./contracts - - name: Type checks - run: pnpm typecheck - working-directory: ./contracts - - name: Tests - run: pnpm test - working-directory: ./contracts - - name: Lint - run: pnpm lint - working-directory: ./contracts - - name: Generate contract docs and types - run: pnpm build - working-directory: ./contracts - - name: Ensure git is clean - id: gitStatus - run: git diff --no-ext-diff --exit-code - continue-on-error: true - - name: Error message if git is dirty - if: steps.gitStatus.outcome == 'failure' - run: | - echo "::error::Git is dirty. Make sure you ran \`make build\` before pushing." - exit 1 diff --git a/.github/workflows/on-push.yaml b/.github/workflows/on-push.yaml new file mode 100644 index 000000000..437659c7b --- /dev/null +++ b/.github/workflows/on-push.yaml @@ -0,0 +1,239 @@ +name: On Push +on: [push] + +permissions: read-all + +concurrency: + # limit concurrency of entire workflow runs for a specific branch + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +env: + NODE_VERSION: 22.1.0 + BUF_VERSION: 1.42.0 + PYTHON_VERSION: 3.13 + NEXTEST_VERSION: 0.9.88 + CARGO_INCREMENTAL: 0 + CARGO_PROFILE_DEV_STRIP: "debuginfo" + +jobs: + + # Runs various lints and checks for the project, including Rustfmt, Clippy, + # Protobuf lints, and pnpm lints. + lint: + name: Run Lints + runs-on: ubuntu-24.04 + steps: + - uses: rui314/setup-mold@f80524ca6eeaa76759b57fb78ddce5d87a20c720 #v1 + with: + make-default: true + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2 + - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 #v4.0 + - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af #v4.1.0 + with: + node-version: ${{ env.NODE_VERSION }} + cache: "pnpm" + - uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b #v3.0.0 + with: + version: "25.3" + - uses: bufbuild/buf-action@3fb70352251376e958c4c2c92c3818de82a71c2b #v1.0.2 + with: + version: ${{ env.BUF_VERSION }} + setup_only: true + - uses: actions-rust-lang/setup-rust-toolchain@11df97af8e8102fd60b60a77dfbf58d40cd843b8 #v1.10.1 + with: + components: clippy, rustfmt + cache-key: "rust-tests" + - name: Install Package Dependencies + run: make install + - name: Lint (Rustfmt) + run: cargo fmt --all -- --check + - name: Lint (Clippy) + run: cargo clippy -- -D warnings + - name: Lint (pnpm) + run: pnpm --recursive run lint + - name: Lint (Protobuf) + run: | + buf format --diff --exit-code + buf lint + working-directory: ./protobufs + - name: Typecheck (pnpm) + run: pnpm --recursive typecheck + + # Builds the Rust test artifacts for the project, packages them as Nextest + # archives and uploads them as artifacts. This job is used as a dependency for + # the `unit-tests` and `integration-tests` jobs. + build-tests: + name: Build Test Artifacts + runs-on: ubuntu-24.04 + steps: + - uses: rui314/setup-mold@f80524ca6eeaa76759b57fb78ddce5d87a20c720 #v1 + with: + make-default: true + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2 + - uses: actions-rust-lang/setup-rust-toolchain@11df97af8e8102fd60b60a77dfbf58d40cd843b8 #v1.10.1 + with: + cache-key: "rust-tests" + - uses: taiki-e/install-action@da41fb311fbbcecf899732e575aaeaa2fe65c934 #v2.47.21 + with: + tool: nextest@${{ env.NEXTEST_VERSION }} + - name: Build Tests + run: make test-build + - name: Create Nextest Archives + run: make nextest-archive + - name: Upload Nextest Archives + uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 #v4.6.0 + with: + name: nextest-archives + path: ./target/nextest/*.tar.zst + + # Runs the unit tests for the project (Rust + pnpm). It depends on the + # `build-tests` job to build the Nextest test archives and upload them as + # artifacts. Note that since we are using nextest archives, we do not need + # Rust to be installed in this job. + unit-tests: + name: Run Unit Tests + runs-on: ubuntu-24.04 + needs: build-tests + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2 + - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 #v4.0 + - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af #v4.1.0 + with: + node-version: ${{ env.NODE_VERSION }} + cache: "pnpm" + - uses: taiki-e/install-action@da41fb311fbbcecf899732e575aaeaa2fe65c934 #v2.47.21 + with: + tool: nextest@${{ env.NEXTEST_VERSION }} + - name: Install Package Dependencies + run: make install + - name: Download Nextest Archives + uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 #v4.1.8 + with: + name: nextest-archives + path: . + - name: Run Unit Tests (Node) + run: pnpm --recursive test + - name: Run Unit Tests (Rust) + run: cargo-nextest nextest --color always run --no-fail-fast --archive-file nextest-archive.tar.zst + + # Runs the Rust integration tests for the project. It depends on the + # `build-tests` job to build the nextest test archives and upload them as + # artifacts, however we do not define an explicit dependency with `needs`. + # This is because in this job, we also need to get the integration environment + # running, which generally takes around a minute. So, we start this job + # immediately and once the environment is running we use the `wait-other-jobs` + # action to wait until the `build-tests` job is complete and the artifacts are + # available. This lets us start the environment while the tests are building, + # and then run the tests as soon as the artifacts are available. + integration-tests: + name: Run Integration Tests + runs-on: ubuntu-24.04 + strategy: + matrix: + partition: [1, 2] + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2 + - uses: actions-rust-lang/setup-rust-toolchain@11df97af8e8102fd60b60a77dfbf58d40cd843b8 #v1.10.1 + with: + cache-key: "rust-tests" + - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 #v4.0 + - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af #v4.1.0 + with: + node-version: ${{ env.NODE_VERSION }} + cache: "pnpm" + - uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b #v3.0.0 + with: + version: "25.3" + - uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b #v5.3.0 + with: + python-version: ${{ env.PYTHON_VERSION }} + - run: pip install boto3 + - uses: taiki-e/install-action@da41fb311fbbcecf899732e575aaeaa2fe65c934 #v2.47.21 + with: + tool: nextest@${{ env.NEXTEST_VERSION }} + - name: Install Package Dependencies + run: make install + - name: Start Integration Test Environment + run: make integration-env-up-ci + - name: Wait for Test Artifacts + uses: kachick/wait-other-jobs@0584f1460011b97726c04abf4bbec5bfb5cdb654 #v3.6.0 + timeout-minutes: 5 + with: + retry-method: 'equal_intervals' + wait-seconds-before-first-polling: 1 + min-interval-seconds: 5 + wait-list: | + [ + { + "workflowFile": "on-push.yaml", + "jobName": "Build Test Artifacts", + "optional": false, + "startupGracePeriod": { + "minutes": 5 + } + } + ] + - name: Download Nextest Archives + uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 #v4.1.8 + with: + name: nextest-archives + path: . + - name: Run Integration Tests (Rust) + run: cargo-nextest nextest --color always run --no-fail-fast --test-threads 1 --partition hash:${{ matrix.partition }}/2 --archive-file nextest-archive-serial.tar.zst + + # Runs checks on the generated code in the project for contracts, the + # blocklist client and the emily clients. This job is used to ensure that the + # generated code is up-to-date with the latest changes in the project. It does + # this by re-generating the code and then checking if the git status is clean + # (the generated code should exactly match the committed code). If the git + # status is dirty for any of the components, it fails the job and prints an + # error message. + check-generated-code: + name: Run Generated Code Checks + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2 + - uses: actions-rust-lang/setup-rust-toolchain@11df97af8e8102fd60b60a77dfbf58d40cd843b8 #v1.10.1 + with: + cache-key: "rust-tests" + - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 #v4.0 + - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af #v4.1.0 + with: + node-version: ${{ env.NODE_VERSION }} + cache: "pnpm" + - name: Install Package Dependencies + run: pnpm --recursive install + - name: Generate Contract Docs and Types + run: make contracts + - name: Ensure Git is Clean (Contracts) + id: git-status-contracts + run: git diff --no-ext-diff --exit-code + continue-on-error: true + - name: Git is Dirty (Contracts) + if: steps.git-status-contracts.outcome == 'failure' + run: | + echo "::error title=Contracts are dirty:: Make sure you ran 'make contracts' before pushing." + exit 1 + - name: Generate Blocklist Client + run: make blocklist-client-codegen + - name: Ensure Git is Clean (Blocklist Client) + id: git-status-blocklist-client + run: git diff --no-ext-diff --exit-code + continue-on-error: true + - name: Git is Dirty (Blocklist Client) + if: steps.git-status-blocklist-client.outcome == 'failure' + run: | + echo "::error title=Blocklist client is dirty:: Make sure you ran 'make blocklist-client-codegen' before pushing." + exit 1 + - name: Generate Emily Clients + run: make emily-client-codegen + - name: Ensure Git is Clean (Emily Clients) + id: git-status-emily-clients + run: git diff --no-ext-diff --exit-code + continue-on-error: true + - name: Git is Dirty (Emily Clients) + if: steps.git-status-emily-clients.outcome == 'failure' + run: | + echo "::error title=Emily clients are dirty:: Make sure you ran 'make emily-client-codegen' before pushing." + exit 1 diff --git a/.github/workflows/unit-tests.yaml b/.github/workflows/unit-tests.yaml deleted file mode 100644 index 7811f09c8..000000000 --- a/.github/workflows/unit-tests.yaml +++ /dev/null @@ -1,64 +0,0 @@ -name: Rust and Clarity Tests -on: [push] - -concurrency: - # limit concurrency of entire workflow runs for a specific branch - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -permissions: - contents: read - actions: write - -jobs: - tests: - name: Run Unit Tests - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2 - - - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 #v4.0 - - - name: Set Node Version - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af #v4.1.0 - with: - node-version: 22.1.0 - cache: "pnpm" - - - uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b #v3.0 - with: - version: "25.3" - - - name: Setup rust toolchain - run: rustup show - - - uses: Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 #v2.7.7 - - - uses: taiki-e/install-action@da41fb311fbbcecf899732e575aaeaa2fe65c934 #v2.47.21 - with: - tool: nextest@0.9.82 - - - name: Install package dependencies. - run: make install - - - name: Run lints - run: make lint - - - name: Run tests - run: make test-ci - - - name: Docker test service setup - run: make integration-env-up-ci - - - name: Run integration tests - run: make integration-test-ci - - - name: Docker compose down - if: always() - run: make integration-env-down-ci - - - name: Upload integration test logs - uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 #v4.6.0 - if: always() - with: - path: ./target/emily-server.log diff --git a/Cargo.lock b/Cargo.lock index 2aa491949..49caf7993 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -160,20 +160,20 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.87", ] [[package]] -name = "arrayref" -version = "0.3.8" +name = "arraydeque" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d151e35f61089500b617991b791fc8bfd237ae50cd5950803758a179b41e67a" +checksum = "7d902e3d592a523def97af8f317b08ce16b7ab854c1985a0c671e6f15cebc236" [[package]] -name = "arrayvec" -version = "0.5.2" +name = "arrayref" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" +checksum = "9d151e35f61089500b617991b791fc8bfd237ae50cd5950803758a179b41e67a" [[package]] name = "arrayvec" @@ -190,10 +190,10 @@ dependencies = [ "asn1-rs-derive", "asn1-rs-impl", "displaydoc", - "nom 7.1.3", - "num-traits 0.2.19", + "nom", + "num-traits", "rusticata-macros", - "thiserror", + "thiserror 1.0.61", "time 0.3.36", ] @@ -205,7 +205,7 @@ checksum = "965c2d33e53cb6b267e148a4cb0760bc01f4904c1cd4bb4002a085bb016d1490" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.87", "synstructure", ] @@ -217,7 +217,7 @@ checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.87", ] [[package]] @@ -233,7 +233,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4259cbe96513d2f1073027a259fc2ca917feb3026a5a8d984e3628e490255cc0" dependencies = [ "extend", - "serde 1.0.203", + "serde", "serde_json", ] @@ -243,7 +243,7 @@ version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "47e4f2b81832e72834d7518d8487a0396a28cc408186a2e8854c0f98011faf12" dependencies = [ - "serde 1.0.203", + "serde", "serde_json", ] @@ -296,7 +296,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.87", ] [[package]] @@ -307,7 +307,7 @@ checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.87", ] [[package]] @@ -320,7 +320,7 @@ dependencies = [ "mio 0.6.23", "once_cell", "slab", - "thiserror", + "thiserror 1.0.61", "zmq", ] @@ -343,7 +343,7 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f28d99ec8bfea296261ca1af174f24225171fea9664ba9003cbebee704810528" dependencies = [ - "num-traits 0.2.19", + "num-traits", ] [[package]] @@ -662,7 +662,7 @@ dependencies = [ "pin-project-lite", "pin-utils", "ryu", - "serde 1.0.203", + "serde", "time 0.3.36", "tokio", "tokio-util", @@ -704,7 +704,7 @@ dependencies = [ "http-body 0.4.6", "http-serde", "query_map", - "serde 1.0.203", + "serde", "serde_derive", "serde_json", ] @@ -730,7 +730,7 @@ dependencies = [ "percent-encoding", "pin-project-lite", "rustversion", - "serde 1.0.203", + "serde", "sync_wrapper 0.1.2", "tower 0.4.13", "tower-layer", @@ -759,7 +759,7 @@ dependencies = [ "percent-encoding", "pin-project-lite", "rustversion", - "serde 1.0.203", + "serde", "serde_json", "serde_path_to_error", "sync_wrapper 1.0.1", @@ -930,7 +930,7 @@ dependencies = [ "hex-conservative", "hex_lit", "secp256k1 0.29.0", - "serde 1.0.203", + "serde", ] [[package]] @@ -939,7 +939,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "30bdbe14aa07b06e6cfeffc529a1f099e5fbe249524f8125358604df99a4bed2" dependencies = [ - "serde 1.0.203", + "serde", ] [[package]] @@ -955,7 +955,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb54da0b28892f3c52203a7191534033e051b6f4b52bc15480681b57b7e036f5" dependencies = [ "bitcoin-internals", - "serde 1.0.203", + "serde", ] [[package]] @@ -966,7 +966,7 @@ checksum = "bb18c03d0db0247e147a21a6faafd5a7eb851c743db062de72018b6b7e8e4d16" dependencies = [ "bitcoin-io", "hex-conservative", - "serde 1.0.203", + "serde", ] [[package]] @@ -978,7 +978,7 @@ dependencies = [ "bitcoincore-rpc-json", "jsonrpc", "log", - "serde 1.0.203", + "serde", "serde_json", ] @@ -989,7 +989,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d8909583c5fab98508e80ef73e5592a651c954993dc6b7739963257d19f0e71a" dependencies = [ "bitcoin", - "serde 1.0.203", + "serde", "serde_json", ] @@ -1018,7 +1018,7 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" dependencies = [ - "serde 1.0.203", + "serde", ] [[package]] @@ -1029,7 +1029,7 @@ checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" dependencies = [ "funty", "radium", - "serde 1.0.203", + "serde", "tap", "wyz", ] @@ -1066,7 +1066,7 @@ name = "blocklist-api" version = "1.0.0" dependencies = [ "reqwest 0.12.4", - "serde 1.0.203", + "serde", "serde_json", "serde_with", "url", @@ -1078,12 +1078,12 @@ name = "blocklist-client" version = "0.0.1" dependencies = [ "clap", - "config 0.11.0", + "config", "mockito 0.28.0", "reqwest 0.11.27", - "serde 1.0.203", + "serde", "serde_json", - "thiserror", + "thiserror 1.0.61", "tokio", "tracing", "tracing-attributes", @@ -1140,7 +1140,7 @@ version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" dependencies = [ - "serde 1.0.203", + "serde", ] [[package]] @@ -1170,7 +1170,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" dependencies = [ - "nom 7.1.3", + "nom", ] [[package]] @@ -1228,8 +1228,8 @@ dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", - "num-traits 0.2.19", - "serde 1.0.203", + "num-traits", + "serde", "wasm-bindgen", "windows-targets 0.52.5", ] @@ -1287,7 +1287,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.87", ] [[package]] @@ -1310,7 +1310,7 @@ dependencies = [ "rstest", "rstest_reuse", "rusqlite", - "serde 1.0.203", + "serde", "serde_derive", "serde_json", "serde_stacker", @@ -1357,38 +1357,21 @@ dependencies = [ [[package]] name = "config" -version = "0.11.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1b9d958c2b1368a663f05538fc1b5975adce1e19f435acceae987aceeeb369" -dependencies = [ - "lazy_static", - "nom 5.1.3", - "rust-ini 0.13.0", - "serde 1.0.203", - "serde-hjson", - "serde_json", - "toml 0.5.11", - "yaml-rust", -] - -[[package]] -name = "config" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7328b20597b53c2454f0b1919720c25c7339051c02b72b7e05409e00b14132be" +checksum = "68578f196d2a33ff61b27fae256c3164f65e36382648e30666dde05b8cc9dfdf" dependencies = [ "async-trait", "convert_case", "json5", - "lazy_static", - "nom 7.1.3", + "nom", "pathdiff", "ron", - "rust-ini 0.19.0", - "serde 1.0.203", + "rust-ini", + "serde", "serde_json", - "toml 0.8.13", - "yaml-rust", + "toml", + "yaml-rust2", ] [[package]] @@ -1582,7 +1565,7 @@ dependencies = [ "byteorder", "digest 0.8.1", "rand_core 0.5.1", - "serde 1.0.203", + "serde", "subtle", "zeroize", ] @@ -1611,7 +1594,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.87", ] [[package]] @@ -1635,7 +1618,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.76", + "syn 2.0.87", ] [[package]] @@ -1646,7 +1629,7 @@ checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" dependencies = [ "darling_core", "quote", - "syn 2.0.76", + "syn 2.0.87", ] [[package]] @@ -1693,9 +1676,9 @@ checksum = "5cd0a5c643689626bec213c4d8bd4d96acc8ffdb4ad4bb6bc16abf27d5f4b553" dependencies = [ "asn1-rs", "displaydoc", - "nom 7.1.3", + "nom", "num-bigint", - "num-traits 0.2.19", + "num-traits", "rusticata-macros", ] @@ -1706,7 +1689,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" dependencies = [ "powerfmt", - "serde 1.0.203", + "serde", ] [[package]] @@ -1796,7 +1779,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.87", ] [[package]] @@ -1847,7 +1830,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.87", ] [[package]] @@ -1857,7 +1840,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" dependencies = [ "pkcs8", - "serde 1.0.203", + "serde", "signature", ] @@ -1870,7 +1853,7 @@ dependencies = [ "curve25519-dalek 4.1.3", "ed25519", "rand_core 0.6.4", - "serde 1.0.203", + "serde", "sha2 0.10.8", "subtle", "zeroize", @@ -1882,7 +1865,7 @@ version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" dependencies = [ - "serde 1.0.203", + "serde", ] [[package]] @@ -1890,7 +1873,7 @@ name = "emily-client" version = "0.1.0" dependencies = [ "reqwest 0.12.4", - "serde 1.0.203", + "serde", "serde_json", "serde_repr", "serde_with", @@ -1907,7 +1890,7 @@ dependencies = [ "base64 0.22.1", "bitcoin", "clap", - "config 0.11.0", + "config", "fake", "hex", "mockall 0.10.2", @@ -1916,13 +1899,13 @@ dependencies = [ "rand 0.8.5", "reqwest 0.11.27", "sbtc", - "serde 1.0.203", + "serde", "serde_dynamo", "serde_json", "stacks-common", "test-case", "testing-emily-client", - "thiserror", + "thiserror 1.0.61", "time 0.3.36", "tokio", "tracing", @@ -1960,7 +1943,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.87", ] [[package]] @@ -2089,7 +2072,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1267f4ac4f343772758f7b1bdcbe767c218bbab93bb432acbf5162bbf85a6c4" dependencies = [ - "num-traits 0.2.19", + "num-traits", ] [[package]] @@ -2253,7 +2236,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.87", ] [[package]] @@ -2421,12 +2404,6 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -[[package]] -name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" - [[package]] name = "hashbrown" version = "0.14.5" @@ -2435,7 +2412,7 @@ checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", "allocator-api2", - "serde 1.0.203", + "serde", ] [[package]] @@ -2449,6 +2426,15 @@ dependencies = [ "foldhash", ] +[[package]] +name = "hashlink" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" +dependencies = [ + "hashbrown 0.14.5", +] + [[package]] name = "hashlink" version = "0.9.1" @@ -2465,7 +2451,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "765c9198f173dd59ce26ff9f95ef0aafd0a0fe01fb9d72841bc5066a4c06511d" dependencies = [ "byteorder", - "num-traits 0.2.19", + "num-traits", ] [[package]] @@ -2528,7 +2514,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1aa273bf451e37ed35ced41c71a5e2a4e29064afb104158f2514bcd71c2c986" dependencies = [ - "arrayvec 0.7.4", + "arrayvec", ] [[package]] @@ -2561,7 +2547,7 @@ dependencies = [ "once_cell", "rand 0.8.5", "socket2", - "thiserror", + "thiserror 1.0.61", "tinyvec", "tokio", "tracing", @@ -2584,7 +2570,7 @@ dependencies = [ "rand 0.8.5", "resolv-conf", "smallvec", - "thiserror", + "thiserror 1.0.61", "tokio", "tracing", ] @@ -2711,7 +2697,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f560b665ad9f1572cfcaf034f7fb84338a7ce945216d64a90fd81f046a3caee" dependencies = [ "http 0.2.12", - "serde 1.0.203", + "serde", ] [[package]] @@ -2991,7 +2977,7 @@ checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", "hashbrown 0.12.3", - "serde 1.0.203", + "serde", ] [[package]] @@ -3002,7 +2988,7 @@ checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" dependencies = [ "equivalent", "hashbrown 0.15.2", - "serde 1.0.203", + "serde", ] [[package]] @@ -3029,7 +3015,7 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "276ec31bcb4a9ee45f58bec6f9ec700ae4cf4f4f8f2fa7e06cb406bd5ffdd770" dependencies = [ - "num-traits 0.2.19", + "num-traits", ] [[package]] @@ -3132,7 +3118,7 @@ checksum = "96b0db21af676c1ce64250b5f40f3ce2cf27e4e47cb91ed91eb6fe9350b430c1" dependencies = [ "pest", "pest_derive", - "serde 1.0.203", + "serde", ] [[package]] @@ -3143,7 +3129,7 @@ checksum = "3662a38d341d77efecb73caf01420cfa5aa63c0253fd7bc05289ef9f6616e1bf" dependencies = [ "base64 0.13.1", "minreq", - "serde 1.0.203", + "serde", "serde_json", ] @@ -3189,7 +3175,7 @@ dependencies = [ "http-body 0.4.6", "lambda_runtime", "query_map", - "serde 1.0.203", + "serde", "serde_json", "serde_urlencoded 0.7.1", ] @@ -3205,7 +3191,7 @@ dependencies = [ "http 0.2.12", "hyper 0.14.28", "lambda_runtime_api_client", - "serde 1.0.203", + "serde", "serde_json", "tokio", "tokio-stream", @@ -3237,19 +3223,6 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" -[[package]] -name = "lexical-core" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6607c62aa161d23d17a9072cc5da0be67cdfc89d3afb1e8d9c842bebc2525ffe" -dependencies = [ - "arrayvec 0.5.2", - "bitflags 1.3.2", - "cfg-if 1.0.0", - "ryu", - "static_assertions", -] - [[package]] name = "libc" version = "0.2.155" @@ -3300,7 +3273,7 @@ dependencies = [ "multiaddr", "pin-project", "rw-stream-sink", - "thiserror", + "thiserror 1.0.61", ] [[package]] @@ -3336,7 +3309,7 @@ dependencies = [ "quick-protobuf-codec", "rand 0.8.5", "rand_core 0.6.4", - "thiserror", + "thiserror 1.0.61", "tracing", "void", "web-time", @@ -3375,7 +3348,7 @@ dependencies = [ "rand 0.8.5", "rw-stream-sink", "smallvec", - "thiserror", + "thiserror 1.0.61", "tracing", "unsigned-varint 0.8.0", "void", @@ -3447,7 +3420,7 @@ dependencies = [ "quick-protobuf", "quick-protobuf-codec", "smallvec", - "thiserror", + "thiserror 1.0.61", "tracing", "void", ] @@ -3467,7 +3440,7 @@ dependencies = [ "quick-protobuf", "rand 0.8.5", "sha2 0.10.8", - "thiserror", + "thiserror 1.0.61", "tracing", "zeroize", ] @@ -3478,7 +3451,7 @@ version = "0.46.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced237d0bd84bbebb7c2cad4c073160dacb4fe40534963c32ed6d4c6bb7702a3" dependencies = [ - "arrayvec 0.7.4", + "arrayvec", "asynchronous-codec", "bytes", "either", @@ -3494,7 +3467,7 @@ dependencies = [ "rand 0.8.5", "sha2 0.10.8", "smallvec", - "thiserror", + "thiserror 1.0.61", "tracing", "uint", "void", @@ -3562,7 +3535,7 @@ dependencies = [ "sha2 0.10.8", "snow", "static_assertions", - "thiserror", + "thiserror 1.0.61", "tracing", "x25519-dalek", "zeroize", @@ -3605,7 +3578,7 @@ dependencies = [ "ring 0.17.8", "rustls 0.23.12", "socket2", - "thiserror", + "thiserror 1.0.61", "tokio", "tracing", ] @@ -3629,7 +3602,7 @@ dependencies = [ "quick-protobuf-codec", "rand 0.8.5", "static_assertions", - "thiserror", + "thiserror 1.0.61", "tracing", "void", "web-time", @@ -3688,7 +3661,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.87", ] [[package]] @@ -3722,7 +3695,7 @@ dependencies = [ "ring 0.17.8", "rustls 0.23.12", "rustls-webpki 0.101.7", - "thiserror", + "thiserror 1.0.61", "x509-parser", "yasna", ] @@ -3752,7 +3725,7 @@ dependencies = [ "either", "futures", "libp2p-core", - "thiserror", + "thiserror 1.0.61", "tracing", "yamux 0.12.1", "yamux 0.13.3", @@ -3782,7 +3755,7 @@ dependencies = [ "libsecp256k1-gen-ecmult", "libsecp256k1-gen-genmult", "rand 0.8.5", - "serde 1.0.203", + "serde", "sha2 0.9.9", "typenum", ] @@ -3834,7 +3807,7 @@ source = "git+https://github.com/stacks-network/stacks-core?rev=49777d3fd73a6dbb dependencies = [ "clarity", "secp256k1 0.24.3", - "serde 1.0.203", + "serde", "serde_derive", "serde_stacker", "sha2 0.10.8", @@ -3958,7 +3931,7 @@ dependencies = [ "metrics", "metrics-util", "quanta", - "thiserror", + "thiserror 1.0.61", "tokio", "tracing", ] @@ -4015,7 +3988,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fdef521c74c2884a4f3570bcdb6d2a77b3c533feb6b27ac2ae72673cc221c64" dependencies = [ "log", - "serde 1.0.203", + "serde", "serde_json", ] @@ -4113,7 +4086,7 @@ dependencies = [ "cfg-if 1.0.0", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.87", ] [[package]] @@ -4190,7 +4163,7 @@ dependencies = [ "multibase", "multihash", "percent-encoding", - "serde 1.0.203", + "serde", "static_assertions", "unsigned-varint 0.7.2", "url", @@ -4301,7 +4274,7 @@ dependencies = [ "anyhow", "byteorder", "paste", - "thiserror", + "thiserror 1.0.61", ] [[package]] @@ -4315,7 +4288,7 @@ dependencies = [ "log", "netlink-packet-core", "netlink-sys", - "thiserror", + "thiserror 1.0.61", "tokio", ] @@ -4362,17 +4335,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" -[[package]] -name = "nom" -version = "5.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08959a387a676302eebf4ddbcbc611da04285579f76f88ee0506c63b1a61dd4b" -dependencies = [ - "lexical-core", - "memchr", - "version_check", -] - [[package]] name = "nom" version = "7.1.3" @@ -4406,7 +4368,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" dependencies = [ "num-integer", - "num-traits 0.2.19", + "num-traits", ] [[package]] @@ -4421,16 +4383,7 @@ version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "num-traits 0.2.19", -] - -[[package]] -name = "num-traits" -version = "0.1.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" -dependencies = [ - "num-traits 0.2.19", + "num-traits", ] [[package]] @@ -4505,7 +4458,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.87", ] [[package]] @@ -4538,12 +4491,12 @@ dependencies = [ [[package]] name = "ordered-multimap" -version = "0.6.0" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ed8acf08e98e744e5384c8bc63ceb0364e68a6854187221c18df61c4797690e" +checksum = "49203cdcae0030493bad186b28da2fa25645fa276a51b6fec8010d281e02ef79" dependencies = [ "dlv-list", - "hashbrown 0.13.2", + "hashbrown 0.14.5", ] [[package]] @@ -4570,15 +4523,15 @@ dependencies = [ "cc", "hex", "itertools 0.10.5", - "num-traits 0.2.19", + "num-traits", "primitive-types", "proc-macro2", "quote", "rand_core 0.6.4", "rustfmt-wrapper", - "serde 1.0.203", + "serde", "sha2 0.10.8", - "syn 2.0.76", + "syn 2.0.87", ] [[package]] @@ -4587,12 +4540,12 @@ version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "306800abfa29c7f16596b5970a588435e3d5b3149683d00c12b699cc19f895ee" dependencies = [ - "arrayvec 0.7.4", + "arrayvec", "bitvec", "byte-slice-cast", "impl-trait-for-tuples", "parity-scale-codec-derive", - "serde 1.0.203", + "serde", ] [[package]] @@ -4644,9 +4597,9 @@ checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "pathdiff" -version = "0.2.1" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" +checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3" [[package]] name = "peeking_take_while" @@ -4661,7 +4614,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e459365e590736a54c3fa561947c84837534b8e9af6fc5bf781307e82658fae" dependencies = [ "base64 0.22.1", - "serde 1.0.203", + "serde", ] [[package]] @@ -4672,20 +4625,20 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.10" +version = "2.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "560131c633294438da9f7c4b08189194b20946c8274c6b9e38881a7874dc8ee8" +checksum = "8b7cafe60d6cf8e62e1b9b2ea516a089c008945bb5a275416789e7db0bc199dc" dependencies = [ "memchr", - "thiserror", + "thiserror 2.0.11", "ucd-trie", ] [[package]] name = "pest_derive" -version = "2.7.10" +version = "2.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26293c9193fbca7b1a3bf9b79dc1e388e927e6cacaa78b4a3ab705a1d3d41459" +checksum = "816518421cfc6887a0d62bf441b6ffb4536fcc926395a69e1a85852d4363f57e" dependencies = [ "pest", "pest_generator", @@ -4693,22 +4646,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.10" +version = "2.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ec22af7d3fb470a85dd2ca96b7c577a1eb4ef6f1683a9fe9a8c16e136c04687" +checksum = "7d1396fd3a870fc7838768d171b4616d5c91f6cc25e377b673d714567d99377b" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.87", ] [[package]] name = "pest_meta" -version = "2.7.10" +version = "2.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a240022f37c361ec1878d646fc5b7d7c4d28d5946e1a80ad5a7a4f4ca0bdcd" +checksum = "e1e58089ea25d717bfd31fb534e4f3afcc2cc569c70de3e239778991ea3b7dea" dependencies = [ "once_cell", "pest", @@ -4742,7 +4695,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.87", ] [[package]] @@ -4805,8 +4758,8 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "27abb6e4638dcecc65a92b50d7f1d87dd6dea987ba71db987b6bf881f4877e9d" dependencies = [ - "num-traits 0.2.19", - "serde 1.0.203", + "num-traits", + "serde", ] [[package]] @@ -4895,7 +4848,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" dependencies = [ "proc-macro2", - "syn 2.0.76", + "syn 2.0.87", ] [[package]] @@ -4914,7 +4867,7 @@ name = "private-emily-client" version = "0.1.0" dependencies = [ "reqwest 0.12.4", - "serde 1.0.203", + "serde", "serde_json", "serde_repr", "serde_with", @@ -4990,7 +4943,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.87", ] [[package]] @@ -5020,7 +4973,7 @@ dependencies = [ "prost", "prost-types", "regex", - "syn 2.0.76", + "syn 2.0.87", "tempfile", ] @@ -5034,7 +4987,7 @@ dependencies = [ "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.87", ] [[package]] @@ -5077,7 +5030,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe3212d819cbdcce67f786cdaf3fe0c2e9d09a6dcd9c9367a1bd344135b8c809" dependencies = [ "form_urlencoded", - "serde 1.0.203", + "serde", "serde_derive", ] @@ -5105,7 +5058,7 @@ dependencies = [ "asynchronous-codec", "bytes", "quick-protobuf", - "thiserror", + "thiserror 1.0.61", "unsigned-varint 0.8.0", ] @@ -5123,7 +5076,7 @@ dependencies = [ "rustc-hash 2.0.0", "rustls 0.23.12", "socket2", - "thiserror", + "thiserror 1.0.61", "tokio", "tracing", ] @@ -5140,7 +5093,7 @@ dependencies = [ "rustc-hash 2.0.0", "rustls 0.23.12", "slab", - "thiserror", + "thiserror 1.0.61", "tinyvec", "tracing", ] @@ -5311,7 +5264,7 @@ checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" dependencies = [ "getrandom 0.2.15", "libredox", - "thiserror", + "thiserror 1.0.61", ] [[package]] @@ -5389,7 +5342,7 @@ dependencies = [ "percent-encoding", "pin-project-lite", "rustls-pemfile 1.0.4", - "serde 1.0.203", + "serde", "serde_json", "serde_urlencoded 0.7.1", "sync_wrapper 0.1.2", @@ -5432,7 +5385,7 @@ dependencies = [ "percent-encoding", "pin-project-lite", "rustls-pemfile 2.1.2", - "serde 1.0.203", + "serde", "serde_json", "serde_urlencoded 0.7.1", "sync_wrapper 0.1.2", @@ -5504,7 +5457,7 @@ checksum = "b91f7eff05f748767f183df4320a63d6936e9c6107d97c9e6bdd9784f4289c94" dependencies = [ "base64 0.21.7", "bitflags 2.5.0", - "serde 1.0.203", + "serde", "serde_derive", ] @@ -5557,7 +5510,7 @@ dependencies = [ "netlink-packet-route", "netlink-proto", "nix 0.24.3", - "thiserror", + "thiserror 1.0.61", "tokio", ] @@ -5570,7 +5523,7 @@ dependencies = [ "bitflags 2.5.0", "fallible-iterator", "fallible-streaming-iterator", - "hashlink", + "hashlink 0.9.1", "libsqlite3-sys", "serde_json", "smallvec", @@ -5578,15 +5531,9 @@ dependencies = [ [[package]] name = "rust-ini" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e52c148ef37f8c375d49d5a73aa70713125b7f19095948a923f80afdeb22ec2" - -[[package]] -name = "rust-ini" -version = "0.19.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e2a3bcec1f113553ef1c88aae6c020a369d03d55b58de9869a0908930385091" +checksum = "3e0698206bcb8882bf2a9ecb4c1e7785db57ff052297085a6efd4fe42302068a" dependencies = [ "cfg-if 1.0.0", "ordered-multimap", @@ -5640,10 +5587,10 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1adc9dfed5cc999077978cc7163b9282c5751c8d39827c4ea8c8c220ca5a440" dependencies = [ - "serde 1.0.203", + "serde", "tempfile", - "thiserror", - "toml 0.8.13", + "thiserror 1.0.61", + "toml", "toolchain_find", ] @@ -5653,7 +5600,7 @@ version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "faf0c4a6ece9950b9abdb62b1cfcf2a68b3b67a10ba445b3bb85be2a293d0632" dependencies = [ - "nom 7.1.3", + "nom", ] [[package]] @@ -5796,12 +5743,12 @@ dependencies = [ "hex", "rand 0.8.5", "secp256k1 0.29.0", - "serde 1.0.203", + "serde", "serde_json", "stacks-common", "stackslib", "test-case", - "thiserror", + "thiserror 1.0.61", ] [[package]] @@ -5842,7 +5789,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6b1629c9c557ef9b293568b338dddfc8208c98a18c59d722a9d53f859d9c9b62" dependencies = [ "secp256k1-sys 0.6.1", - "serde 1.0.203", + "serde", ] [[package]] @@ -5854,7 +5801,7 @@ dependencies = [ "bitcoin_hashes", "rand 0.8.5", "secp256k1-sys 0.10.0", - "serde 1.0.203", + "serde", ] [[package]] @@ -5919,12 +5866,6 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" -[[package]] -name = "serde" -version = "0.8.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dad3f759919b92c3068c696c15c3d17238234498bbdcc80f2c469606f948ac8" - [[package]] name = "serde" version = "1.0.203" @@ -5934,25 +5875,13 @@ dependencies = [ "serde_derive", ] -[[package]] -name = "serde-hjson" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a3a4e0ea8a88553209f6cc6cfe8724ecad22e1acf372793c27d995290fe74f8" -dependencies = [ - "lazy_static", - "num-traits 0.1.43", - "regex", - "serde 0.8.23", -] - [[package]] name = "serde_bytes" version = "0.11.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" dependencies = [ - "serde 1.0.203", + "serde", ] [[package]] @@ -5963,7 +5892,7 @@ checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.87", ] [[package]] @@ -5974,7 +5903,7 @@ checksum = "e36c1b1792cfd9de29eb373ee6a4b74650369c096f55db7198ceb7b8921d1f7f" dependencies = [ "aws-sdk-dynamodb", "base64 0.21.7", - "serde 1.0.203", + "serde", ] [[package]] @@ -5985,7 +5914,7 @@ checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" dependencies = [ "itoa 1.0.11", "ryu", - "serde 1.0.203", + "serde", ] [[package]] @@ -5995,7 +5924,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" dependencies = [ "itoa 1.0.11", - "serde 1.0.203", + "serde", ] [[package]] @@ -6006,7 +5935,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.87", ] [[package]] @@ -6015,7 +5944,7 @@ version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" dependencies = [ - "serde 1.0.203", + "serde", ] [[package]] @@ -6024,7 +5953,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "babfccff5773ff80657f0ecf553c7c516bdc2eb16389c0918b36b73e7015276e" dependencies = [ - "serde 1.0.203", + "serde", "stacker", ] @@ -6036,7 +5965,7 @@ checksum = "9ec5d77e2d4c73717816afac02670d5c4f534ea95ed430442cad02e7a6e32c97" dependencies = [ "dtoa 0.4.8", "itoa 0.4.8", - "serde 1.0.203", + "serde", "url", ] @@ -6049,7 +5978,7 @@ dependencies = [ "form_urlencoded", "itoa 1.0.11", "ryu", - "serde 1.0.203", + "serde", ] [[package]] @@ -6063,7 +5992,7 @@ dependencies = [ "hex", "indexmap 1.9.3", "indexmap 2.7.0", - "serde 1.0.203", + "serde", "serde_derive", "serde_json", "serde_with_macros", @@ -6079,7 +6008,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.87", ] [[package]] @@ -6201,7 +6130,7 @@ dependencies = [ "cfg-if 1.0.0", "clap", "clarity", - "config 0.14.0", + "config", "emily-client", "fake", "futures", @@ -6223,7 +6152,7 @@ dependencies = [ "ripemd", "sbtc", "secp256k1 0.29.0", - "serde 1.0.203", + "serde", "serde_bytes", "serde_json", "sha2 0.10.8", @@ -6234,7 +6163,7 @@ dependencies = [ "tempfile", "test-case", "test-log", - "thiserror", + "thiserror 1.0.61", "time 0.3.36", "tokio", "tokio-stream", @@ -6302,7 +6231,7 @@ version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" dependencies = [ - "serde 1.0.203", + "serde", ] [[package]] @@ -6361,7 +6290,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce81b7bd7c4493975347ef60d8c7e8b742d4694f4c49f93e0a12ea263938176c" dependencies = [ "itertools 0.12.1", - "nom 7.1.3", + "nom", "unicode_categories", ] @@ -6395,7 +6324,7 @@ dependencies = [ "futures-io", "futures-util", "hashbrown 0.14.5", - "hashlink", + "hashlink 0.9.1", "hex", "indexmap 2.7.0", "log", @@ -6405,12 +6334,12 @@ dependencies = [ "percent-encoding", "rustls 0.23.12", "rustls-pemfile 2.1.2", - "serde 1.0.203", + "serde", "serde_json", "sha2 0.10.8", "smallvec", "sqlformat", - "thiserror", + "thiserror 1.0.61", "tokio", "tokio-stream", "tracing", @@ -6428,7 +6357,7 @@ dependencies = [ "quote", "sqlx-core", "sqlx-macros-core", - "syn 2.0.76", + "syn 2.0.87", ] [[package]] @@ -6444,12 +6373,12 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "serde 1.0.203", + "serde", "serde_json", "sha2 0.10.8", "sqlx-core", "sqlx-postgres", - "syn 2.0.76", + "syn 2.0.87", "tempfile", "tokio", "url", @@ -6482,13 +6411,13 @@ dependencies = [ "memchr", "once_cell", "rand 0.8.5", - "serde 1.0.203", + "serde", "serde_json", "sha2 0.10.8", "smallvec", "sqlx-core", "stringprep", - "thiserror", + "thiserror 1.0.61", "tracing", "whoami", ] @@ -6523,7 +6452,7 @@ dependencies = [ "ripemd", "rusqlite", "secp256k1 0.24.3", - "serde 1.0.203", + "serde", "serde_derive", "serde_json", "serde_stacker", @@ -6560,7 +6489,7 @@ dependencies = [ "ripemd", "rusqlite", "secp256k1 0.24.3", - "serde 1.0.203", + "serde", "serde_derive", "serde_json", "serde_stacker", @@ -6613,7 +6542,7 @@ checksum = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef" dependencies = [ "proc-macro2", "quote", - "serde 1.0.203", + "serde", "serde_derive", "syn 1.0.109", ] @@ -6627,7 +6556,7 @@ dependencies = [ "base-x", "proc-macro2", "quote", - "serde 1.0.203", + "serde", "serde_derive", "serde_json", "sha1 0.6.1", @@ -6676,7 +6605,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.76", + "syn 2.0.87", ] [[package]] @@ -6698,9 +6627,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.76" +version = "2.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578e081a14e0cefc3279b0472138c513f37b41a08d5a3cca9b6e4e8ceb6cd525" +checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" dependencies = [ "proc-macro2", "quote", @@ -6727,7 +6656,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.87", ] [[package]] @@ -6760,7 +6689,7 @@ dependencies = [ "cfg-expr", "heck 0.5.0", "pkg-config", - "toml 0.8.13", + "toml", "version-compare", ] @@ -6823,7 +6752,7 @@ dependencies = [ "cfg-if 1.0.0", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.87", ] [[package]] @@ -6834,7 +6763,7 @@ checksum = "5c89e72a01ed4c579669add59014b9a524d609c0c88c6a585ce37485879f6ffb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.87", "test-case-core", ] @@ -6856,7 +6785,7 @@ checksum = "5999e24eaa32083191ba4e425deb75cdf25efefabe5aaccb7446dd0d4122a3f5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.87", ] [[package]] @@ -6864,7 +6793,7 @@ name = "testing-emily-client" version = "0.1.0" dependencies = [ "reqwest 0.12.4", - "serde 1.0.203", + "serde", "serde_json", "serde_repr", "serde_with", @@ -6878,7 +6807,16 @@ version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.61", +] + +[[package]] +name = "thiserror" +version = "2.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc" +dependencies = [ + "thiserror-impl 2.0.11", ] [[package]] @@ -6889,7 +6827,18 @@ checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.87", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] @@ -6947,7 +6896,7 @@ dependencies = [ "itoa 1.0.11", "num-conv", "powerfmt", - "serde 1.0.203", + "serde", "time-core", "time-macros 0.2.18", ] @@ -7051,7 +7000,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.87", ] [[package]] @@ -7111,22 +7060,13 @@ dependencies = [ "tokio", ] -[[package]] -name = "toml" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" -dependencies = [ - "serde 1.0.203", -] - [[package]] name = "toml" version = "0.8.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4e43f8cc456c9704c851ae29c67e17ef65d2c30017c17a9765b89c382dc8bba" dependencies = [ - "serde 1.0.203", + "serde", "serde_spanned", "toml_datetime", "toml_edit 0.22.22", @@ -7138,7 +7078,7 @@ version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" dependencies = [ - "serde 1.0.203", + "serde", ] [[package]] @@ -7159,7 +7099,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ "indexmap 2.7.0", - "serde 1.0.203", + "serde", "serde_spanned", "toml_datetime", "winnow 0.6.20", @@ -7202,7 +7142,7 @@ dependencies = [ "proc-macro2", "prost-build", "quote", - "syn 2.0.76", + "syn 2.0.87", ] [[package]] @@ -7302,7 +7242,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.87", ] [[package]] @@ -7332,7 +7272,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" dependencies = [ - "serde 1.0.203", + "serde", "tracing-core", ] @@ -7346,7 +7286,7 @@ dependencies = [ "nu-ansi-term", "once_cell", "regex", - "serde 1.0.203", + "serde", "serde_json", "sharded-slab", "smallvec", @@ -7378,7 +7318,7 @@ dependencies = [ "log", "rand 0.8.5", "sha1 0.10.6", - "thiserror", + "thiserror 1.0.61", "url", "utf-8", ] @@ -7391,9 +7331,9 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "ucd-trie" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" [[package]] name = "uint" @@ -7439,9 +7379,9 @@ dependencies = [ [[package]] name = "unicode-segmentation" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" [[package]] name = "unicode_categories" @@ -7519,7 +7459,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c5afb1a60e207dca502682537fefcfd9921e71d0b83e9576060f09abc6efab23" dependencies = [ "indexmap 2.7.0", - "serde 1.0.203", + "serde", "serde_json", "utoipa-gen", ] @@ -7533,7 +7473,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.87", ] [[package]] @@ -7543,7 +7483,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" dependencies = [ "getrandom 0.2.15", - "serde 1.0.203", + "serde", ] [[package]] @@ -7620,7 +7560,7 @@ dependencies = [ "percent-encoding", "pin-project", "scoped-tls", - "serde 1.0.203", + "serde", "serde_json", "serde_urlencoded 0.7.1", "tokio", @@ -7639,7 +7579,7 @@ dependencies = [ "lambda_http", "mime", "once_cell", - "thiserror", + "thiserror 1.0.61", "tower 0.4.13", "tracing", "url", @@ -7685,7 +7625,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.87", "wasm-bindgen-shared", ] @@ -7719,7 +7659,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.87", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -8054,14 +7994,14 @@ dependencies = [ "bs58 0.5.1", "hashbrown 0.14.5", "hex", - "num-traits 0.2.19", + "num-traits", "p256k1", "polynomial", "primitive-types", "rand_core 0.6.4", - "serde 1.0.203", + "serde", "sha2 0.10.8", - "thiserror", + "thiserror 1.0.61", "tracing", "tracing-subscriber", ] @@ -8083,7 +8023,7 @@ checksum = "c7e468321c81fb07fa7f4c636c3972b9100f0346e5b6a9f2bd0603a52f7ed277" dependencies = [ "curve25519-dalek 4.1.3", "rand_core 0.6.4", - "serde 1.0.203", + "serde", "zeroize", ] @@ -8097,10 +8037,10 @@ dependencies = [ "data-encoding", "der-parser", "lazy_static", - "nom 7.1.3", + "nom", "oid-registry", "rusticata-macros", - "thiserror", + "thiserror 1.0.61", "time 0.3.36", ] @@ -8126,12 +8066,14 @@ dependencies = [ ] [[package]] -name = "yaml-rust" -version = "0.4.5" +name = "yaml-rust2" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" +checksum = "8902160c4e6f2fb145dbe9d6760a75e3c9522d8bf796ed7047c85919ac7115f8" dependencies = [ - "linked-hash-map", + "arraydeque", + "encoding_rs", + "hashlink 0.8.4", ] [[package]] @@ -8191,7 +8133,7 @@ checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.87", ] [[package]] @@ -8211,7 +8153,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.87", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 1a6302173..3303c3346 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,19 +3,21 @@ resolver = "2" members = [ "signer", "emily/handler", - ".generated-sources/emily/openapi", + "emily/openapi-gen", "blocklist-client", - ".generated-sources/blocklist-openapi-gen", + "blocklist-openapi-gen", "sbtc", ".generated-sources/emily/client/rust/public", ".generated-sources/emily/client/rust/private", ".generated-sources/emily/client/rust/testing", + ".generated-sources/blocklist-api" ] [profile.dev] # Disabling debug info speeds up builds a bunch, # and we don't rely on it for debugging that much. -debug = 0 +debug = false +split-debuginfo = "unpacked" [profile.release] lto = "thin" @@ -34,13 +36,14 @@ aws-sdk-dynamodb = { version = "1.36.0" } backoff = { version = "0.4.0", features = ["tokio"] } base64 = "0.22.1" bincode = "1.3.3" -bitcoin = { version = "0.32", features = ["serde"] } +bitcoin = { version = "0.32", features = ["serde", "rand-std"] } bitcoincore-rpc = { version = "0.19" } bitcoincore-rpc-json = { version = "0.19" } -bitvec = { version = "1.0", default-features = false, features = ["serde"] } +bitcoincore-zmq = { version = "1.5.2", features = ["async"] } +bitvec = { version = "1.0", default-features = false, features = ["serde", "std"] } clarity = { git = "https://github.com/stacks-network/stacks-core", rev = "49777d3fd73a6dbb610be80c376b7d9389c9871a" } clap = { version = "4.5.4", features = ["derive", "env"] } -config = "0.11.0" +config = "0.14.0" futures = "0.3.24" hashbrown = "0.14.5" http = "1.1.0" @@ -53,7 +56,7 @@ p256k1 = "7.2.0" prost = "0.12.5" rand = "0.8" reqwest = { version = "0.11", features = ["json"] } -serde = "1.0" +serde = { version = "1.0", features = ["derive"] } serde_bytes = "0.11" serde_dynamo = {version = "4.2", features = ["aws-sdk-dynamodb+1"] } serde_json = "1.0" @@ -63,10 +66,10 @@ stackslib = { git = "https://github.com/stacks-network/stacks-core", rev = "4977 stacks-common = { git = "https://github.com/stacks-network/stacks-core", rev = "49777d3fd73a6dbb610be80c376b7d9389c9871a" } strum = { version = "0.26", features = ["derive"] } thiserror = "1.0" -time = "0.3.36" +time = { version = "0.3.36", features = ["serde"] } tonic = "0.11.0" tonic-build = "0.11.0" -tokio = "1.32.0" +tokio = { version = "1.32.0", default-features = false, features = ["signal", "macros", "rt-multi-thread", "rt"] } tokio-stream = {version = "0.1.15", features = ["sync"] } tracing = { version = "0.1", default-features = false } tracing-attributes = "0.1" @@ -74,12 +77,13 @@ url = "2.5" warp_lambda = "0.1.4" wsts = "9.2.0" hex = "0.4.3" -libp2p = { version = "0.54.1", features = [ +libp2p = { version = "0.54.1", default-features = false, features = [ "macros", "kad", "noise", "ping", "tcp", "tokio", "yamux", "mdns", "quic", "gossipsub", "relay", "identify", "tls", "dns", "autonat", "secp256k1" ] } +fake = { version = "2.9.2", features = ["derive", "time"] } [workspace.dependencies.axum] version = "0.7" diff --git a/Makefile b/Makefile index 8f03c88d0..87071b47e 100644 --- a/Makefile +++ b/Makefile @@ -1,83 +1,87 @@ -# Convenience data so we can run the following and include -# sources from three directories deep. -# -# Example: -# $(subst dir, emily/cdk/lib, $(THREE_DIRS_DEEP)) -# becomes -# emily/cdk/lib/* emily/cdk/lib/*/* emily/cdk/lib/*/*/* -# -# TODO(TBD): Find a better way to do this. -ONE_DIR_DEEP := dir/* -TWO_DIRS_DEEP := dir/* $(subst dir, dir/*, $(ONE_DIR_DEEP)) -THREE_DIRS_DEEP := dir/* $(subst dir, dir/*, $(TWO_DIRS_DEEP)) -FOUR_DIRS_DEEP := dir/* $(subst dir, dir/*, $(THREE_DIRS_DEEP)) -FIVE_DIRS_DEEP := dir/* $(subst dir, dir/*, $(FOUR_DIRS_DEEP)) +# The absolute path to the directory containing the Makefile. +WORKING_DIR := $(realpath $(shell dirname $(firstword $(MAKEFILE_LIST)))) # Common Folders. -AUTOGENERATED_SOURCES := ./.generated-sources - -# Blocklist Client Files -AUTOGENERATED_BLOCKLIST_CLIENT_CLIENT := $(AUTOGENERATED_SOURCES)/blocklist-api/src/lib.rs -BLOCKLIST_OPENAPI_PATH := $(AUTOGENERATED_SOURCES)/blocklist-openapi-gen -BLOCKLIST_OPENAPI_SPEC := $(BLOCKLIST_OPENAPI_PATH)/blocklist-client-openapi.json - -# Emily API Files -EMILY_OPENAPI_PATH := $(AUTOGENERATED_SOURCES)/emily/openapi -EMILY_OPENAPI_SPEC := $(EMILY_OPENAPI_PATH)/emily-openapi-spec.json -AUTOGENERATED_EMILY_CLIENT := $(AUTOGENERATED_SOURCES)/emily/client/rust/src/lib.rs -EMILY_LAMBDA_BINARY := target/lambda/emily-handler/bootstrap.zip -EMILY_CDK_TEMPLATE := emily/cdk/cdk.out/EmilyStack.template.json +AUTOGENERATED_SOURCES := .generated-sources # Don't use the install target here so you can rerun install without # Makefile complaints. export DATABASE_URL=postgres://user:password@localhost:5432/signer +# The package flags for cargo commands. +CARGO_FLAGS := --workspace --exclude emily-openapi-spec --exclude blocklist-openapi-gen + +# ############################################################################## +# MAIN TARGETS +# ############################################################################## + install: pnpm install -build: $(AUTOGENERATED_BLOCKLIST_CLIENT_CLIENT) $(AUTOGENERATED_EMILY_CLIENT) - cargo build ${CARGO_BUILD_ARGS} - pnpm --recursive build - # TODO(719): No need to do this once rustfmt 2.0.0 ships - # Format generated sources: - cargo fmt -p emily-openapi-spec -p emily-client -p blocklist-api -p blocklist-openapi-gen +build: blocklist-client-codegen emily-client-codegen contracts + cargo build --all-targets $(CARGO_FLAGS) ${CARGO_BUILD_ARGS} -test: $(AUTOGENERATED_BLOCKLIST_CLIENT_CLIENT) $(AUTOGENERATED_EMILY_CLIENT) - cargo test -- --test-threads=1 +test: + cargo nextest run --lib $(CARGO_FLAGS) --no-fail-fast ${CARGO_BUILD_ARGS} pnpm --recursive test -test-ci: $(AUTOGENERATED_BLOCKLIST_CLIENT_CLIENT) $(AUTOGENERATED_EMILY_CLIENT) - cargo nextest run --no-fail-fast - pnpm --recursive test +test-build: + cargo test build $(CARGO_FLAGS) --no-run --locked ${CARGO_BUILD_ARGS} lint: - cargo clippy -- -D warnings cargo fmt --all -- --check + cargo clippy -- -D warnings pnpm --recursive run lint -format: $(AUTOGENERATED_BLOCKLIST_CLIENT_CLIENT) $(AUTOGENERATED_EMILY_CLIENT) +format: cargo fmt +contracts: + pnpm --prefix contracts run build + clean: cargo clean pnpm --recursive clean -.PHONY: install build test lint format clean +.PHONY: install build test test-build lint format contracts clean -# Integration tests. -# ------------------------------------------------------------------------------ +# ############################################################################## +# NEXTEST +# ############################################################################## + +NEXTEST_ARCHIVE_FILE := target/nextest/nextest-archive.tar.zst +NEXTEST_SERIAL_ARCHIVE_FILE := target/nextest/nextest-archive-serial.tar.zst + +# Creates nextest archives +nextest-archive: + cargo nextest archive $(CARGO_FLAGS) --lib --archive-file $(NEXTEST_ARCHIVE_FILE) ${CARGO_BUILD_ARGS} + cargo nextest archive $(CARGO_FLAGS) --archive-file $(NEXTEST_SERIAL_ARCHIVE_FILE) --test integration ${CARGO_BUILD_ARGS} + +# Runs nextest archives +nextest-archive-run: + cargo nextest run --no-fail-fast --retries 2 --archive-file $(NEXTEST_ARCHIVE_FILE) + cargo nextest run --no-fail-fast --test-threads 1 --retries 2 --archive-file $(NEXTEST_SERIAL_ARCHIVE_FILE) + +nextest-archive-clean: + rm -f $(NEXTEST_ARCHIVE_FILE) $(NEXTEST_SERIAL_ARCHIVE_FILE) + +.PHONY: nextest-archive nextest-archive-run nextest-archive-clean -integration-env-up: - docker compose --file docker/docker-compose.test.yml up --detach +# ############################################################################## +# INTEGRATION TESTS +# ############################################################################## -integration-test: $(AUTOGENERATED_BLOCKLIST_CLIENT_CLIENT) $(AUTOGENERATED_EMILY_CLIENT) - cargo test --test integration --all-features --no-fail-fast -- --test-threads=1 +integration-env-up: emily-cdk-synth + docker compose --file docker/docker-compose.test.yml up -d -integration-test-ci: $(AUTOGENERATED_BLOCKLIST_CLIENT_CLIENT) $(AUTOGENERATED_EMILY_CLIENT) - cargo nextest run --test integration --all-features --no-fail-fast --test-threads=1 +integration-test: + cargo nextest run $(CARGO_FLAGS) --test integration --no-fail-fast --test-threads 1 + +integration-test-build: + cargo test build $(CARGO_FLAGS) --test integration --no-run --locked integration-env-down: - docker compose --file docker/docker-compose.test.yml down -v + docker compose --file docker/docker-compose.test.yml down -t 0 -v integration-env-build: docker compose --file docker/docker-compose.test.yml build @@ -86,51 +90,84 @@ integration-test-full: integration-env-down integration-env-up integration-test integration-env-up-ci: emily-cdk-synth docker compose --file docker/docker-compose.ci.yml up --detach --quiet-pull - @echo "Wait for aws resources to be set up..." - @while docker compose --file docker/docker-compose.ci.yml ps | grep -q 'emily-aws-setup'; do echo "waiting..." && sleep 1; done + DYNAMODB_ENDPOINT=http://localhost:8000 \ + INPUT_CDK_TEMPLATE=./emily/cdk/cdk.out/EmilyStack.template.json \ + OUTPUT_CDK_TEMPLATE=./emily/cdk/cdk.out/EmilyStack.devenv.template.json \ + LOCAL_LAMBDA_PATH=empty.zip \ + TRUSTED_REORG_API_KEY=testApiKey \ + python3 docker/sbtc/emily-aws-setup/initialize.py + cargo build --bin emily-server AWS_ACCESS_KEY_ID=xxxxxxxxxxxx \ - AWS_SECRET_ACCESS_KEY=xxxxxxxxxxxx \ - AWS_REGION=us-west-2 \ - TRUSTED_REORG_API_KEY=testApiKey \ - cargo run --bin emily-server -- \ - --host 127.0.0.1 --port 3031 --dynamodb-endpoint http://localhost:8000 > ./target/emily-server.log 2>&1 & + AWS_SECRET_ACCESS_KEY=xxxxxxxxxxxx \ + AWS_REGION=us-west-2 \ + TRUSTED_REORG_API_KEY=testApiKey \ + cargo run --bin emily-server -- \ + --host 127.0.0.1 --port 3031 --dynamodb-endpoint http://localhost:8000 > ./target/emily-server.log 2>&1 & integration-env-down-ci: docker compose --file docker/docker-compose.ci.yml down @echo "killing emily server process..." ps -ef | awk '/[e]mily-server/{print $$2}' | xargs kill -9 -.PHONY: integration-env-up integration-test integration-env-up integration-test-full +.PHONY: integration-env-up integration-test integration-test-build integration-env-up integration-test-full -# Emily API -# ---------------------------------------------------- +# ############################################################################## +# DEVENV (development testing environment) +# ############################################################################## -# Project Names -## Cargo crates -EMILY_HANDLER_PROJECT_NAME := emily-handler -EMILY_OPENAPI_SPEC_PROJECT_NAME := emily-openapi-spec -## Node projects -EMILY_CDK_PROJECT_NAME := emily-cdk +devenv-no-sbtc-up: + docker compose -f docker/docker-compose.yml --profile default --profile bitcoin-mempool up -d + +devenv-no-sbtc-down: + docker compose -f docker/docker-compose.yml --profile default --profile bitcoin-mempool down -t 0 -v + +devenv-up: + docker compose -f docker/docker-compose.yml --profile default --profile bitcoin-mempool --profile sbtc-signer up -d -# Emily CDK Template --------------------------------- +devenv-down: + docker compose -f docker/docker-compose.yml --profile default --profile bitcoin-mempool --profile sbtc-signer down -t 0 -v -EMILY_CDK_SOURCE_FILES := $(wildcard $(subst dir, emily/cdk/lib, $(FIVE_DIRS_DEEP))) -EMILY_CDK_SOURCE_FILES := $(wildcard $(subst dir, emily/bin/lib, $(FIVE_DIRS_DEEP))) $(EMILY_CDK_SOURCE_FILES) +devenv-sbtc-up: + docker compose -f docker/docker-compose.yml --profile sbtc-signer up --build -d -$(EMILY_CDK_TEMPLATE): $(INSTALL_TARGET) $(EMILY_CDK_SOURCE_FILES) +devenv-sbtc-down: + docker compose -f docker/docker-compose.yml --profile sbtc-signer down + +.PHONY: devenv-no-sbtc-up devenv-no-sbtc-down devenv-up devenv-down devenv-sbtc-up devenv-sbtc-down + +# ############################################################################## +# EMILY +# ############################################################################## + +# ------------------------------------------------------------------------------ +# - EMILY CDK TEMPLATE +# ------------------------------------------------------------------------------ + +# Variables +EMILY_CDK_TEMPLATE := emily/cdk/cdk.out/EmilyStack.template.json +EMILY_CDK_PROJECT_NAME := emily-cdk +EMILY_CDK_SOURCE_FILES := $(shell find emily/cdk/lib -type f) + +# Generates the CloudFormation template for the Emily CDK project if any of the +# source files are older than the template. +$(EMILY_CDK_TEMPLATE): $(EMILY_CDK_SOURCE_FILES) AWS_STAGE=local \ TABLES_ONLY=true \ TRUSTED_REORG_API_KEY=testApiKey \ pnpm --filter $(EMILY_CDK_PROJECT_NAME) run synth -# Emily Handler -------------------------------------- - -emily-as-lambda: $(EMILY_LAMBDA_BINARY) emily-cdk-synth: $(EMILY_CDK_TEMPLATE) -emily-openapi-spec: $(EMILY_OPENAPI_SPEC) -emily-client: $(AUTOGENERATED_EMILY_CLIENT) -.PHONY: emily-lambda emily-cdk-synth emily-openapi-spec emily-client +.PHONY: emily-cdk-synth + +# ------------------------------------------------------------------------------ +# - EMILY HANDLER +# ------------------------------------------------------------------------------ + +# Variables +EMILY_HANDLER_PROJECT_NAME := emily-handler +EMILY_HANDLER_SOURCE_FILES := $(shell find emily/handler -type f) +EMILY_LAMBDA_BINARY := target/lambda/emily-handler/bootstrap.zip # Build the zipped binary for the Emily Handler that AWS Lambda can deploy. # @@ -141,80 +178,92 @@ emily-client: $(AUTOGENERATED_EMILY_CLIENT) # # aarm64 machines can still create the x86_64 binary by running the following command, but # it will not be runnable using the SAM CLI on aarm64 machines. -EMILY_HANDLER_SOURCE_FILES := $(wildcard $(subst dir, emily/handler, $(FIVE_DIRS_DEEP))) $(EMILY_LAMBDA_BINARY): $(EMILY_HANDLER_SOURCE_FILES) cargo lambda build \ --release \ --package $(EMILY_HANDLER_PROJECT_NAME) \ --output-format zip -# Generate the client code using the OpenAPI spec -$(AUTOGENERATED_EMILY_CLIENT): $(INSTALL_TARGET) $(EMILY_OPENAPI_SPEC) - @echo "Building emily client from Openapi Spec" - pnpm --prefix $(EMILY_OPENAPI_PATH) run build +emily-as-lambda: $(EMILY_LAMBDA_BINARY) + +.PHONY: emily-as-lambda + +# ------------------------------------------------------------------------------ +# - EMILY CLIENT +# ------------------------------------------------------------------------------ + +# Variables +EMILY_OPENAPI_DIR := emily/openapi-gen +EMILY_OPENAPI_SPECS_DIR := $(EMILY_OPENAPI_DIR)/generated-specs +EMILY_OPENAPI_SPEC_PROJECT_NAME := emily-openapi-spec +EMILY_OPENAPI_SPEC_PATHS := $(shell find $(EMILY_OPENAPI_SPECS_DIR) -type f -name '*.json') +EMILY_OPENAPI_SOURCE_FILES := $(shell find $(EMILY_OPENAPI_DIR) -type f -not -path '$(EMILY_OPENAPI_SPECS_DIR)/*') +EMILY_CLIENTS_DIR := $(AUTOGENERATED_SOURCES)/emily/client/rust +EMILY_CLIENT_SOURCE_FILES := $(shell find $(EMILY_CLIENTS_DIR) -type f -name 'lib.rs') + +# Generates the OpenAPI specs for the Emily API if any of the spec files are +# older than any of the source files. Note that this generates three spec files, +# one for each of the Emily API variants (public, private, testing). +$(EMILY_OPENAPI_SPEC_PATHS): $(EMILY_OPENAPI_SOURCE_FILES) + @echo "Generating Emily OpenAPI spec" + cargo build --package $(EMILY_OPENAPI_SPEC_PROJECT_NAME) --target-dir ./target/emily-spec-gen ${CARGO_BUILD_ARGS} + +# Generate Rust client code for the Emily APIs if any of the generated source +# files are older than any of the spec files. Note that this generates the code +# for all three Emily API variants (public, private, testing). +$(EMILY_CLIENT_SOURCE_FILES): $(EMILY_OPENAPI_SPEC_PATHS) + @echo "Generating Emily client from OpenAPI spec" + EMILY_CLIENTS_DIR=$(WORKING_DIR)/$(EMILY_CLIENTS_DIR) pnpm --prefix $(EMILY_OPENAPI_DIR) run build cargo fmt \ -p testing-emily-client \ -p private-emily-client \ -p emily-client -# Build the OpenAPI specification. -$(EMILY_OPENAPI_SPEC): $(INSTALL_TARGET) $(EMILY_HANDLER_SOURCE_FILES) - cargo build --package $(EMILY_OPENAPI_SPEC_PROJECT_NAME) ${CARGO_BUILD_ARGS} - cargo fmt -p "$(EMILY_OPENAPI_SPEC_PROJECT_NAME)" - -# Devenv -# ---------------------------------------------------- - -devenv-no-sbtc-up: - docker compose -f docker/docker-compose.yml --profile default --profile bitcoin-mempool up - -devenv-no-sbtc-down: - docker compose -f docker/docker-compose.yml --profile default --profile bitcoin-mempool down - -devenv-up: - docker compose -f docker/docker-compose.yml --profile default --profile bitcoin-mempool --profile sbtc-signer up --detach - -devenv-down: - docker compose -f docker/docker-compose.yml --profile default --profile bitcoin-mempool --profile sbtc-signer down - -devenv-sbtc-up: - docker compose -f docker/docker-compose.yml --profile sbtc-signer up --build +emily-api-specgen: $(EMILY_OPENAPI_SPEC_PATHS) +emily-client-codegen: emily-api-specgen $(EMILY_CLIENT_SOURCE_FILES) +emily-client-build: emily-client-codegen + cargo build --package emily-client ${CARGO_BUILD_ARGS} + +.PHONY: emily-api-specgen emily-client-codegen emily-client-build + +# ############################################################################## +# - BLOCKLIST API +# ############################################################################## + +# Variables +BLOCKLIST_OPENAPI_DIR := blocklist-openapi-gen +BLOCKLIST_OPENAPI_SPEC_PATH := $(BLOCKLIST_OPENAPI_DIR)/blocklist-client-openapi.json +BLOCKLIST_OPENAPI_SPEC_PROJECT_NAME := blocklist-openapi-gen +BLOCKLIST_OPENAPI_SOURCE_FILES := $(shell find $(BLOCKLIST_OPENAPI_DIR) -type f ! -name $(notdir $(BLOCKLIST_OPENAPI_SPEC_PATH))) +BLOCKLIST_CLIENT_SOURCE_DIR := $(AUTOGENERATED_SOURCES)/blocklist-api +BLOCKLIST_CLIENT_SOURCE_FILES := $(BLOCKLIST_CLIENT_SOURCE_DIR)/src/lib.rs + +# Generates the OpenAPI spec for the Blocklist API if the spec file is older +# than any of the source files. +$(BLOCKLIST_OPENAPI_SPEC_PATH): $(BLOCKLIST_OPENAPI_SOURCE_FILES) + @echo "Generating Blocklist OpenAPI spec" + cargo build --package $(BLOCKLIST_OPENAPI_SPEC_PROJECT_NAME) --target-dir ./target/blocklist-spec-gen ${CARGO_BUILD_ARGS} + +# Geneate Rust client code for the Blocklist API if any of the generated source +# files are older than the OpenAPI spec file. +$(BLOCKLIST_CLIENT_SOURCE_FILES): $(BLOCKLIST_OPENAPI_SPEC_PATH) + @echo "Generating blocklist client from openapi spec" + pnpm --prefix $(BLOCKLIST_OPENAPI_DIR) run build + cargo fmt -p blocklist-api -devenv-sbtc-down: - docker compose -f docker/docker-compose.yml --profile sbtc-signer down +blocklist-api-specgen: $(BLOCKLIST_OPENAPI_SPEC_PATH) +blocklist-client-codegen: blocklist-api-specgen $(BLOCKLIST_CLIENT_SOURCE_FILES) -# Blocklist Client API -# ---------------------------------------------------- +# Build the generated Rust client code for the Blocklist API. This target will +# also build the OpenAPI spec (if needed) and generate the client. +blocklist-client-build: blocklist-client-codegen + cargo build --package blocklist-api ${CARGO_BUILD_ARGS} -# Generate the client code using the OpenAPI spec -$(AUTOGENERATED_BLOCKLIST_CLIENT_CLIENT): $(BLOCKLIST_OPENAPI_SPEC) - pnpm --prefix $(BLOCKLIST_OPENAPI_PATH) run build - cargo fmt -p blocklist-api +.PHONY: blocklist-api-specgen blocklist-client-codegen blocklist-client-build -# Generate the OpenAPI spec for Blocklist Client -BLOCKLIST_OPENAPI_SPEC_SOURCE_FILES := $(filter-out $(BLOCKLIST_OPENAPI_SPEC), $(wildcard $(subst dir, $(BLOCKLIST_OPENAPI_PATH), $(THREE_DIRS_DEEP)))) -$(BLOCKLIST_OPENAPI_SPEC): $(INSTALL_TARGET) $(BLOCKLIST_OPENAPI_SPEC_SOURCE_FILES) - cargo build --package blocklist-openapi-gen ${CARGO_BUILD_ARGS} - cargo fmt -p blocklist-openapi-gen - -# Signer -# ---------------------------------------------------- - -run-signer: - docker compose --file docker-compose.signer.yml down; - docker compose --file docker-compose.signer.yml up postgres bitcoind --detach; - POSTGRES_PORT="0"; \ - while [ "$$POSTGRES_PORT" -le 0 ]; do \ - sleep 1; \ - POSTGRES_PORT=$$(docker port sbtc-postgres 5432 | awk -F: '{print $$2}'); \ - done; \ - echo $$POSTGRES_PORT; \ - RUST_LOG=info SIGNER_SIGNER__DB_ENDPOINT="postgres://devenv:devenv@localhost:$$POSTGRES_PORT/signer" cargo run --bin signer -- -c ./signer/src/config/default.toml --migrate-db - -.PHONY: run-signer - -# Git hooks -# ---------------------------------------------------- +# ############################################################################## +# GIT HOOKS +# ############################################################################## install-git-hooks: mkdir -p .git/hooks diff --git a/blocklist-client/Cargo.toml b/blocklist-client/Cargo.toml index dd209bd2e..3a0ca544b 100644 --- a/blocklist-client/Cargo.toml +++ b/blocklist-client/Cargo.toml @@ -13,10 +13,10 @@ path = "src/main.rs" clap.workspace = true config.workspace = true reqwest.workspace = true -serde = { workspace = true, features = ["derive"] } +serde.workspace = true serde_json.workspace = true thiserror.workspace = true -tokio = { workspace = true, features = ["rt-multi-thread", "rt", "macros"] } +tokio.workspace = true tracing.workspace = true tracing-attributes.workspace = true tracing-subscriber.workspace = true diff --git a/blocklist-client/src/config.rs b/blocklist-client/src/config.rs index 3d9ce9d2c..a9ac4b87e 100644 --- a/blocklist-client/src/config.rs +++ b/blocklist-client/src/config.rs @@ -77,14 +77,16 @@ impl Settings { /// Initializing the global config first with default values and then with provided/overwritten environment variables. /// The explicit separator with double underscores is needed to correctly parse the nested config structure. pub fn new() -> Result { - let mut cfg = Config::new(); - cfg.merge(File::from_str( - include_str!("config/default.toml"), - FileFormat::Toml, - ))?; let env = Environment::with_prefix("BLOCKLIST_CLIENT").separator("__"); - cfg.merge(env)?; - let settings: Settings = cfg.try_into()?; + + let cfg = Config::builder() + .add_source(File::from_str( + include_str!("config/default.toml"), + FileFormat::Toml, + )) + .add_source(env) + .build()?; + let settings: Settings = cfg.try_deserialize()?; settings.validate()?; @@ -94,11 +96,14 @@ impl Settings { /// Initializing the global config with values from provided config file and then with provided/overwritten environment variables. /// The explicit separator with double underscores is needed to correctly parse the nested config structure. pub fn new_from_path(path: &str) -> Result { - let mut cfg = Config::new(); - cfg.merge(File::with_name(path))?; let env = Environment::with_prefix("BLOCKLIST_CLIENT").separator("__"); - cfg.merge(env)?; - let settings: Settings = cfg.try_into()?; + + let cfg = Config::builder() + .add_source(File::with_name(path)) + .add_source(env) + .build()?; + + let settings: Settings = cfg.try_deserialize()?; settings.validate()?; diff --git a/.generated-sources/blocklist-openapi-gen/Cargo.toml b/blocklist-openapi-gen/Cargo.toml similarity index 64% rename from .generated-sources/blocklist-openapi-gen/Cargo.toml rename to blocklist-openapi-gen/Cargo.toml index 8fde69a6c..bf722813d 100644 --- a/.generated-sources/blocklist-openapi-gen/Cargo.toml +++ b/blocklist-openapi-gen/Cargo.toml @@ -4,11 +4,11 @@ version = "0.1.0" edition = "2021" [dependencies] -blocklist-client = { path = "../../blocklist-client" } +blocklist-client = { path = "../blocklist-client" } serde_json.workspace = true utoipa = "4.2.3" [build-dependencies] -blocklist-client = { path = "../../blocklist-client" } +blocklist-client = { path = "../blocklist-client" } serde_json.workspace = true utoipa = "4.2.3" diff --git a/.generated-sources/blocklist-openapi-gen/blocklist-client-openapi.json b/blocklist-openapi-gen/blocklist-client-openapi.json similarity index 100% rename from .generated-sources/blocklist-openapi-gen/blocklist-client-openapi.json rename to blocklist-openapi-gen/blocklist-client-openapi.json diff --git a/.generated-sources/blocklist-openapi-gen/build.rs b/blocklist-openapi-gen/build.rs similarity index 100% rename from .generated-sources/blocklist-openapi-gen/build.rs rename to blocklist-openapi-gen/build.rs diff --git a/.generated-sources/blocklist-openapi-gen/config.json b/blocklist-openapi-gen/config.json similarity index 100% rename from .generated-sources/blocklist-openapi-gen/config.json rename to blocklist-openapi-gen/config.json diff --git a/.generated-sources/blocklist-openapi-gen/openapitools.json b/blocklist-openapi-gen/openapitools.json similarity index 100% rename from .generated-sources/blocklist-openapi-gen/openapitools.json rename to blocklist-openapi-gen/openapitools.json diff --git a/blocklist-openapi-gen/package.json b/blocklist-openapi-gen/package.json new file mode 100644 index 000000000..db123d2c3 --- /dev/null +++ b/blocklist-openapi-gen/package.json @@ -0,0 +1,10 @@ +{ + "name": "blocklist-api", + "scripts": { + "build-openapi": "JAVA_OPTS='-Dlog.level=error' openapi-generator-cli generate -i ./blocklist-client-openapi.json -g rust -o ../.generated-sources/blocklist-api --config ./config.json", + "build": "pnpm build-openapi" + }, + "devDependencies": { + "@openapitools/openapi-generator-cli": "^2.13.2" + } +} diff --git a/.generated-sources/blocklist-openapi-gen/src/main.rs b/blocklist-openapi-gen/src/main.rs similarity index 100% rename from .generated-sources/blocklist-openapi-gen/src/main.rs rename to blocklist-openapi-gen/src/main.rs diff --git a/docker/docker-compose.ci.yml b/docker/docker-compose.ci.yml index 867972376..1d1d7a48b 100644 --- a/docker/docker-compose.ci.yml +++ b/docker/docker-compose.ci.yml @@ -43,13 +43,3 @@ services: command: "-jar DynamoDBLocal.jar -sharedDb -dbPath ." ports: - "8000:8000" - - emily-aws-setup: - build: - context: .. - dockerfile: docker/sbtc/emily-aws-setup/Dockerfile.ci - target: emily-aws-setup - depends_on: - - emily-dynamodb - environment: - - DYNAMODB_ENDPOINT=http://emily-dynamodb:8000 diff --git a/emily/cdk/lib/emily-stack.ts b/emily/cdk/lib/emily-stack.ts index 7d3963e68..013b9682e 100644 --- a/emily/cdk/lib/emily-stack.ts +++ b/emily/cdk/lib/emily-stack.ts @@ -416,7 +416,7 @@ export class EmilyStack extends cdk.Stack { restApiName: EmilyStackUtils.getResourceName(apiId, props), apiDefinition: EmilyStackUtils.restApiDefinitionWithLambdaIntegration( EmilyStackUtils.getPathFromProjectRoot( - `.generated-sources/emily/openapi/generated-specs/${apiPurpose}-emily-openapi-spec.json` + `emily/openapi-gen/generated-specs/${apiPurpose}-emily-openapi-spec.json` ), [ // This must match the Lambda name from the @aws.apigateway#integration trait in the diff --git a/emily/handler/Cargo.toml b/emily/handler/Cargo.toml index 444275c4e..732d0fbf5 100644 --- a/emily/handler/Cargo.toml +++ b/emily/handler/Cargo.toml @@ -11,7 +11,6 @@ name = "emily-server" [features] default = ["testing"] -integration-tests = ["testing"] testing = ["fake"] populate = ["testing"] @@ -26,13 +25,13 @@ hex.workspace = true openssl.workspace = true reqwest.workspace = true sbtc.workspace = true -serde = { workspace = true, features = ["derive"] } +serde.workspace = true serde_dynamo.workspace = true serde_json.workspace = true stacks-common.workspace = true thiserror.workspace = true -time = { workspace = true, features = ["serde"] } -tokio = { workspace = true, features = ["rt-multi-thread", "rt", "macros"] } +time.workspace = true +tokio.workspace = true tracing.workspace = true tracing-attributes.workspace = true tracing-subscriber.workspace = true @@ -40,7 +39,7 @@ utoipa = "4.2.3" warp = "0.3" warp_lambda.workspace = true -fake = { version = "2.9.2", features = ["derive", "time"], optional = true } +fake = { workspace = true, optional = true } [dev-dependencies] testing-emily-client.workspace = true diff --git a/emily/handler/tests/integration/chainstate.rs b/emily/handler/tests/integration/chainstate.rs index 47592e9e0..84f69dc19 100644 --- a/emily/handler/tests/integration/chainstate.rs +++ b/emily/handler/tests/integration/chainstate.rs @@ -42,7 +42,6 @@ async fn batch_set_chainstates( created } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[test_case(1123, 1128; "create-5-chainstates")] #[tokio::test] async fn create_and_get_chainstate_happy_path(min_height: u64, max_height: u64) { @@ -86,7 +85,6 @@ async fn create_and_get_chainstate_happy_path(min_height: u64, max_height: u64) assert_eq!(expected_chaintip, gotten_chaintip) } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[test_case(1123, 1128, 1133; "standard-reorg")] #[test_case(1123, 1133, 1133; "reorg-to-tip-at-same-height")] #[test_case(1123, 1111, 1133; "reorg-to-tip-below-any-existing-entry")] @@ -125,7 +123,6 @@ async fn create_and_get_chainstate_reorg_happy_path( assert_eq!(expected_post_reorg_chaintip, gotten_post_reorg_chaintip); } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[test_case(1123, 1128; "replay-5-chainstates-out-of-order")] #[tokio::test] async fn create_and_replay_does_not_initiate_reorg(min_height: u64, max_height: u64) { diff --git a/emily/handler/tests/integration/config.rs b/emily/handler/tests/integration/config.rs index 997dfc5d0..c8fa8553a 100644 --- a/emily/handler/tests/integration/config.rs +++ b/emily/handler/tests/integration/config.rs @@ -30,11 +30,13 @@ impl Settings { /// Initializing the global config first with default values and then with provided/overwritten environment variables. /// The explicit separator with double underscores is needed to correctly parse the nested config structure. pub fn new() -> Result { - let mut cfg = Config::new(); - cfg.merge(File::with_name("./tests/integration/config/default"))?; let env = Environment::with_prefix("EMILY_TEST_CLIENT").separator("__"); - cfg.merge(env)?; - let settings: Settings = cfg.try_into()?; + + let cfg = Config::builder() + .add_source(File::with_name("./tests/integration/config/default")) + .add_source(env) + .build()?; + let settings: Settings = cfg.try_deserialize()?; settings.validate()?; Ok(settings) diff --git a/emily/handler/tests/integration/deposit.rs b/emily/handler/tests/integration/deposit.rs index 5092df3c1..89218fd4e 100644 --- a/emily/handler/tests/integration/deposit.rs +++ b/emily/handler/tests/integration/deposit.rs @@ -92,7 +92,6 @@ impl DepositTxnData { } } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn create_and_get_deposit_happy_path() { let configuration = clean_setup().await; @@ -155,7 +154,6 @@ async fn create_and_get_deposit_happy_path() { assert_eq!(expected_deposit, gotten_deposit); } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn wipe_databases_test() { let configuration = clean_setup().await; @@ -204,7 +202,6 @@ async fn wipe_databases_test() { assert_eq!(attempted_get.status_code, 404); } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn get_deposits_for_transaction() { let configuration = clean_setup().await; @@ -276,7 +273,6 @@ async fn get_deposits_for_transaction() { assert_eq!(expected_deposits, gotten_deposits.deposits); } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn get_deposits() { let configuration = clean_setup().await; @@ -376,7 +372,6 @@ struct RecipientTestSetupData { bitcoin_txid: String, } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn get_deposits_for_recipient() { let configuration = clean_setup().await; @@ -493,7 +488,6 @@ async fn get_deposits_for_recipient() { } } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn update_deposits() { let configuration = clean_setup().await; @@ -589,7 +583,6 @@ async fn update_deposits() { assert_eq!(expected_deposits, updated_deposits); } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn update_deposits_updates_chainstate() { let configuration = clean_setup().await; @@ -688,7 +681,6 @@ async fn update_deposits_updates_chainstate() { #[test_case(Status::Confirmed, true; "Should reject confirmed duplicate")] #[test_case(Status::Failed, true; "Should reject failed duplicate")] #[test_case(Status::Accepted, true; "Should reject accepted duplicate")] -#[cfg_attr(not(feature = "integration-tests"), ignore)] async fn overwrite_deposit(status: Status, should_reject: bool) { let configuration = clean_setup().await; // Arrange. diff --git a/emily/handler/tests/integration/limits.rs b/emily/handler/tests/integration/limits.rs index 865b58325..bf140918d 100644 --- a/emily/handler/tests/integration/limits.rs +++ b/emily/handler/tests/integration/limits.rs @@ -7,7 +7,6 @@ use testing_emily_client::models::Limits; use crate::common::clean_setup; -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn empty_default_is_as_expected() { let configuration = clean_setup().await; @@ -27,7 +26,6 @@ async fn empty_default_is_as_expected() { assert_eq!(limits, expected_empty_default); } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn adding_and_then_updating_single_accout_limit_works() { let configuration = clean_setup().await; @@ -152,7 +150,6 @@ async fn adding_and_then_updating_single_accout_limit_works() { assert_eq!(global_limits, expected_limits); } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn test_updating_account_limits_via_global_limit_works() { let configuration = clean_setup().await; diff --git a/emily/handler/tests/integration/withdrawal.rs b/emily/handler/tests/integration/withdrawal.rs index cd1a78254..3a73a47e8 100644 --- a/emily/handler/tests/integration/withdrawal.rs +++ b/emily/handler/tests/integration/withdrawal.rs @@ -53,7 +53,6 @@ async fn batch_create_withdrawals( created } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn create_and_get_withdrawal_happy_path() { let configuration = clean_setup().await; @@ -103,7 +102,6 @@ async fn create_and_get_withdrawal_happy_path() { assert_eq!(expected, gotten); } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn get_withdrawals() { let configuration = clean_setup().await; @@ -191,7 +189,6 @@ async fn get_withdrawals() { assert_eq!(expected_withdrawal_infos, gotten_withdrawal_infos); } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn update_withdrawals() { let configuration = clean_setup().await; @@ -280,7 +277,6 @@ async fn update_withdrawals() { assert_eq!(expected_withdrawals, updated_withdrawals); } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn update_withdrawals_updates_chainstate() { let configuration = clean_setup().await; diff --git a/.generated-sources/emily/openapi/Cargo.toml b/emily/openapi-gen/Cargo.toml similarity index 100% rename from .generated-sources/emily/openapi/Cargo.toml rename to emily/openapi-gen/Cargo.toml diff --git a/.generated-sources/emily/openapi/api-config/private.json b/emily/openapi-gen/api-config/private.json similarity index 100% rename from .generated-sources/emily/openapi/api-config/private.json rename to emily/openapi-gen/api-config/private.json diff --git a/.generated-sources/emily/openapi/api-config/public.json b/emily/openapi-gen/api-config/public.json similarity index 100% rename from .generated-sources/emily/openapi/api-config/public.json rename to emily/openapi-gen/api-config/public.json diff --git a/.generated-sources/emily/openapi/api-config/testing.json b/emily/openapi-gen/api-config/testing.json similarity index 100% rename from .generated-sources/emily/openapi/api-config/testing.json rename to emily/openapi-gen/api-config/testing.json diff --git a/.generated-sources/emily/openapi/build.rs b/emily/openapi-gen/build.rs similarity index 89% rename from .generated-sources/emily/openapi/build.rs rename to emily/openapi-gen/build.rs index 0c593c3f1..420f8ae69 100644 --- a/.generated-sources/emily/openapi/build.rs +++ b/emily/openapi-gen/build.rs @@ -7,7 +7,7 @@ const RELATIVE_SPEC_DIRECTORY: &str = "./generated-specs"; /// Main function. fn main() { // Ensure that we rerun if the API spec changes. - println!("cargo:rerun-if-changed=../../../emily/handler/src/api"); + println!("cargo:rerun-if-changed=../handler/src/api"); // Ensure that we rerun if the scripts responsible for building change. println!("cargo:rerun-if-changed=generators"); println!("cargo:rerun-if-changed=api-config"); diff --git a/.generated-sources/emily/openapi/generated-specs/private-emily-openapi-spec.json b/emily/openapi-gen/generated-specs/private-emily-openapi-spec.json similarity index 100% rename from .generated-sources/emily/openapi/generated-specs/private-emily-openapi-spec.json rename to emily/openapi-gen/generated-specs/private-emily-openapi-spec.json diff --git a/.generated-sources/emily/openapi/generated-specs/public-emily-openapi-spec.json b/emily/openapi-gen/generated-specs/public-emily-openapi-spec.json similarity index 100% rename from .generated-sources/emily/openapi/generated-specs/public-emily-openapi-spec.json rename to emily/openapi-gen/generated-specs/public-emily-openapi-spec.json diff --git a/.generated-sources/emily/openapi/generated-specs/testing-emily-openapi-spec.json b/emily/openapi-gen/generated-specs/testing-emily-openapi-spec.json similarity index 100% rename from .generated-sources/emily/openapi/generated-specs/testing-emily-openapi-spec.json rename to emily/openapi-gen/generated-specs/testing-emily-openapi-spec.json diff --git a/.generated-sources/emily/openapi/generators/mod.rs b/emily/openapi-gen/generators/mod.rs similarity index 100% rename from .generated-sources/emily/openapi/generators/mod.rs rename to emily/openapi-gen/generators/mod.rs diff --git a/.generated-sources/emily/openapi/generators/private.rs b/emily/openapi-gen/generators/private.rs similarity index 100% rename from .generated-sources/emily/openapi/generators/private.rs rename to emily/openapi-gen/generators/private.rs diff --git a/.generated-sources/emily/openapi/generators/public.rs b/emily/openapi-gen/generators/public.rs similarity index 100% rename from .generated-sources/emily/openapi/generators/public.rs rename to emily/openapi-gen/generators/public.rs diff --git a/.generated-sources/emily/openapi/generators/testing.rs b/emily/openapi-gen/generators/testing.rs similarity index 100% rename from .generated-sources/emily/openapi/generators/testing.rs rename to emily/openapi-gen/generators/testing.rs diff --git a/.generated-sources/emily/openapi/openapitools.json b/emily/openapi-gen/openapitools.json similarity index 100% rename from .generated-sources/emily/openapi/openapitools.json rename to emily/openapi-gen/openapitools.json diff --git a/emily/openapi-gen/package.json b/emily/openapi-gen/package.json new file mode 100644 index 000000000..a59ea0aa6 --- /dev/null +++ b/emily/openapi-gen/package.json @@ -0,0 +1,12 @@ +{ + "name": "emily-api", + "scripts": { + "build-testing-api-rust": "JAVA_OPTS='-Dlog.level=error' openapi-generator-cli generate -i ./generated-specs/testing-emily-openapi-spec.json -g rust -o $EMILY_CLIENTS_DIR/testing/ --config ./api-config/testing.json", + "build-private-api-rust": "JAVA_OPTS='-Dlog.level=error' openapi-generator-cli generate -i ./generated-specs/private-emily-openapi-spec.json -g rust -o $EMILY_CLIENTS_DIR/private/ --config ./api-config/private.json", + "build-public-api-rust": "JAVA_OPTS='-Dlog.level=error' openapi-generator-cli generate -i ./generated-specs/public-emily-openapi-spec.json -g rust -o $EMILY_CLIENTS_DIR/public/ --config ./api-config/public.json", + "build": "pnpm build-testing-api-rust && pnpm build-public-api-rust && pnpm build-private-api-rust" + }, + "devDependencies": { + "@openapitools/openapi-generator-cli": "^2.13.2" + } +} diff --git a/.generated-sources/emily/openapi/src/main.rs b/emily/openapi-gen/src/main.rs similarity index 100% rename from .generated-sources/emily/openapi/src/main.rs rename to emily/openapi-gen/src/main.rs diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6296c8a4e..2f1f67f8a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,13 +11,7 @@ importers: .: {} - .generated-sources/blocklist-openapi-gen: - devDependencies: - '@openapitools/openapi-generator-cli': - specifier: ^2.13.2 - version: 2.13.4 - - .generated-sources/emily/openapi: + blocklist-openapi-gen: devDependencies: '@openapitools/openapi-generator-cli': specifier: ^2.13.2 @@ -121,6 +115,12 @@ importers: specifier: ~5.0.4 version: 5.0.4 + emily/openapi-gen: + devDependencies: + '@openapitools/openapi-generator-cli': + specifier: ^2.13.2 + version: 2.13.4 + packages: '@ampproject/remapping@2.3.0': diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 31313b2d9..00b7f70bb 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,6 +1,6 @@ packages: - 'contracts' - 'emily/cdk' - - '.generated-sources/blocklist-openapi-gen' - - '.generated-sources/emily/openapi' + - 'blocklist-openapi-gen' + - 'emily/openapi-gen' - 'devenv/local/docker-compose/stacking' diff --git a/rust-toolchain.toml b/rust-toolchain.toml index cf6bc107f..aa348cd22 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] -channel = "1.80.0" +channel = "1.81.0" components = ["rustfmt", "clippy"] targets = ["x86_64-unknown-linux-gnu", "x86_64-unknown-linux-musl"] profile = "minimal" diff --git a/sbtc/Cargo.toml b/sbtc/Cargo.toml index 51ce0c362..a69dcb373 100644 --- a/sbtc/Cargo.toml +++ b/sbtc/Cargo.toml @@ -7,12 +7,11 @@ edition = "2021" [features] default = [] -integration-tests = ["testing"] testing = ["dep:bitcoincore-rpc", "dep:bitcoincore-rpc-json"] webhooks = ["dep:stackslib", "dep:hex"] [dependencies] -bitcoin = { workspace = true, features = ["rand-std"] } +bitcoin.workspace = true bitcoincore-rpc = { workspace = true, optional = true } bitcoincore-rpc-json = { workspace = true, optional = true } stackslib = { workspace = true, optional = true } diff --git a/sbtc/tests/integration/validation.rs b/sbtc/tests/integration/validation.rs index 06c56c6d9..631178607 100644 --- a/sbtc/tests/integration/validation.rs +++ b/sbtc/tests/integration/validation.rs @@ -42,7 +42,6 @@ use secp256k1::SECP256K1; /// /// We check that we can validate a transaction in the mempool using the /// electrum and bitcoin-core clients -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[test] fn tx_validation_from_mempool() { let max_fee: u64 = 15000; @@ -101,7 +100,6 @@ fn tx_validation_from_mempool() { /// /// We do not attempt to create an actual P2TR deposit, but an /// (unsupported) P2SH deposit. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[test] fn minimal_push_check() { let fee = regtest::BITCOIN_CORE_FALLBACK_FEE.to_sat(); @@ -213,7 +211,6 @@ fn minimal_push_check() { /// 4. Confirm that transaction and try to spend it immediately. The /// transaction that tries to spend the transaction from (3) should be /// rejected. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[test] fn op_csv_disabled() { let fee = regtest::BITCOIN_CORE_FALLBACK_FEE.to_sat(); @@ -410,7 +407,6 @@ fn op_csv_disabled() { /// 3. Create and submit another transaction reclaiming the funds. /// 4. Confirm the transaction and check that the balance is what it is /// supposed to be, less the bitcoin transaction fees. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[test] fn reclaiming_rejected_deposits() { let max_fee: u64 = 15000; diff --git a/signer/Cargo.toml b/signer/Cargo.toml index 34fd14b5f..61dc4dfb9 100644 --- a/signer/Cargo.toml +++ b/signer/Cargo.toml @@ -6,7 +6,6 @@ edition = "2021" [features] default = ["testing"] -integration-tests = ["testing"] testing = ["fake", "mockall", "sbtc/testing"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -15,15 +14,15 @@ testing = ["fake", "mockall", "sbtc/testing"] aquamarine.workspace = true axum.workspace = true backoff.workspace = true -bitcoin = { workspace = true, features = ["rand-std"] } +bitcoin.workspace = true bitcoincore-rpc.workspace = true bitcoincore-rpc-json.workspace = true -bitvec = { workspace = true, default-features = false, features = ["std"] } +bitvec.workspace = true blocklist-api = { path = "../.generated-sources/blocklist-api" } emily-client.workspace = true clap.workspace = true clarity.workspace = true -config = "0.14" +config.workspace = true futures.workspace = true hashbrown.workspace = true libp2p.workspace = true @@ -46,7 +45,7 @@ strum.workspace = true thiserror.workspace = true time.workspace = true tonic.workspace = true -tokio = { workspace = true, features = ["signal", "macros", "rt-multi-thread"] } +tokio.workspace = true tokio-stream.workspace = true tracing.workspace = true tracing-attributes.workspace = true @@ -58,14 +57,14 @@ hex.workspace = true cfg-if = "1.0" include_dir = "0.7.4" polynomial = "0.2.6" -bitcoincore-zmq = { version = "1.5.2", features = ["async"] } +bitcoincore-zmq.workspace = true # Only used to setup logging for the signer's axum http server tower-http = { version = "0.6.2", features = ["trace", "request-id"] } # Only for testing mockall = { version = "0.12.1", optional = true } -fake = { version = "2.9.2", features = ["derive", "time"], optional = true } +fake = { workspace = true, optional = true } [dependencies.secp256k1] version = "*" diff --git a/signer/src/bitcoin/fees.rs b/signer/src/bitcoin/fees.rs index 630db59d7..92a73f374 100644 --- a/signer/src/bitcoin/fees.rs +++ b/signer/src/bitcoin/fees.rs @@ -80,15 +80,16 @@ struct BitcoinerLiveResponse { /// 360 minutes. #[allow(dead_code)] #[derive(Debug, Deserialize)] -struct BitcoinerLiveEstimates { +pub struct BitcoinerLiveEstimates { #[serde(alias = "30")] thirty: BitcoinerLiveFeeEstimate, #[serde(alias = "60")] sixty: BitcoinerLiveFeeEstimate, } +/// A single fee estimate from bitcoiner.live #[derive(Debug, Deserialize)] -struct BitcoinerLiveFeeEstimate { +pub struct BitcoinerLiveFeeEstimate { /// estimated fee rate in satoshis per virtual-byte sat_per_vbyte: f64, } @@ -99,15 +100,23 @@ struct BitcoinerLiveFeeEstimate { /// while the specific docs for getting recommended fees can be found at /// https://mempool.space/docs/api/rest#get-recommended-fees #[derive(Debug, Clone)] -struct MempoolSpace { +pub struct MempoolSpace { base_url: String, client: reqwest::Client, } +impl MempoolSpace { + /// Create a new MempoolSpace instance + pub fn new(base_url: String, client: reqwest::Client) -> Self { + Self { base_url, client } + } +} + +/// The response from mempool.space when requesting fee estimates #[allow(dead_code)] #[derive(Debug, Deserialize)] #[serde(rename_all = "camelCase")] -struct MempoolSpaceResponse { +pub struct MempoolSpaceResponse { fastest_fee: u64, half_hour_fee: u64, hour_fee: u64, @@ -216,26 +225,6 @@ mod tests { assert_eq!(est.sats_per_vbyte, 5.); } - #[tokio::test] - #[cfg_attr(not(feature = "integration-tests"), ignore)] - async fn prod_estimate_fee_rate_works() { - let client = reqwest::Client::new(); - - let ans = estimate_fee_rate(&client).await.unwrap(); - more_asserts::assert_gt!(ans.sats_per_vbyte, 0.0); - - // It's not obvious from the docs that mempool.space returns a fee - // rate in sats per vbyte, so this is to help manually validate - // that. - let mempool = MempoolSpace { - base_url: "https://mempool.space".to_string(), - client: client.clone(), - }; - - let ans = mempool.estimate_fee_rate().await.unwrap(); - more_asserts::assert_gt!(ans.sats_per_vbyte, 0.0); - } - #[tokio::test] async fn estimate_fee_rate_impl_happy_path() { let mempool_body = diff --git a/signer/src/context/signer_state.rs b/signer/src/context/signer_state.rs index 66dabb8cb..529e6b364 100644 --- a/signer/src/context/signer_state.rs +++ b/signer/src/context/signer_state.rs @@ -178,6 +178,7 @@ impl SbtcLimits { self.max_mintable_cap.unwrap_or(Amount::MAX_MONEY) } + /// TODO: Document this #[cfg(test)] pub fn new_per_deposit(min: u64, max: u64) -> Self { Self { diff --git a/signer/src/network/libp2p/event_loop.rs b/signer/src/network/libp2p/event_loop.rs index 116394868..8e0b292c8 100644 --- a/signer/src/network/libp2p/event_loop.rs +++ b/signer/src/network/libp2p/event_loop.rs @@ -58,13 +58,9 @@ pub async fn run(ctx: &impl Context, swarm: Arc>>) { loop { // Poll the libp2p swarm for events, waiting for a maximum of 5ms // so that we don't starve the outbox. - let event = - match tokio::time::timeout(Duration::from_millis(5), swarm.lock().await.next()) - .await - { - Ok(event) => event, - Err(_) => None, - }; + let event = tokio::time::timeout(Duration::from_millis(5), swarm.lock().await.next()) + .await + .unwrap_or_default(); // Handle the event if one was received. if let Some(event) = event { diff --git a/signer/tests/integration/bitcoin_client.rs b/signer/tests/integration/bitcoin_client.rs index 7132deaec..59c441e62 100644 --- a/signer/tests/integration/bitcoin_client.rs +++ b/signer/tests/integration/bitcoin_client.rs @@ -9,7 +9,6 @@ use signer::bitcoin::{BitcoinInteract, TransactionLookupHint}; use signer::util::ApiFallbackClient; use url::Url; -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn test_get_block_not_found() { let url: Url = "http://devnet:devnet@localhost:18443".parse().unwrap(); @@ -26,8 +25,6 @@ async fn test_get_block_not_found() { // TODO: Figure out how to let this (and similar tests) run against the wallet // generated by `initialize_blockchain()`. See comment in the test below. -//#[ignore = "This test needs to be run against a 'fresh' bitcoin core instance"] -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn test_get_block_works() { let (_, faucet) = regtest::initialize_blockchain(); @@ -75,7 +72,6 @@ async fn broadcast_tx_works() { client.broadcast_transaction(&tx).await.unwrap(); } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn calculate_transaction_fee_works_confirmed() { let client = BitcoinCoreClient::new( @@ -145,7 +141,6 @@ async fn calculate_transaction_fee_works_confirmed() { assert_eq!(result.fee_rate, expected_fee_rate); } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn calculate_transaction_fee_works_mempool() { let client = BitcoinCoreClient::new( diff --git a/signer/tests/integration/bitcoin_rpc.rs b/signer/tests/integration/bitcoin_rpc.rs index 2b59bedaa..ff89b2f04 100644 --- a/signer/tests/integration/bitcoin_rpc.rs +++ b/signer/tests/integration/bitcoin_rpc.rs @@ -23,7 +23,6 @@ use signer::bitcoin::BitcoinInteract; use signer::storage::model::BitcoinBlockHash; use signer::storage::model::BitcoinTxId; -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[test] fn btc_client_getstransaction() { let client = BitcoinCoreClient::new( @@ -67,7 +66,6 @@ fn btc_client_getstransaction() { assert_eq!(response.confirmations, Some(1)); } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[test] fn btc_client_getblockheader() { let client = BitcoinCoreClient::new( @@ -93,7 +91,6 @@ fn btc_client_getblockheader() { assert!(client.get_block_header(&random_hash).unwrap().is_none()); } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[test] fn btc_client_gets_transaction_info() { let client = BitcoinCoreClient::new( @@ -136,7 +133,6 @@ fn btc_client_gets_transaction_info() { assert_eq!(response.tx.output[vout].value.to_sat(), 500_000); } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[test] fn btc_client_gets_transaction_info_missing_tx() { let client = BitcoinCoreClient::new( @@ -177,7 +173,6 @@ fn btc_client_gets_transaction_info_missing_tx() { assert!(response.is_none()); } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[test] fn btc_client_unsubmitted_tx() { let client = BitcoinCoreClient::new( @@ -198,7 +193,6 @@ fn btc_client_unsubmitted_tx() { /// estimate the fee rate, otherwise it will return an error. Since we do /// not ensure that bitcoin-core has enough transactions to estimate fees /// in the test, we just check that fee is positive. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[test] fn estimate_fee_rate() { let _ = regtest::initialize_blockchain(); @@ -215,7 +209,6 @@ fn estimate_fee_rate() { } } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn get_tx_spending_prevout() { let client = BitcoinCoreClient::new( @@ -281,7 +274,6 @@ async fn get_tx_spending_prevout() { assert!(response.is_empty()); } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn get_tx_spending_prevout_nonexistent_txid() { let client = BitcoinCoreClient::new( @@ -305,7 +297,6 @@ async fn get_tx_spending_prevout_nonexistent_txid() { assert!(result.is_empty()); } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn get_mempool_descendants() { let client = BitcoinCoreClient::new( @@ -438,7 +429,6 @@ async fn get_mempool_descendants() { assert!(response.contains(&tx3.compute_txid())); } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn get_tx_out_confirmed_no_mempool() { let client = BitcoinCoreClient::new( @@ -464,7 +454,6 @@ async fn get_tx_out_confirmed_no_mempool() { assert_eq!(txout.confirmations, 1); } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn get_tx_out_confirmed_with_mempool() { let client = BitcoinCoreClient::new( @@ -490,7 +479,6 @@ async fn get_tx_out_confirmed_with_mempool() { assert_eq!(txout.confirmations, 1); } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn get_tx_out_unconfirmed_no_mempool() { let client = BitcoinCoreClient::new( @@ -513,7 +501,6 @@ async fn get_tx_out_unconfirmed_no_mempool() { assert!(txout.is_none()); } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn get_tx_out_unconfirmed_with_mempool() { let client = BitcoinCoreClient::new( diff --git a/signer/tests/integration/bitcoin_validation.rs b/signer/tests/integration/bitcoin_validation.rs index cffa0df7a..6e8aa4410 100644 --- a/signer/tests/integration/bitcoin_validation.rs +++ b/signer/tests/integration/bitcoin_validation.rs @@ -87,7 +87,6 @@ impl AssertConstantInvariants for Vec { } } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn one_tx_per_request_set() { let db = testing::storage::new_test_database().await; @@ -181,7 +180,6 @@ async fn one_tx_per_request_set() { /// Test that including a single invalid transaction in a set of requests /// results in the entire bitcoin transaction being invalid, and that will /// sign for the associated sighashes are all false. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn one_invalid_deposit_invalidates_tx() { let low_fee = 10; @@ -299,7 +297,6 @@ async fn one_invalid_deposit_invalidates_tx() { testing::storage::drop_db(db).await; } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn one_withdrawal_errors_validation() { let db = testing::storage::new_test_database().await; @@ -369,7 +366,6 @@ async fn one_withdrawal_errors_validation() { testing::storage::drop_db(db).await; } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn cannot_sign_deposit_is_ok() { let db = testing::storage::new_test_database().await; @@ -535,7 +531,6 @@ async fn cannot_sign_deposit_is_ok() { testing::storage::drop_db(db).await; } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn sighashes_match_from_sbtc_requests_object() { let db = testing::storage::new_test_database().await; @@ -668,7 +663,6 @@ async fn sighashes_match_from_sbtc_requests_object() { testing::storage::drop_db(db).await; } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn outcome_is_independent_of_input_order() { let db = testing::storage::new_test_database().await; diff --git a/signer/tests/integration/block_observer.rs b/signer/tests/integration/block_observer.rs index 1155c7c57..2e47e6f0d 100644 --- a/signer/tests/integration/block_observer.rs +++ b/signer/tests/integration/block_observer.rs @@ -65,7 +65,6 @@ pub const GET_POX_INFO_JSON: &str = /// The [`BlockObserver::load_latest_deposit_requests`] function is /// supposed to fetch all deposit requests from Emily and persist the ones /// that pass validation, regardless of when they were confirmed. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[test_case::test_case(1; "one block ago")] #[test_case::test_case(5; "five blocks ago")] #[tokio::test] @@ -372,7 +371,6 @@ async fn fetch_input(db: &PgStore, output_type: TxPrevoutType) -> Vec /// - make integration-env-up-ci /// /// Then you should be good to go. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn block_observer_stores_donation_and_sbtc_utxos() { let mut rng = rand::rngs::StdRng::seed_from_u64(51); @@ -655,7 +653,6 @@ async fn block_observer_stores_donation_and_sbtc_utxos() { testing::storage::drop_db(db).await; } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[test_case::test_case(false, SbtcLimits::unlimited(); "no contracts, default limits")] #[test_case::test_case(false, SbtcLimits::new(Some(bitcoin::Amount::from_sat(1_000)), None, None, None, None); "no contracts, total cap limit")] #[test_case::test_case(true, SbtcLimits::unlimited(); "deployed contracts, default limits")] @@ -808,7 +805,6 @@ async fn block_observer_handles_update_limits(deployed: bool, sbtc_limits: SbtcL testing::storage::drop_db(db).await; } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn next_headers_to_process_gets_all_headers() { // We start with the typical setup with a fresh database and context @@ -869,7 +865,6 @@ async fn next_headers_to_process_gets_all_headers() { testing::storage::drop_db(db).await; } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn next_headers_to_process_ignores_known_headers() { // We start with the typical setup with a fresh database and context diff --git a/signer/tests/integration/communication.rs b/signer/tests/integration/communication.rs index 1dee39332..697f487b2 100644 --- a/signer/tests/integration/communication.rs +++ b/signer/tests/integration/communication.rs @@ -14,7 +14,6 @@ use signer::network::P2PNetwork; use signer::testing::context::TestContext; use signer::testing::context::*; -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn swarm_rejects_connections_from_unknown_peers() { // In this test we create three swarms (simulating three signers). We diff --git a/signer/tests/integration/complete_deposit.rs b/signer/tests/integration/complete_deposit.rs index a44241cbe..f8b4f0771 100644 --- a/signer/tests/integration/complete_deposit.rs +++ b/signer/tests/integration/complete_deposit.rs @@ -140,7 +140,6 @@ pub fn make_complete_deposit2(data: &TestSweepSetup2) -> (CompleteDepositV1, Req (complete_deposit_tx, req_ctx) } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn complete_deposit_validation_happy_path() { // Normal: this generates the blockchain as well as deposit request @@ -203,7 +202,6 @@ async fn complete_deposit_validation_happy_path() { /// For this test we check that the `CompleteDepositV1::validate` function /// returns a deposit validation error with a DeployerMismatch message when /// the deployer doesn't match but everything else is okay. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn complete_deposit_validation_deployer_mismatch() { // Normal: this generates the blockchain as well as deposit request @@ -270,7 +268,6 @@ async fn complete_deposit_validation_deployer_mismatch() { /// returns a deposit validation error with a DepositRequestMissing message /// when the signer does not have a record of the deposit request doesn't /// match but everything else is okay. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn complete_deposit_validation_missing_deposit_request() { // Normal: this generates the blockchain as well as deposit request @@ -331,7 +328,6 @@ async fn complete_deposit_validation_missing_deposit_request() { /// returns a deposit validation error with a RecipientMismatch message /// when the recipient in the complete-deposit transaction does not match /// the recipient in our records. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn complete_deposit_validation_recipient_mismatch() { // Normal: this generates the blockchain as well as deposit request @@ -412,7 +408,6 @@ async fn complete_deposit_validation_recipient_mismatch() { /// Moreover, our testing apparatus goes through code that filters deposits /// based off of the DUST amount, so we need custom code to trigger this /// error. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn complete_deposit_validation_fee_too_low() { // Normal: this generates the blockchain as well as deposit request @@ -542,7 +537,6 @@ async fn complete_deposit_validation_fee_too_low() { /// returns a deposit validation error with a FeeTooHigh message when the /// amount of sBTC to mint is less than the `amount - max-fee` from in the /// signer's deposit request record. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn complete_deposit_validation_fee_too_high() { // Normal: this generates the blockchain as well as deposit request @@ -614,7 +608,6 @@ async fn complete_deposit_validation_fee_too_high() { /// returns a deposit validation error with a SweepTransactionMissing /// message when the signer does not have a record of the sweep /// transaction. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn complete_deposit_validation_sweep_tx_missing() { // Normal: this generates the blockchain as well as deposit request @@ -683,7 +676,6 @@ async fn complete_deposit_validation_sweep_tx_missing() { /// returns a deposit validation error with a SweepTransactionReorged /// message when the sweep transaction is in our records but is not on what /// the signer thinks is the canonical bitcoin blockchain. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn complete_deposit_validation_sweep_reorged() { // Normal: this generates the blockchain as well as deposit request @@ -762,7 +754,6 @@ async fn complete_deposit_validation_sweep_reorged() { /// message when the sweep transaction is in our records, is on what the /// signer thinks is the canonical bitcoin blockchain, but it does not have /// an input that that matches the deposit request outpoint. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn complete_deposit_validation_deposit_not_in_sweep() { // Normal: this generates the blockchain as well as deposit request @@ -833,7 +824,6 @@ async fn complete_deposit_validation_deposit_not_in_sweep() { /// sweep transaction is in our records, is on what the signer thinks is /// the canonical bitcoin blockchain, but the fee assessed differs from /// what we would expect. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn complete_deposit_validation_deposit_incorrect_fee() { // Normal: this generates the blockchain as well as deposit request @@ -901,7 +891,6 @@ async fn complete_deposit_validation_deposit_incorrect_fee() { /// returns a deposit validation error with a InvalidSweep message when the /// sweep transaction does not have a prevout with a scriptPubKey that the /// signers control. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn complete_deposit_validation_deposit_invalid_sweep() { // Normal: this generates the blockchain as well as deposit request diff --git a/signer/tests/integration/emily.rs b/signer/tests/integration/emily.rs index 05463e6d0..d572e3fd9 100644 --- a/signer/tests/integration/emily.rs +++ b/signer/tests/integration/emily.rs @@ -558,7 +558,6 @@ async fn deposit_flow() { testing::storage::drop_db(db).await; } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn get_deposit_request_works() { let max_fee: u64 = 15000; diff --git a/signer/tests/integration/fees.rs b/signer/tests/integration/fees.rs new file mode 100644 index 000000000..a09b3d35c --- /dev/null +++ b/signer/tests/integration/fees.rs @@ -0,0 +1,20 @@ +//! Tests for the fees module. + +use signer::bitcoin::fees::{estimate_fee_rate, EstimateFees, MempoolSpace}; + +#[ignore = "This uses external sources and is not currently used in the codebase"] +#[tokio::test] +async fn prod_estimate_fee_rate_works() { + let client = reqwest::Client::new(); + + let ans = estimate_fee_rate(&client).await.unwrap(); + more_asserts::assert_gt!(ans.sats_per_vbyte, 0.0); + + // It's not obvious from the docs that mempool.space returns a fee + // rate in sats per vbyte, so this is to help manually validate + // that. + let mempool = MempoolSpace::new("https://mempool.space".to_string(), client.clone()); + + let ans = mempool.estimate_fee_rate().await.unwrap(); + more_asserts::assert_gt!(ans.sats_per_vbyte, 0.0); +} diff --git a/signer/tests/integration/main.rs b/signer/tests/integration/main.rs index ddfcbb555..d55a29dcc 100644 --- a/signer/tests/integration/main.rs +++ b/signer/tests/integration/main.rs @@ -8,6 +8,7 @@ mod communication; mod complete_deposit; mod contracts; mod emily; +mod fees; mod postgres; mod rbf; mod request_decider; diff --git a/signer/tests/integration/postgres.rs b/signer/tests/integration/postgres.rs index 7fb7d4de4..1f3e747a1 100644 --- a/signer/tests/integration/postgres.rs +++ b/signer/tests/integration/postgres.rs @@ -70,7 +70,6 @@ use crate::setup::TestSignerSet; use crate::setup::TestSweepSetup; use crate::setup::TestSweepSetup2; -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn should_be_able_to_query_bitcoin_blocks() { let mut store = testing::storage::new_test_database().await; @@ -140,7 +139,6 @@ impl AsContractCall for InitiateWithdrawalRequest { /// Test that the write_stacks_blocks function does what it is supposed to /// do, which is store all stacks blocks and store the transactions that we /// care about, which, naturally, are sBTC related transactions. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[test_case(ContractCallWrapper(InitiateWithdrawalRequest { deployer: *testing::wallet::WALLET.0.address(), }); "initiate-withdrawal")] @@ -273,7 +271,6 @@ async fn writing_stacks_blocks_works(contract: ContractCallWr /// Here we test that the DbRead::stacks_block_exists function works, while /// implicitly testing the DbWrite::write_stacks_blocks function for the /// PgStore type -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn checking_stacks_blocks_exists_works() { let store = testing::storage::new_test_database().await; @@ -314,7 +311,6 @@ async fn checking_stacks_blocks_exists_works() { /// This ensures that the postgres store and the in memory stores returns equivalent results /// when fetching pending deposit requests -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn should_return_the_same_pending_deposit_requests_as_in_memory_store() { let mut pg_store = testing::storage::new_test_database().await; @@ -376,7 +372,6 @@ async fn should_return_the_same_pending_deposit_requests_as_in_memory_store() { /// Test that [`DbRead::get_pending_deposit_requests`] returns deposit /// requests that do not have a vote on them yet. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn get_pending_deposit_requests_only_pending() { let db = testing::storage::new_test_database().await; @@ -429,7 +424,6 @@ async fn get_pending_deposit_requests_only_pending() { /// Test that [`DbRead::get_pending_withdrawal_requests`] returns /// withdrawal requests that do not have a vote on them yet. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn get_pending_withdrawal_requests_only_pending() { let db = testing::storage::new_test_database().await; @@ -481,7 +475,6 @@ async fn get_pending_withdrawal_requests_only_pending() { /// This ensures that the postgres store and the in memory stores returns equivalent results /// when fetching pending withdraw requests -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn should_return_the_same_pending_withdraw_requests_as_in_memory_store() { let mut pg_store = testing::storage::new_test_database().await; @@ -558,7 +551,6 @@ async fn should_return_the_same_pending_withdraw_requests_as_in_memory_store() { /// This ensures that the postgres store and the in memory stores returns equivalent results /// when fetching pending accepted deposit requests -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn should_return_the_same_pending_accepted_deposit_requests_as_in_memory_store() { let mut pg_store = testing::storage::new_test_database().await; @@ -623,7 +615,6 @@ async fn should_return_the_same_pending_accepted_deposit_requests_as_in_memory_s /// This ensures that the postgres store and the in memory stores returns equivalent results /// when fetching pending accepted withdraw requests -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn should_return_the_same_pending_accepted_withdraw_requests_as_in_memory_store() { let mut pg_store = testing::storage::new_test_database().await; @@ -690,7 +681,6 @@ async fn should_return_the_same_pending_accepted_withdraw_requests_as_in_memory_ } /// This tests that when fetching pending accepted deposits we ingore swept ones. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn should_not_return_swept_deposits_as_pending_accepted() { let db = testing::storage::new_test_database().await; @@ -766,7 +756,6 @@ async fn should_not_return_swept_deposits_as_pending_accepted() { /// /// TODO(#751): Add a test to ensure that the locktime buffer is interpreted the same way during /// DepositRequestReport validation and the get pending accepted deposits database accessor function. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn should_return_only_accepted_pending_deposits_that_are_within_reclaim_bounds() { let mut pg_store = testing::storage::new_test_database().await; @@ -953,7 +942,6 @@ async fn should_return_only_accepted_pending_deposits_that_are_within_reclaim_bo /// This ensures that the postgres store and the in memory stores returns /// equivalent results when fetching pending the last key rotation. /// TODO(415): Make this robust to multiple key rotations. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn should_return_the_same_last_key_rotation_as_in_memory_store() { let mut pg_store = testing::storage::new_test_database().await; @@ -1026,7 +1014,6 @@ async fn should_return_the_same_last_key_rotation_as_in_memory_store() { /// Here we test that we can store deposit request model objects. We also /// test that if we attempt to write another deposit request then we do not /// write it and that we do not error. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn writing_deposit_requests_postgres() { let store = testing::storage::new_test_database().await; @@ -1070,7 +1057,6 @@ async fn writing_deposit_requests_postgres() { /// transaction model objects. We also test that if we attempt to write /// duplicate transactions then we do not write it and that we do not /// error. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn writing_transactions_postgres() { let store = testing::storage::new_test_database().await; @@ -1139,7 +1125,6 @@ async fn writing_transactions_postgres() { } /// Here we test that we can store completed deposit events. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn writing_completed_deposit_requests_postgres() { let store = testing::storage::new_test_database().await; @@ -1176,7 +1161,6 @@ async fn writing_completed_deposit_requests_postgres() { } /// Here we test that we can store withdrawal-create events. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn writing_withdrawal_create_requests_postgres() { let store = testing::storage::new_test_database().await; @@ -1224,7 +1208,6 @@ async fn writing_withdrawal_create_requests_postgres() { } /// Here we test that we can store withdrawal-accept events. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn writing_withdrawal_accept_requests_postgres() { let store = testing::storage::new_test_database().await; @@ -1266,7 +1249,6 @@ async fn writing_withdrawal_accept_requests_postgres() { } /// Here we test that we can store withdrawal-reject events. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn writing_withdrawal_reject_requests_postgres() { let store = testing::storage::new_test_database().await; @@ -1305,7 +1287,6 @@ async fn writing_withdrawal_reject_requests_postgres() { /// for the specific aggregate key. This includes "implicit" votes where we /// got no response from a particular signer but so we assume that they /// vote to reject the transaction. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn fetching_deposit_request_votes() { // So we have 7 signers, but we will only receive votes from 4 of them. @@ -1405,7 +1386,6 @@ async fn fetching_deposit_request_votes() { /// keys for the specific aggregate key. This includes "implicit" votes /// where we got no response from a particular signer but so we assume that /// they vote to reject the transaction. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn fetching_withdrawal_request_votes() { // So we have 7 signers, but we will only receive votes from 4 of them. @@ -1514,7 +1494,6 @@ async fn fetching_withdrawal_request_votes() { /// For this test we check that the `block_in_canonical_bitcoin_blockchain` /// function returns false when the input block is not in the canonical /// bitcoin blockchain. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn block_in_canonical_bitcoin_blockchain_in_other_block_chain() { let pg_store = testing::storage::new_test_database().await; @@ -1588,7 +1567,6 @@ async fn block_in_canonical_bitcoin_blockchain_in_other_block_chain() { /// For this test we check that the `get_bitcoin_tx` function returns a /// transaction when the transaction exists in the block, and returns None /// otherwise. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn we_can_fetch_bitcoin_txs_from_db() { let pg_store = testing::storage::new_test_database().await; @@ -1645,7 +1623,6 @@ async fn we_can_fetch_bitcoin_txs_from_db() { /// Check that `is_signer_script_pub_key` correctly returns whether a /// scriptPubKey value exists in the dkg_shares table. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn is_signer_script_pub_key_checks_dkg_shares_for_script_pubkeys() { let db = testing::storage::new_test_database().await; @@ -1689,7 +1666,6 @@ async fn is_signer_script_pub_key_checks_dkg_shares_for_script_pubkeys() { /// fetch the last 365 days worth of scriptPubKeys, but if there are no new /// encrypted shares in the database in a year, we should still return the /// most recent one. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn get_signers_script_pubkeys_returns_non_empty_vec_old_rows() { let db = testing::storage::new_test_database().await; @@ -1732,7 +1708,6 @@ async fn get_signers_script_pubkeys_returns_non_empty_vec_old_rows() { /// The [`DbRead::get_last_encrypted_dkg_shares`] function is supposed to /// fetch the last encrypted DKG shares stored in the database. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn get_last_encrypted_dkg_shares_gets_most_recent_shares() { let db = testing::storage::new_test_database().await; @@ -1780,7 +1755,6 @@ async fn get_last_encrypted_dkg_shares_gets_most_recent_shares() { /// The [`DbRead::deposit_request_exists`] function is return true we have /// a record of the deposit request and false otherwise. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn deposit_request_exists_works() { let db = testing::storage::new_test_database().await; @@ -1806,7 +1780,6 @@ async fn deposit_request_exists_works() { /// Check that is_known_bitcoin_block_hash correctly reports whether a /// given block is in the database. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn is_known_bitcoin_block_hash_works() { let db = testing::storage::new_test_database().await; @@ -1853,7 +1826,6 @@ async fn is_known_bitcoin_block_hash_works() { /// This tests that deposit requests where there is an associated sweep /// transaction will show up in the query results from /// [`DbRead::get_swept_deposit_requests`]. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn get_swept_deposit_requests_returns_swept_deposit_requests() { let db = testing::storage::new_test_database().await; @@ -1914,7 +1886,6 @@ async fn get_swept_deposit_requests_returns_swept_deposit_requests() { /// This function tests that deposit requests that do not have a confirmed /// response (sweep) bitcoin transaction are not returned from /// [`DbRead::get_swept_deposit_requests`]. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn get_swept_deposit_requests_does_not_return_unswept_deposit_requests() { let db = testing::storage::new_test_database().await; @@ -1965,7 +1936,6 @@ async fn get_swept_deposit_requests_does_not_return_unswept_deposit_requests() { /// We use two sweep setups: we add confirming events to both but for one /// of them the event is not in the canonical chain, then we push another event /// (on the canonical chain) resulting in both being confirmed on the canonical chain. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn get_swept_deposit_requests_does_not_return_deposit_requests_with_responses() { let db = testing::storage::new_test_database().await; @@ -2111,7 +2081,6 @@ async fn get_swept_deposit_requests_does_not_return_deposit_requests_with_respon /// returns Some(true) if the caller is part of the signing set, /// Some(false) if it isn't and None if the deposit request record cannot /// be found. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn can_sign_deposit_tx_rejects_not_in_signer_set() { let db = testing::storage::new_test_database().await; @@ -2172,7 +2141,6 @@ async fn can_sign_deposit_tx_rejects_not_in_signer_set() { /// function return requests where we have already confirmed a /// `complete-deposit` contract call transaction on the Stacks blockchain /// but that transaction has been reorged while the sweep transaction has not. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn get_swept_deposit_requests_response_tx_reorged() { let db = testing::storage::new_test_database().await; @@ -2296,7 +2264,6 @@ async fn transaction_coordinator_test_environment( } } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[test(tokio::test)] /// Tests that TxCoordinatorEventLoop::get_pending_requests ignores withdrawals async fn should_ignore_withdrawals() { @@ -2310,7 +2277,6 @@ async fn should_ignore_withdrawals() { testing::storage::drop_db(store).await; } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn should_get_signer_utxo_simple() { let store = testing::storage::new_test_database().await; @@ -2323,7 +2289,6 @@ async fn should_get_signer_utxo_simple() { signer::testing::storage::drop_db(store).await; } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn should_get_signer_utxo_fork() { let store = testing::storage::new_test_database().await; @@ -2336,7 +2301,6 @@ async fn should_get_signer_utxo_fork() { signer::testing::storage::drop_db(store).await; } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn should_get_signer_utxo_unspent() { let store = testing::storage::new_test_database().await; @@ -2349,7 +2313,6 @@ async fn should_get_signer_utxo_unspent() { signer::testing::storage::drop_db(store).await; } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn should_get_signer_utxo_donations() { let store = testing::storage::new_test_database().await; @@ -2378,7 +2341,6 @@ async fn should_get_signer_utxo_donations() { /// Check the expected report if the deposit request and transaction are in /// the database, but this signers vote is missing and the transaction is /// confirmed on the wrong blockchain. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn deposit_report_with_only_deposit_request() { let db = testing::storage::new_test_database().await; @@ -2478,7 +2440,6 @@ async fn deposit_report_with_only_deposit_request() { /// [`deposit_report_with_only_deposit_request`] is that we write the /// signer decision to the database here and check that it gets reproduced /// in the report. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn deposit_report_with_deposit_request_reorged() { let db = testing::storage::new_test_database().await; @@ -2553,7 +2514,6 @@ async fn deposit_report_with_deposit_request_reorged() { /// Check that if the deposit has been included in a sweep transaction /// then the deposit report states that the deposit has been spent in the /// status. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn deposit_report_with_deposit_request_spent() { let db = testing::storage::new_test_database().await; @@ -2651,7 +2611,6 @@ async fn deposit_report_with_deposit_request_spent() { /// Check that if the deposit has been included in a sweep transaction /// that gets reorged, then the deposit report states that the deposit is /// confirmed and not spent. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn deposit_report_with_deposit_request_swept_but_swept_reorged() { let db = testing::storage::new_test_database().await; @@ -2782,7 +2741,6 @@ async fn deposit_report_with_deposit_request_swept_but_swept_reorged() { /// Check when we have a deposit that has been confirmed on the canonical /// bitcoin and hasn't been spent, that the deposit report has the /// appropriate "Confirmed" status. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn deposit_report_with_deposit_request_confirmed() { let db = testing::storage::new_test_database().await; @@ -2858,7 +2816,6 @@ async fn deposit_report_with_deposit_request_confirmed() { signer::testing::storage::drop_db(db).await; } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn can_write_and_get_multiple_bitcoin_txs_sighashes() { let db = testing::storage::new_test_database().await; @@ -2880,7 +2837,6 @@ async fn can_write_and_get_multiple_bitcoin_txs_sighashes() { signer::testing::storage::drop_db(db).await; } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn can_write_multiple_bitcoin_withdrawal_outputs() { let db = testing::storage::new_test_database().await; @@ -2894,7 +2850,6 @@ async fn can_write_multiple_bitcoin_withdrawal_outputs() { signer::testing::storage::drop_db(db).await; } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn get_deposit_request_returns_none_for_missing_deposit() { let db = testing::storage::new_test_database().await; @@ -2912,7 +2867,6 @@ async fn get_deposit_request_returns_none_for_missing_deposit() { signer::testing::storage::drop_db(db).await; } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn get_deposit_request_returns_returns_inserted_deposit_request() { let db = testing::storage::new_test_database().await; @@ -2980,7 +2934,6 @@ impl ReorgDescription { /// blockchain in the database, so that it is the best chain. /// 5. Get the signers' UTXO and check that the transaction ID matches the /// one expected. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[test_case(ReorgDescription { sweep_heights: [0, 3, 4, 5], reorg_height: 4, diff --git a/signer/tests/integration/rbf.rs b/signer/tests/integration/rbf.rs index edccb1afa..b81c19c0a 100644 --- a/signer/tests/integration/rbf.rs +++ b/signer/tests/integration/rbf.rs @@ -131,7 +131,6 @@ struct RbfContext { /// fees paid for the last successfully submitted transaction to /// construct and submit an RBF transaction. /// 4. Check that the withdrawal recipients have the expected balance. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[test_case::test_matrix( [5, 0, 9], [5, 0, 9], diff --git a/signer/tests/integration/request_decider.rs b/signer/tests/integration/request_decider.rs index ee8397cf4..4d58af64b 100644 --- a/signer/tests/integration/request_decider.rs +++ b/signer/tests/integration/request_decider.rs @@ -67,7 +67,6 @@ async fn create_signer_database() -> PgStore { signer::testing::storage::new_test_database().await } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn should_store_decisions_for_pending_deposit_requests() { let num_signers = 3; @@ -84,7 +83,6 @@ async fn should_store_decisions_for_pending_deposit_requests() { signer::testing::storage::drop_db(db).await; } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn should_store_decisions_for_pending_withdraw_requests() { let num_signers = 3; @@ -101,7 +99,6 @@ async fn should_store_decisions_for_pending_withdraw_requests() { signer::testing::storage::drop_db(db).await; } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn should_store_decisions_received_from_other_signers() { let num_signers = 3; @@ -121,7 +118,6 @@ async fn should_store_decisions_received_from_other_signers() { /// Test that [`TxSignerEventLoop::handle_pending_deposit_request`] does /// not error when attempting to check the scriptPubKeys of the /// inputs of a deposit. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn handle_pending_deposit_request_address_script_pub_key() { let db = testing::storage::new_test_database().await; @@ -206,7 +202,6 @@ async fn handle_pending_deposit_request_address_script_pub_key() { /// Test that [`RequestDeciderEventLoop::handle_pending_deposit_request`] /// will write the can_sign field to be false if the current signer is not /// part of the signing set locking the deposit transaction. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn handle_pending_deposit_request_not_in_signing_set() { let db = testing::storage::new_test_database().await; @@ -292,7 +287,6 @@ async fn handle_pending_deposit_request_not_in_signing_set() { /// Test that /// [`RequestDeciderEventLoop::persist_received_deposit_decision`] will /// fetch the deposit request from emily if does not have a record of it. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn persist_received_deposit_decision_fetches_missing_deposit_requests() { let db = testing::storage::new_test_database().await; diff --git a/signer/tests/integration/rotate_keys.rs b/signer/tests/integration/rotate_keys.rs index 35e754565..1c5469395 100644 --- a/signer/tests/integration/rotate_keys.rs +++ b/signer/tests/integration/rotate_keys.rs @@ -162,7 +162,6 @@ fn make_rotate_key(setup: &TestRotateKeySetup) -> (RotateKeysV1, ReqContext) { (rotate_key, req_ctx) } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn rotate_key_validation_happy_path() { // Normal: preamble @@ -212,7 +211,6 @@ async fn rotate_key_validation_happy_path() { testing::storage::drop_db(db).await; } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn rotate_key_validation_no_dkg() { // Normal: preamble @@ -250,7 +248,6 @@ async fn rotate_key_validation_no_dkg() { testing::storage::drop_db(db).await; } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn rotate_key_validation_wrong_deployer() { // Normal: preamble @@ -294,7 +291,6 @@ async fn rotate_key_validation_wrong_deployer() { testing::storage::drop_db(db).await; } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn rotate_key_validation_wrong_signing_set() { // Normal: preamble @@ -344,7 +340,6 @@ async fn rotate_key_validation_wrong_signing_set() { testing::storage::drop_db(db).await; } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn rotate_key_validation_wrong_aggregate_key() { // Normal: preamble @@ -394,7 +389,6 @@ async fn rotate_key_validation_wrong_aggregate_key() { testing::storage::drop_db(db).await; } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn rotate_key_validation_wrong_signatures_required() { // Normal: preamble @@ -449,7 +443,6 @@ async fn rotate_key_validation_wrong_signatures_required() { testing::storage::drop_db(db).await; } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn rotate_key_validation_replay() { // Normal: preamble diff --git a/signer/tests/integration/stacks_events_observer.rs b/signer/tests/integration/stacks_events_observer.rs index 5cf82ba68..0c2f99832 100644 --- a/signer/tests/integration/stacks_events_observer.rs +++ b/signer/tests/integration/stacks_events_observer.rs @@ -96,7 +96,6 @@ where /// Test that the handler can handle a new block event with a valid payload /// that contains a CompletedDeposit event. /// The handler should update the chain state in Emily and mark the deposit as confirmed. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn test_new_blocks_sends_update_deposits_to_emily() { let context = test_context().await; @@ -161,7 +160,6 @@ async fn test_new_blocks_sends_update_deposits_to_emily() { /// Test that the handler can handle a new block event with a valid payload /// that contains a WithdrawalCreate event. /// The handler should update the chain state in Emily and mark the withdrawal as pending. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn test_new_blocks_sends_create_withdrawal_request() { let context = test_context().await; @@ -193,7 +191,6 @@ async fn test_new_blocks_sends_create_withdrawal_request() { /// Test that the handler can handle a new block event with a valid payload /// that contains a WithdrawalAccept event. /// The handler should update the chain state in Emily and mark the withdrawal as confirmed. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn test_new_blocks_sends_withdrawal_accept_update() { let context = test_context().await; @@ -238,7 +235,6 @@ async fn test_new_blocks_sends_withdrawal_accept_update() { /// Test that the handler can handle a new block event with a valid payload /// that contains a WithdrawalReject event. /// The handler should update the chain state in Emily and mark the withdrawal as failed. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn test_new_blocks_sends_withdrawal_reject_update() { let context = test_context().await; diff --git a/signer/tests/integration/transaction_coordinator.rs b/signer/tests/integration/transaction_coordinator.rs index bb255be6a..3d7c7a471 100644 --- a/signer/tests/integration/transaction_coordinator.rs +++ b/signer/tests/integration/transaction_coordinator.rs @@ -421,7 +421,6 @@ fn mock_recover_and_deploy_all_contracts_after_failure( }) } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[test(tokio::test)] async fn process_complete_deposit() { let db = testing::storage::new_test_database().await; @@ -786,7 +785,6 @@ async fn deploy_smart_contracts_coordinator( /// /// This tests that we prefer rotate keys transactions if it's available /// but will use the DKG shares behavior is indeed the case. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn get_signer_public_keys_and_aggregate_key_falls_back() { let db = testing::storage::new_test_database().await; @@ -915,7 +913,6 @@ async fn get_signer_public_keys_and_aggregate_key_falls_back() { /// Some of the preconditions for this test to run successfully includes /// having bootstrap public keys that align with the [`Keypair`] returned /// from the [`testing::wallet::regtest_bootstrap_wallet`] function. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn run_dkg_from_scratch() { let mut rng = rand::rngs::StdRng::seed_from_u64(51); @@ -1133,7 +1130,6 @@ async fn run_dkg_from_scratch() { /// This test is very similar to the `run_dkg_from_scratch` test, but it /// simulates that DKG has been run once before and uses a signer configuration /// that allows for multiple DKG rounds. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[test(tokio::test)] async fn run_subsequent_dkg() { let mut rng = rand::rngs::StdRng::seed_from_u64(51); @@ -1398,7 +1394,6 @@ async fn run_subsequent_dkg() { /// ``` /// /// then, once everything is up and running, run the test. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn sign_bitcoin_transaction() { let (_, signer_key_pairs): (_, [Keypair; 3]) = testing::wallet::regtest_bootstrap_wallet(); @@ -1827,7 +1822,6 @@ async fn sign_bitcoin_transaction() { /// ``` /// /// then, once everything is up and running, run the test. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn sign_bitcoin_transaction_multiple_locking_keys() { let (_, signer_key_pairs): (_, [Keypair; 3]) = testing::wallet::regtest_bootstrap_wallet(); @@ -2443,7 +2437,6 @@ async fn sign_bitcoin_transaction_multiple_locking_keys() { /// Check that we do not try to deploy the smart contracts or rotate keys /// if we think things are up-to-date. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn skip_smart_contract_deployment_and_key_rotation_if_up_to_date() { let (_, signer_key_pairs): (_, [Keypair; 3]) = testing::wallet::regtest_bootstrap_wallet(); @@ -2759,7 +2752,6 @@ async fn wait_for_signers(signers: &[(IntegrationTestContext, PgStore, &Keypair, /// This test asserts that the `get_btc_state` function returns the correct /// `SignerBtcState` when there are no sweep transactions available, i.e. /// the `last_fees` field should be `None`. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[test(tokio::test)] async fn test_get_btc_state_with_no_available_sweep_transactions() { let mut rng = rand::rngs::StdRng::seed_from_u64(46); @@ -2894,7 +2886,6 @@ async fn test_get_btc_state_with_no_available_sweep_transactions() { /// This test asserts that the `get_btc_state` function returns the correct /// `SignerBtcState` when there are multiple outstanding sweep transaction /// packages available, simulating the case where there has been an RBF. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[test(tokio::test)] async fn test_get_btc_state_with_available_sweep_transactions_and_rbf() { let mut rng = rand::rngs::StdRng::seed_from_u64(46); @@ -3169,7 +3160,6 @@ fn create_test_setup( /// If the default limits are permissive (ie, default all `None`), they will /// happily mint anything. If the limits are conservative, they will refuse to /// mint (eg, `would exceed sBTC supply cap`). -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn test_conservative_initial_sbtc_limits() { let (rpc, faucet) = regtest::initialize_blockchain(); diff --git a/signer/tests/integration/transaction_signer.rs b/signer/tests/integration/transaction_signer.rs index f975cc7d6..23029bced 100644 --- a/signer/tests/integration/transaction_signer.rs +++ b/signer/tests/integration/transaction_signer.rs @@ -52,7 +52,6 @@ use crate::setup::TestSweepSetup2; /// Test that [`TxSignerEventLoop::get_signer_public_keys`] falls back to /// the bootstrap config if there is no rotate-keys transaction in the /// database. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn get_signer_public_keys_and_aggregate_key_falls_back() { let db = testing::storage::new_test_database().await; @@ -145,7 +144,6 @@ async fn get_signer_public_keys_and_aggregate_key_falls_back() { /// Test that [`TxSignerEventLoop::assert_valid_stacks_tx_sign_request`] /// errors when the signer is not in the signer set. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn signing_set_validation_check_for_stacks_transactions() { let db = testing::storage::new_test_database().await; @@ -223,7 +221,6 @@ async fn signing_set_validation_check_for_stacks_transactions() { testing::storage::drop_db(db).await; } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] pub async fn assert_should_be_able_to_handle_sbtc_requests() { let db = testing::storage::new_test_database().await; @@ -348,7 +345,6 @@ pub async fn assert_should_be_able_to_handle_sbtc_requests() { testing::storage::drop_db(db).await; } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn new_state_machine_per_valid_sighash() { let db = testing::storage::new_test_database().await; @@ -478,7 +474,6 @@ async fn new_state_machine_per_valid_sighash() { testing::storage::drop_db(db).await; } -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn max_one_state_machine_per_bitcoin_block_hash_for_dkg() { let db = testing::storage::new_test_database().await; diff --git a/signer/tests/integration/utxo_construction.rs b/signer/tests/integration/utxo_construction.rs index b197432de..7e9762af9 100644 --- a/signer/tests/integration/utxo_construction.rs +++ b/signer/tests/integration/utxo_construction.rs @@ -126,7 +126,6 @@ where /// This test just checks that many of the methods on the Recipient struct /// work as advertised. #[test] -#[cfg_attr(not(feature = "integration-tests"), ignore)] fn helper_struct_methods_work() { let (rpc, faucet) = regtest::initialize_blockchain(); let signer = Recipient::new(AddressType::P2tr); @@ -164,7 +163,6 @@ fn helper_struct_methods_work() { /// Check that deposits, when sent with the expected format, are /// spent using the transactions generated in the utxo module. #[test] -#[cfg_attr(not(feature = "integration-tests"), ignore)] fn deposits_add_to_controlled_amounts() { let (rpc, faucet) = regtest::initialize_blockchain(); let fee = regtest::BITCOIN_CORE_FALLBACK_FEE.to_sat(); @@ -250,7 +248,6 @@ fn deposits_add_to_controlled_amounts() { } #[test] -#[cfg_attr(not(feature = "integration-tests"), ignore)] fn withdrawals_reduce_to_signers_amounts() { const FEE_RATE: f64 = 10.0; diff --git a/signer/tests/integration/withdrawal_accept.rs b/signer/tests/integration/withdrawal_accept.rs index 6b1402cb7..15ed18d0b 100644 --- a/signer/tests/integration/withdrawal_accept.rs +++ b/signer/tests/integration/withdrawal_accept.rs @@ -82,7 +82,6 @@ fn make_withdrawal_accept(data: &TestSweepSetup) -> (AcceptWithdrawalV1, ReqCont /// For this test we check that the `AcceptWithdrawalV1::validate` function /// returns okay when everything matches the way that it is supposed to. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn accept_withdrawal_validation_happy_path() { // Normal: this generates the blockchain as well as a transaction @@ -132,7 +131,6 @@ async fn accept_withdrawal_validation_happy_path() { /// For this test we check that the `AcceptWithdrawalV1::validate` function /// returns a withdrawal validation error with a DeployerMismatch message /// when the deployer doesn't match but everything else is okay. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn accept_withdrawal_validation_deployer_mismatch() { // Normal: this generates the blockchain as well as a transaction @@ -190,7 +188,6 @@ async fn accept_withdrawal_validation_deployer_mismatch() { /// returns a withdrawal validation error with a RequestMissing message /// when the signer does not have a record of the withdrawal request /// doesn't match but everything else is okay. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn accept_withdrawal_validation_missing_withdrawal_request() { // Normal: this generates the blockchain as well as a transaction @@ -249,7 +246,6 @@ async fn accept_withdrawal_validation_missing_withdrawal_request() { /// returns a withdrawal validation error with a RecipientMismatch message /// when the recipient in the complete-withdrawal transaction does not /// match the recipient in our records. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn accept_withdrawal_validation_recipient_mismatch() { // Normal: this generates the blockchain as well as a transaction @@ -308,7 +304,6 @@ async fn accept_withdrawal_validation_recipient_mismatch() { /// returns a withdrawal validation error with a InvalidAmount message /// when the amount of sBTC to mint exceeds the amount in the signer's /// withdrawal request record. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn accept_withdrawal_validation_invalid_amount() { // Normal: this generates the blockchain as well as a transaction @@ -365,7 +360,6 @@ async fn accept_withdrawal_validation_invalid_amount() { /// returns a withdrawal validation error with a InvalidFee message when /// the amount of sBTC to mint is less than the `amount - max-fee` from in /// the signer's withdrawal request record. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn accept_withdrawal_validation_invalid_fee() { // Normal: this generates the blockchain as well as a transaction @@ -424,7 +418,6 @@ async fn accept_withdrawal_validation_invalid_fee() { /// returns a withdrawal validation error with a SweepTransactionMissing /// message when the signer does not have a record of the sweep /// transaction. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn accept_withdrawal_validation_sweep_tx_missing() { // Normal: this generates the blockchain as well as a transaction @@ -485,7 +478,6 @@ async fn accept_withdrawal_validation_sweep_tx_missing() { /// returns a withdrawal validation error with a SweepTransactionReorged /// message when the sweep transaction is in our records but is not on what /// the signer thinks is the canonical bitcoin blockchain. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn accept_withdrawal_validation_sweep_reorged() { // Normal: this generates the blockchain as well as a transaction @@ -555,7 +547,6 @@ async fn accept_withdrawal_validation_sweep_reorged() { /// message when the sweep transaction is in our records, is on what the /// signer thinks is the canonical bitcoin blockchain, but it does not have /// an input that that matches the withdrawal request outpoint. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn accept_withdrawal_validation_withdrawal_not_in_sweep() { // Normal: this generates the blockchain as well as a transaction @@ -616,7 +607,6 @@ async fn accept_withdrawal_validation_withdrawal_not_in_sweep() { /// returns a withdrawal validation error with a BitmapMismatch message /// when bitmap in the transaction does not match what our records would /// create for the bitmap. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn accept_withdrawal_validation_bitmap_mismatch() { // Normal: this generates the blockchain as well as a transaction @@ -676,7 +666,6 @@ async fn accept_withdrawal_validation_bitmap_mismatch() { /// the sweep transaction is in our records, is on what the signer thinks /// is the canonical bitcoin blockchain, but the supplied transaction /// object does not have what we think should be the correct fee. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn accept_withdrawal_validation_withdrawal_incorrect_fee() { // Normal: this generates the blockchain as well as a transaction @@ -734,7 +723,6 @@ async fn accept_withdrawal_validation_withdrawal_incorrect_fee() { /// returns a withdrawal validation error with a InvalidSweep message when /// the sweep transaction does not have a prevout with a scriptPubKey that /// the signers control. -#[cfg_attr(not(feature = "integration-tests"), ignore)] #[tokio::test] async fn accept_withdrawal_validation_withdrawal_invalid_sweep() { // Normal: this generates the blockchain as well as a transaction diff --git a/signer/tests/integration/zmq.rs b/signer/tests/integration/zmq.rs index 1f2f43fd3..977230c5d 100644 --- a/signer/tests/integration/zmq.rs +++ b/signer/tests/integration/zmq.rs @@ -10,7 +10,6 @@ pub const BITCOIN_CORE_ZMQ_ENDPOINT: &str = "tcp://localhost:28332"; /// bitcoin-core as it receives them. We create the stream, generate /// bitcoin blocks, and wait for the blocks to be received from the stream. #[tokio::test] -#[cfg_attr(not(feature = "integration-tests"), ignore)] async fn block_stream_streams_blocks() { let (_, faucet) = regtest::initialize_blockchain(); @@ -64,7 +63,6 @@ async fn block_stream_streams_blocks() { /// stream. This also checks that we parse block hashes correctly, since /// they are supposed to be little-endian formatted. #[tokio::test] -#[cfg_attr(not(feature = "integration-tests"), ignore)] async fn block_hash_stream_streams_block_hashes() { let (_, faucet) = regtest::initialize_blockchain();