eth: fix SendTx

This commit is contained in:
Gary Rong 2025-05-08 15:06:22 +08:00
parent b853a2f50c
commit b4525261d3

View file

@ -134,13 +134,17 @@ func TestSendTx(t *testing.T) {
func testSendTx(t *testing.T, withLocal bool) {
b := initBackend(withLocal)
txA := pricedSetCodeTx(0, 250000, uint256.NewInt(params.GWei), uint256.NewInt(params.GWei), key, []unsignedAuth{
{
nonce: 0,
key: key,
},
})
b.SendTx(context.Background(), txA)
txA := pricedSetCodeTx(0, 250000, uint256.NewInt(params.GWei), uint256.NewInt(params.GWei), key, []unsignedAuth{{nonce: 0, key: key}})
if err := b.SendTx(context.Background(), txA); err != nil {
t.Fatalf("Failed to submit tx: %v", err)
}
for {
pending, _ := b.TxPool().ContentFrom(address)
if len(pending) == 1 {
break
}
time.Sleep(100 * time.Millisecond)
}
txB := makeTx(1, nil, nil, key)
err := b.SendTx(context.Background(), txB)