aboutsummaryrefslogtreecommitdiffstats
path: root/ethstate/errors.go
blob: d5d7db86b482d5f231ff7ffb22921f247de2fef6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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}
}