Fix core error forwarding, unify OOG VM err

This commit is contained in:
Gustav Simonsson
2015-07-03 19:54:14 +02:00
parent 9c3db1be1d
commit 0f04af5916
7 changed files with 10 additions and 54 deletions

View File

@ -1,21 +1,14 @@
package vm
import (
"errors"
"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
}
var OutOfGasError = errors.New("Out of gas")
var DepthError = fmt.Errorf("Max call depth exceeded (%d)", params.CallCreateDepth)
type StackError struct {
req, has int
@ -33,14 +26,3 @@ 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
}