44package c
55
66import (
7- "errors"
87 "math/big"
98 "strings"
109
@@ -16,8 +15,6 @@ import (
1615 "github.com/ethereum/go-ethereum/common"
1716
1817 "github.com/ava-labs/coreth/core/types"
19- "github.com/ava-labs/coreth/ethclient"
20- "github.com/ava-labs/coreth/interfaces"
2118 "github.com/ava-labs/coreth/params"
2219 "github.com/ava-labs/coreth/plugin/evm"
2320
@@ -76,8 +73,7 @@ var _ = e2e.DescribeCChainSerial("[Dynamic Fees]", func() {
7673
7774 // Send the transaction and wait for acceptance
7875 signedTx := sign (tx )
79- require .NoError (ethClient .SendTransaction (e2e .DefaultContext (), signedTx ))
80- receipt := awaitTransaction (ethClient , signedTx )
76+ receipt := e2e .SendEthTransaction (ethClient , signedTx )
8177
8278 contractAddress = receipt .ContractAddress
8379 })
@@ -119,8 +115,7 @@ var _ = e2e.DescribeCChainSerial("[Dynamic Fees]", func() {
119115
120116 // Send the transaction and wait for acceptance
121117 signedTx := sign (tx )
122- require .NoError (ethClient .SendTransaction (e2e .DefaultContext (), signedTx ))
123- _ = awaitTransaction (ethClient , signedTx )
118+ _ = e2e .SendEthTransaction (ethClient , signedTx )
124119
125120 // The gas price will be checked at the start of the next iteration
126121 return false
@@ -159,30 +154,9 @@ var _ = e2e.DescribeCChainSerial("[Dynamic Fees]", func() {
159154
160155 // Send the transaction and wait for acceptance
161156 signedTx := sign (tx )
162- require .NoError (ethClient .SendTransaction (e2e .DefaultContext (), signedTx ))
163- _ = awaitTransaction (ethClient , signedTx )
157+ e2e .SendEthTransaction (ethClient , signedTx )
164158 })
165159
166160 e2e .CheckBootstrapIsPossible (e2e .Env .GetNetwork ())
167161 })
168162})
169-
170- // Waits for the transaction receipt to be issued and checks that it indicates success.
171- func awaitTransaction (ethClient ethclient.Client , signedTx * types.Transaction ) * types.Receipt {
172- require := require .New (ginkgo .GinkgoT ())
173-
174- var receipt * types.Receipt
175- e2e .Eventually (func () bool {
176- var err error
177- receipt , err = ethClient .TransactionReceipt (e2e .DefaultContext (), signedTx .Hash ())
178- if errors .Is (err , interfaces .NotFound ) {
179- return false // Transaction is still pending
180- }
181- require .NoError (err )
182- return true
183- }, e2e .DefaultTimeout , e2e .DefaultPollingInterval , "failed to see transaction acceptance before timeout" )
184-
185- // Retrieve the contract address
186- require .Equal (receipt .Status , types .ReceiptStatusSuccessful )
187- return receipt
188- }
0 commit comments