mirror of
https://gitlab.com/pulsechaincom/go-pulse.git
synced 2024-12-25 21:07:17 +00:00
1e8b54abfb
* The State and StateObject have been moved to their own package * The VM is moved to it's own package
24 lines
438 B
Go
24 lines
438 B
Go
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}
|
|
}
|