-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #225 from cerc-io/ian_dev
Fall-through post-London endpoints
- Loading branch information
Showing
3 changed files
with
144 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package eth | ||
|
||
import "fmt" | ||
|
||
type RequiresProxyError struct { | ||
method string | ||
} | ||
|
||
var _ error = RequiresProxyError{} | ||
|
||
func (e RequiresProxyError) SetMethod(method string) { | ||
e.method = method | ||
} | ||
|
||
func (e RequiresProxyError) Error() string { | ||
return fmt.Sprintf("%s requires a configured proxy geth node", e.method) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package eth | ||
|
||
import ( | ||
"github.com/ethereum/go-ethereum/common" | ||
"github.com/ethereum/go-ethereum/common/hexutil" | ||
"github.com/ethereum/go-ethereum/core/types" | ||
) | ||
|
||
// TransactionArgs represents the arguments to construct a new transaction | ||
// or a message call. | ||
type TransactionArgs struct { | ||
From *common.Address `json:"from"` | ||
To *common.Address `json:"to"` | ||
Gas *hexutil.Uint64 `json:"gas"` | ||
GasPrice *hexutil.Big `json:"gasPrice"` | ||
MaxFeePerGas *hexutil.Big `json:"maxFeePerGas"` | ||
MaxPriorityFeePerGas *hexutil.Big `json:"maxPriorityFeePerGas"` | ||
Value *hexutil.Big `json:"value"` | ||
Nonce *hexutil.Uint64 `json:"nonce"` | ||
|
||
// We accept "data" and "input" for backwards-compatibility reasons. | ||
// "input" is the newer name and should be preferred by clients. | ||
// Issue detail: https://github.com/ethereum/go-ethereum/issues/15628 | ||
Data *hexutil.Bytes `json:"data"` | ||
Input *hexutil.Bytes `json:"input"` | ||
|
||
// Introduced by AccessListTxType transaction. | ||
AccessList *types.AccessList `json:"accessList,omitempty"` | ||
ChainID *hexutil.Big `json:"chainId,omitempty"` | ||
} | ||
|
||
// from retrieves the transaction sender address. | ||
func (args *TransactionArgs) from() common.Address { | ||
if args.From == nil { | ||
return common.Address{} | ||
} | ||
return *args.From | ||
} | ||
|
||
// data retrieves the transaction calldata. Input field is preferred. | ||
func (args *TransactionArgs) data() []byte { | ||
if args.Input != nil { | ||
return *args.Input | ||
} | ||
if args.Data != nil { | ||
return *args.Data | ||
} | ||
return nil | ||
} |