mirror of https://github.com/ethereum/go-ethereum
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
771 B
46 lines
771 B
package vm
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/ethereum/go-ethereum/params"
|
|
)
|
|
|
|
type OutOfGasError struct{}
|
|
|
|
func (self OutOfGasError) Error() string {
|
|
return "Out Of Gas"
|
|
}
|
|
|
|
func IsOOGErr(err error) bool {
|
|
_, ok := err.(OutOfGasError)
|
|
return ok
|
|
}
|
|
|
|
type StackError struct {
|
|
req, has int
|
|
}
|
|
|
|
func StackErr(req, has int) StackError {
|
|
return StackError{req, has}
|
|
}
|
|
|
|
func (self StackError) Error() string {
|
|
return fmt.Sprintf("stack error! require %v, have %v", self.req, self.has)
|
|
}
|
|
|
|
func IsStack(err error) bool {
|
|
_, ok := err.(StackError)
|
|
return ok
|
|
}
|
|
|
|
type DepthError struct{}
|
|
|
|
func (self DepthError) Error() string {
|
|
return fmt.Sprintf("Max call depth exceeded (%d)", params.CallCreateDepth)
|
|
}
|
|
|
|
func IsDepthErr(err error) bool {
|
|
_, ok := err.(DepthError)
|
|
return ok
|
|
}
|
|
|