diff options
Diffstat (limited to 'core/error.go')
-rw-r--r-- | core/error.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/core/error.go b/core/error.go index 5e32124a7..6498194cd 100644 --- a/core/error.go +++ b/core/error.go @@ -188,3 +188,16 @@ func IsBadHashError(err error) bool { _, ok := err.(BadHashError) return ok } + +type GasLimitErr struct { + Have, Want *big.Int +} + +func IsGasLimitErr(err error) bool { + _, ok := err.(*GasLimitErr) + return ok +} + +func (err *GasLimitErr) Error() string { + return fmt.Sprintf("GasLimit reached. Have %d gas, transaction requires %d", err.Have, err.Want) +} |