Skip to content

Commit

Permalink
Fix failing E2E tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan-Ethernal committed Jun 19, 2023
1 parent 0e71291 commit ac2ad4b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
12 changes: 8 additions & 4 deletions e2e-polybft/framework/test-cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ func (c *TestCluster) Call(t *testing.T, to types.Address, method *abi.Method,
func (c *TestCluster) Deploy(t *testing.T, sender ethgo.Key, bytecode []byte) *TestTxn {
t.Helper()

return c.SendTxn(t, sender, &ethgo.Transaction{Input: bytecode})
return c.SendTxn(t, sender, &ethgo.Transaction{From: sender.Address(), Input: bytecode})
}

func (c *TestCluster) Transfer(t *testing.T, sender ethgo.Key, target types.Address, value *big.Int) *TestTxn {
Expand Down Expand Up @@ -915,9 +915,13 @@ func (c *TestCluster) SendTxn(t *testing.T, sender ethgo.Key, txn *ethgo.Transac
callMsg := txrelayer.ConvertTxnToCallMsg(txn)

gasLimit, err := client.Eth().EstimateGas(callMsg)
require.NoError(t, err)

txn.Gas = gasLimit
if err != nil {
// gas estimation can fail in case an account is not allow-listed
// (fallback it to default gas limit in that case)
txn.Gas = txrelayer.DefaultGasLimit
} else {
txn.Gas = gasLimit
}
}

chainID, err := client.Eth().ChainID()
Expand Down
3 changes: 0 additions & 3 deletions txrelayer/txrelayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ func (t *TxRelayerImpl) sendTransactionLocked(txn *ethgo.Transaction, key ethgo.
return ethgo.ZeroHash, err
}

fmt.Println("Tx relayer Gas Price", gasPrice, "To", txn.To)
txn.GasPrice = gasPrice
}

Expand All @@ -121,8 +120,6 @@ func (t *TxRelayerImpl) sendTransactionLocked(txn *ethgo.Transaction, key ethgo.
return ethgo.ZeroHash, err
}

fmt.Println("Tx relayer Gas Limit", gasLimit, "To", txn.To)

txn.Gas = gasLimit
}

Expand Down

0 comments on commit ac2ad4b

Please sign in to comment.