Skip to content

Commit

Permalink
Minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan-Ethernal committed Aug 8, 2023
1 parent ff3c370 commit 06d892d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions testutil/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,14 +248,14 @@ func (t *TestServer) SendTxn(txn *ethgo.Transaction) (*ethgo.Receipt, error) {
txn.From = t.Account(0)
}

if txn.Type == ethgo.TransactionLegacy {
if txn.Type == ethgo.TransactionDynamicFee {
if txn.MaxPriorityFeePerGas == nil || txn.MaxPriorityFeePerGas.Cmp(big.NewInt(0)) == 0 {
txn.MaxPriorityFeePerGas = new(big.Int).SetUint64(DefaultGasPrice)
}
} else {
if txn.GasPrice == 0 {
txn.GasPrice = DefaultGasPrice
}
} else if txn.Type == ethgo.TransactionDynamicFee {
if txn.MaxPriorityFeePerGas.Cmp(big.NewInt(0)) == 0 {
txn.MaxPriorityFeePerGas = new(big.Int).SetUint64(DefaultGasPrice)
}
}
if txn.Gas == 0 {
txn.Gas = DefaultGasLimit
Expand Down

0 comments on commit 06d892d

Please sign in to comment.