Skip to content

Commit

Permalink
bind, ethapi: replace london with EIP-1559 in log messages
Browse files Browse the repository at this point in the history
  • Loading branch information
gzliudan committed Sep 10, 2024
1 parent 1f6c37a commit 7a79c05
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion accounts/abi/bind/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ func (c *BoundContract) createDynamicTx(opts *TransactOpts, contract *common.Add

func (c *BoundContract) createLegacyTx(opts *TransactOpts, contract *common.Address, input []byte) (*types.Transaction, error) {
if opts.GasFeeCap != nil || opts.GasTipCap != nil {
return nil, errors.New("maxFeePerGas or maxPriorityFeePerGas specified but london is not active yet")
return nil, errors.New("maxFeePerGas or maxPriorityFeePerGas specified but EIP-1559 is not active yet")
}
// Normalize value
value := opts.Value
Expand Down
4 changes: 2 additions & 2 deletions internal/ethapi/transaction_args.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ func (args *TransactionArgs) setFeeDefaults(ctx context.Context, b Backend) erro
if args.GasPrice != nil && !eip1559ParamsSet {
// Zero gas-price is not allowed after London fork
if args.GasPrice.ToInt().Sign() == 0 && isEIP1559 {
return errors.New("gasPrice must be non-zero after london fork")
return errors.New("gasPrice must be non-zero after EIP-1559 fork")
}
return nil // No need to set anything, user already set GasPrice
}
Expand All @@ -180,7 +180,7 @@ func (args *TransactionArgs) setFeeDefaults(ctx context.Context, b Backend) erro
}
} else {
if args.MaxFeePerGas != nil || args.MaxPriorityFeePerGas != nil {
return errors.New("maxFeePerGas and maxPriorityFeePerGas are not valid before London is active")
return errors.New("maxFeePerGas and maxPriorityFeePerGas are not valid before EIP-1559 is active")
}
// London not active, set gas price.
price, err := b.SuggestGasTipCap(ctx)
Expand Down
6 changes: 3 additions & 3 deletions internal/ethapi/transaction_args_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func TestSetFeeDefaults(t *testing.T) {
true,
&TransactionArgs{GasPrice: zero},
nil,
errors.New("gasPrice must be non-zero after london fork"),
errors.New("gasPrice must be non-zero after EIP-1559 fork"),
},

// Access list txs
Expand Down Expand Up @@ -159,14 +159,14 @@ func TestSetFeeDefaults(t *testing.T) {
false,
&TransactionArgs{MaxFeePerGas: maxFee},
nil,
fmt.Errorf("maxFeePerGas and maxPriorityFeePerGas are not valid before London is active"),
fmt.Errorf("maxFeePerGas and maxPriorityFeePerGas are not valid before EIP-1559 is active"),
},
{
"dynamic fee tx pre-London, priorityFee set",
false,
&TransactionArgs{MaxPriorityFeePerGas: fortytwo},
nil,
fmt.Errorf("maxFeePerGas and maxPriorityFeePerGas are not valid before London is active"),
fmt.Errorf("maxFeePerGas and maxPriorityFeePerGas are not valid before EIP-1559 is active"),
},
{
"dynamic fee tx, maxFee < priorityFee",
Expand Down

0 comments on commit 7a79c05

Please sign in to comment.