Skip to content

Fix current swap-core unit tests#1007

Open
dennywu2966 wants to merge 1 commit into
eigenwallet:masterfrom
dennywu2966:fix-broken-swap-tests
Open

Fix current swap-core unit tests#1007
dennywu2966 wants to merge 1 commit into
eigenwallet:masterfrom
dennywu2966:fix-broken-swap-tests

Conversation

@dennywu2966
Copy link
Copy Markdown

Refs #724

Problem:

  • swap-core unit tests still failed when the test wallet was used through dyn BitcoinWallet; helper methods in the test wallet impl still panicked instead of calling the real wallet code.
  • parse_monero_overflows expected an old custom overflow error, while Amount::parse_monero now returns the current generic error.

Changes:

  • Delegate the Wallet<Connection, StaticFeeRate> test-wallet trait methods used by the unit tests to the existing wallet implementations.
  • Update the Monero overflow assertion to match the current parser error.

Verification:

  • cargo test -p swap-core --lib -> 68 passed.
  • cargo test --no-fail-fast -p swap-core -p swap-feed -p swap-orchestrator -> passed for all targets in that group.
  • rustfmt --edition 2024 --check bitcoin-wallet/src/wallet.rs swap-core/src/monero/primitives.rs -> passed.
  • git diff --check -> passed.

Local verification note: Cargo could not fetch the Arti arti-corpora submodule from GitLab in this environment, so the cargo test runs used a temporary local path override for the cached Arti checkout. That override is not part of this PR. I also tried cargo test -p swap-asb; it did not reach repo tests because the local Monero submodules could not be fetched from GitHub after retries.

AI assistance: OpenAI Codex helped prepare and test this patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant