|
| 1 | +//go:build evm |
| 2 | +// +build evm |
| 3 | + |
1 | 4 | package evm |
2 | 5 |
|
3 | 6 | import ( |
@@ -126,7 +129,7 @@ func GetRandomTransaction(t *testing.T, privateKeyHex, toAddressHex, chainID str |
126 | 129 | chainId, ok := new(big.Int).SetString(chainID, 10) |
127 | 130 | require.True(t, ok) |
128 | 131 | txValue := big.NewInt(1000000000000000000) |
129 | | - gasPrice := big.NewInt(100000000000) // Increased to 100 Gwei to handle replacement scenarios and ensure acceptance |
| 132 | + gasPrice := big.NewInt(30000000000) |
130 | 133 | toAddress := common.HexToAddress(toAddressHex) |
131 | 134 | data := make([]byte, 16) |
132 | 135 | _, err = rand.Read(data) |
@@ -156,25 +159,6 @@ func SubmitTransaction(t *testing.T, tx *types.Transaction) { |
156 | 159 | require.NoError(t, err) |
157 | 160 | } |
158 | 161 |
|
159 | | -// ClearTransactionPool attempts to clear the transaction pool by getting current nonce from blockchain |
160 | | -func ClearTransactionPool(t *testing.T, privateKeyHex string) uint64 { |
161 | | - t.Helper() |
162 | | - rpcClient, err := ethclient.Dial("http://localhost:8545") |
163 | | - require.NoError(t, err) |
164 | | - defer rpcClient.Close() |
165 | | - |
166 | | - privateKey, err := crypto.HexToECDSA(privateKeyHex) |
167 | | - require.NoError(t, err) |
168 | | - address := crypto.PubkeyToAddress(privateKey.PublicKey) |
169 | | - |
170 | | - // Get the current nonce from the latest block (not pending) |
171 | | - nonce, err := rpcClient.NonceAt(context.Background(), address, nil) |
172 | | - require.NoError(t, err) |
173 | | - |
174 | | - t.Logf("Current nonce for address %s: %d", address.Hex(), nonce) |
175 | | - return nonce |
176 | | -} |
177 | | - |
178 | 162 | // CheckTxIncluded checks if a transaction with the given hash was included in a block and succeeded. |
179 | 163 | func CheckTxIncluded(t *testing.T, txHash common.Hash) bool { |
180 | 164 | t.Helper() |
|
0 commit comments