diff options
author | obscuren <geffobscura@gmail.com> | 2014-07-22 17:54:48 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-07-22 17:54:48 +0800 |
commit | 1e8b54abfb7129fcdf4812ad01b6a7cd61e4f65d (patch) | |
tree | 6ad93d5117d8194ee700e3347b59d0602cd4c40c /ethstate/errors.go | |
parent | 20ee1ae65e57ef7d60404277162c84c572c6bb10 (diff) | |
download | go-tangerine-1e8b54abfb7129fcdf4812ad01b6a7cd61e4f65d.tar.gz go-tangerine-1e8b54abfb7129fcdf4812ad01b6a7cd61e4f65d.tar.zst go-tangerine-1e8b54abfb7129fcdf4812ad01b6a7cd61e4f65d.zip |
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
Diffstat (limited to 'ethstate/errors.go')
-rw-r--r-- | ethstate/errors.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/ethstate/errors.go b/ethstate/errors.go new file mode 100644 index 000000000..d5d7db86b --- /dev/null +++ b/ethstate/errors.go @@ -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} +} |