From bae5b6a0e3c21b10e9feddf723f4defa15bfaeb7 Mon Sep 17 00:00:00 2001 From: Charlie Chen <34498985+ws4charlie@users.noreply.github.com> Date: Fri, 21 Jun 2024 14:10:55 -0500 Subject: [PATCH] fix: resolve random failure of cross-chain swap E2E test (#2369) * fix random failure of crosschain swap E2E test * added changelog entry --- changelog.md | 1 + e2e/runner/bitcoin.go | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/changelog.md b/changelog.md index 3e1299e55d..ba3c0ed790 100644 --- a/changelog.md +++ b/changelog.md @@ -66,6 +66,7 @@ * [2299](https://github.com/zeta-chain/node/pull/2299) - add `zetae2e` command to deploy test contracts * [2360](https://github.com/zeta-chain/node/pull/2360) - add stateful e2e tests. * [2349](https://github.com/zeta-chain/node/pull/2349) - add TestBitcoinDepositRefund and WithdrawBitcoinMultipleTimes E2E tests +* [2369](https://github.com/zeta-chain/node/pull/2369) - fix random cross-chain swap failure caused by using tiny UTXO ### Fixes diff --git a/e2e/runner/bitcoin.go b/e2e/runner/bitcoin.go index d4dc3df15c..b2b82d2132 100644 --- a/e2e/runner/bitcoin.go +++ b/e2e/runner/bitcoin.go @@ -41,6 +41,17 @@ func (runner *E2ERunner) ListDeployerUTXOs() ([]btcjson.ListUnspentResult, error return nil, err } + // filter big-enough UTXOs for test if running on Regtest + if runner.IsLocalBitcoin() { + utxosFiltered := []btcjson.ListUnspentResult{} + for _, utxo := range utxos { + if utxo.Amount >= 1.0 { + utxosFiltered = append(utxosFiltered, utxo) + } + } + return utxosFiltered, nil + } + return utxos, nil }