Skip to content

Commit bae5b6a

Browse files
authored
fix: resolve random failure of cross-chain swap E2E test (#2369)
* fix random failure of crosschain swap E2E test * added changelog entry
1 parent f9ca2be commit bae5b6a

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

changelog.md

+1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
* [2299](https://github.com/zeta-chain/node/pull/2299) - add `zetae2e` command to deploy test contracts
6767
* [2360](https://github.com/zeta-chain/node/pull/2360) - add stateful e2e tests.
6868
* [2349](https://github.com/zeta-chain/node/pull/2349) - add TestBitcoinDepositRefund and WithdrawBitcoinMultipleTimes E2E tests
69+
* [2369](https://github.com/zeta-chain/node/pull/2369) - fix random cross-chain swap failure caused by using tiny UTXO
6970

7071
### Fixes
7172

e2e/runner/bitcoin.go

+11
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,17 @@ func (runner *E2ERunner) ListDeployerUTXOs() ([]btcjson.ListUnspentResult, error
4141
return nil, err
4242
}
4343

44+
// filter big-enough UTXOs for test if running on Regtest
45+
if runner.IsLocalBitcoin() {
46+
utxosFiltered := []btcjson.ListUnspentResult{}
47+
for _, utxo := range utxos {
48+
if utxo.Amount >= 1.0 {
49+
utxosFiltered = append(utxosFiltered, utxo)
50+
}
51+
}
52+
return utxosFiltered, nil
53+
}
54+
4455
return utxos, nil
4556
}
4657

0 commit comments

Comments
 (0)