From 1e8b54abfb7129fcdf4812ad01b6a7cd61e4f65d Mon Sep 17 00:00:00 2001 From: obscuren Date: Tue, 22 Jul 2014 11:54:48 +0200 Subject: 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 --- ethstate/errors.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 ethstate/errors.go (limited to 'ethstate/errors.go') 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} +} -- cgit