aboutsummaryrefslogtreecommitdiffstats
path: root/ethstate/errors.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-07-25 16:43:35 +0800
committerobscuren <geffobscura@gmail.com>2014-07-25 16:43:35 +0800
commitd761af84c83ae8d9d723e6766abb7950ff59cdf3 (patch)
tree6fe0805649ddf38b2b90e77c5fb2000a4bdab536 /ethstate/errors.go
parent06ec80f39495bdd92878468cf862f52e9748f1ca (diff)
parent54f9ea14e197ad805f24592153f1b9e69f3bc5c3 (diff)
downloaddexon-d761af84c83ae8d9d723e6766abb7950ff59cdf3.tar
dexon-d761af84c83ae8d9d723e6766abb7950ff59cdf3.tar.gz
dexon-d761af84c83ae8d9d723e6766abb7950ff59cdf3.tar.bz2
dexon-d761af84c83ae8d9d723e6766abb7950ff59cdf3.tar.lz
dexon-d761af84c83ae8d9d723e6766abb7950ff59cdf3.tar.xz
dexon-d761af84c83ae8d9d723e6766abb7950ff59cdf3.tar.zst
dexon-d761af84c83ae8d9d723e6766abb7950ff59cdf3.zip
Merge branch 'release/0.6.0'
Diffstat (limited to 'ethstate/errors.go')
-rw-r--r--ethstate/errors.go23
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}
+}