diff --git a/e2e/e2etests/test_crosschain_swap.go b/e2e/e2etests/test_crosschain_swap.go index 34aa6e3d23..15c2918189 100644 --- a/e2e/e2etests/test_crosschain_swap.go +++ b/e2e/e2etests/test_crosschain_swap.go @@ -119,6 +119,10 @@ func TestCrosschainSwap(r *runner.E2ERunner, _ []string) { r.Logger.Info("cctx2 outbound tx hash %s", cctx2.GetCurrentOutTxParam().OutboundTxHash) r.Logger.Info("******* Second test: BTC -> ERC20ZRC20") + + // wait a few seconds before listing utxos + time.Sleep(5 * time.Second) + utxos, err := r.BtcRPCClient.ListUnspent() if err != nil { panic(err) diff --git a/e2e/runner/bitcoin.go b/e2e/runner/bitcoin.go index b393b5c0f0..ea0240af4a 100644 --- a/e2e/runner/bitcoin.go +++ b/e2e/runner/bitcoin.go @@ -240,10 +240,13 @@ func (runner *E2ERunner) SendToTSSFromDeployerWithMemo( } } - stx, err := signRawTransactionWithWallet2WithRetry(btcRPC, tx, inputsForSign) + stx, signed, err := btcRPC.SignRawTransactionWithWallet2(tx, inputsForSign) if err != nil { panic(err) } + if signed { + panic("not signed") + } txid, err := btcRPC.SendRawTransaction(stx, true) if err != nil { panic(err) @@ -404,23 +407,3 @@ func (runner *E2ERunner) ProveBTCTransaction(txHash *chainhash.Hash) { } runner.Logger.Info("OK: txProof verified for inTx: %s", txHash.String()) } - -// SignRawTransactionWithWallet2WithRetry signs a raw transaction with wallet2 and retries if it's not signed -func signRawTransactionWithWallet2WithRetry( - btcRPC *rpcclient.Client, - tx *wire.MsgTx, - inputsForSign []btcjson.RawTxWitnessInput, -) (*wire.MsgTx, error) { - for i := 0; i < 5; i++ { - stx, signed, err := btcRPC.SignRawTransactionWithWallet2(tx, inputsForSign) - if err != nil { - return nil, err - } - if signed { - return stx, nil - } - time.Sleep(2 * time.Second) - } - - return nil, fmt.Errorf("signRawTransactionWithWallet2WithRetry: not signed") -}