Documentation
¶
Index ¶
- Constants
- func IsTransactionDue(rp *rocketpool.RocketPool, startTime time.Time) (bool, time.Duration, error)
- func PrintAndCheckGasInfo(gasInfo rocketpool.GasInfo, checkThreshold bool, gasThresholdGwei float64, ...) bool
- func PrintAndWaitForTransaction(cfg *config.RocketPoolConfig, hash common.Hash, ec rocketpool.ExecutionClient, ...) error
- func WriteErrorResponse(w http.ResponseWriter, err error)
- func WriteResponse(w http.ResponseWriter, response interface{}, responseError error)
- func ZeroIfNil(in **big.Int)
- type BadRequestError
- type EIP712Components
- type NotFoundError
Constants ¶
const TimeoutSafetyFactor int = 2
The fraction of the timeout period to trigger overdue transactions
Variables ¶
This section is empty.
Functions ¶
func IsTransactionDue ¶ added in v1.1.0
func IsTransactionDue(rp *rocketpool.RocketPool, startTime time.Time) (bool, time.Duration, error)
True if a transaction is due and needs to bypass the gas threshold
func PrintAndCheckGasInfo ¶ added in v1.0.0
func PrintAndCheckGasInfo(gasInfo rocketpool.GasInfo, checkThreshold bool, gasThresholdGwei float64, logger *log.ColorLogger, maxFeeWei *big.Int, gasLimit uint64) bool
Print the gas price and cost of a TX
func PrintAndWaitForTransaction ¶ added in v1.0.0
func PrintAndWaitForTransaction(cfg *config.RocketPoolConfig, hash common.Hash, ec rocketpool.ExecutionClient, logger *log.ColorLogger) error
Print a TX's details to the logger and waits for it to validated.
func WriteErrorResponse ¶ added in v1.20.0
func WriteErrorResponse(w http.ResponseWriter, err error)
WriteErrorResponse writes a generic error response to w.
func WriteResponse ¶ added in v1.20.0
func WriteResponse(w http.ResponseWriter, response interface{}, responseError error)
WriteResponse serialises response as JSON and writes it to w. response must be a pointer to a struct with string fields named Status and Error. On error it writes 400 for BadRequestError and 500 for everything else.
Types ¶
type BadRequestError ¶ added in v1.20.0
type BadRequestError struct{ Err error }
BadRequestError signals that the caller supplied invalid input. WriteResponse maps it to HTTP 400 rather than 500.
func (*BadRequestError) Error ¶ added in v1.20.0
func (e *BadRequestError) Error() string
func (*BadRequestError) Unwrap ¶ added in v1.20.0
func (e *BadRequestError) Unwrap() error
type EIP712Components ¶ added in v1.13.6
func ParseEIP712 ¶ added in v1.13.6
func ParseEIP712(signature string) (*EIP712Components, error)
type NotFoundError ¶ added in v1.20.0
type NotFoundError struct{ Path string }
NotFoundError signals that the requested resource or route does not exist. WriteResponse maps it to HTTP 404.
func (*NotFoundError) Error ¶ added in v1.20.0
func (e *NotFoundError) Error() string