Refactored state, state object and vm

* The State and StateObject have been moved to their own package
* The VM is moved to it's own package
This commit is contained in:
obscuren
2014-07-22 11:54:48 +02:00
parent 20ee1ae65e
commit 1e8b54abfb
15 changed files with 2242 additions and 1 deletions

23
ethstate/errors.go Normal file
View File

@@ -0,0 +1,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}
}