diff options
Diffstat (limited to 'ethstate/errors.go')
-rw-r--r-- | ethstate/errors.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/ethstate/errors.go b/ethstate/errors.go new file mode 100644 index 000000000..d5d7db86b --- /dev/null +++ b/ethstate/errors.go @@ -0,0 +1,23 @@ +package ethstate + +import ( + "fmt" + "math/big" +) + +type GasLimitErr struct { + Message string + Is, Max *big.Int +} + +func IsGasLimitErr(err error) bool { + _, ok := err.(*GasLimitErr) + + return ok +} +func (err *GasLimitErr) Error() string { + return err.Message +} +func GasLimitError(is, max *big.Int) *GasLimitErr { + return &GasLimitErr{Message: fmt.Sprintf("GasLimit error. Max %s, transaction would take it to %s", max, is), Is: is, Max: max} +} |