errors

package
v7.0.1-arabica Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 11, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const AppErrorsCodespace = "app"

AppErrorsCodespace defines the unique identifier of the application error space used to separate app-specific errors from other modules

Variables

View Source
var (
	// ErrTxExceedsMaxSize is returned when a transaction size exceeds the maximum allowed limit
	ErrTxExceedsMaxSize = errors.Register(AppErrorsCodespace, 11142, "transaction size exceeds maximum allowed limit")
)

Application error codes start from 11000 to avoid conflicts with other modules

Functions

func IsInsufficientFee

func IsInsufficientFee(err error) bool

IsInsufficientFee checks if the error is due to the gas price being too low.

func IsNonceMismatch

func IsNonceMismatch(err error) bool

IsNonceMismatch checks if the error is due to a sequence mismatch.

func IsNonceMismatchCode

func IsNonceMismatchCode(code uint32) bool

IsNonceMismatchCode checks if the error code matches the sequence mismatch.

func ParseExpectedSequence

func ParseExpectedSequence(str string) (uint64, error)

ParseExpectedSequence extracts the expected sequence number from the ErrWrongSequence error.

func ParseInsufficientMinGasPrice

func ParseInsufficientMinGasPrice(err error, gasPrice float64, gasLimit uint64) (float64, error)

ParseInsufficientMinGasPrice checks if the error is due to the gas price being too low. Given the previous gas price and gas limit, it returns the new minimum gas price that the node should accept. If the error is not due to the gas price being too low, it returns 0, nil

func ParseNonceMismatch

func ParseNonceMismatch(err error) (uint64, error)

ParseNonceMismatch extracts the expected sequence number from the ErrWrongSequence error.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL