aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain/error.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-06-12 03:56:59 +0800
committerobscuren <geffobscura@gmail.com>2014-06-12 03:56:59 +0800
commit8a2e50ab2a6c903a6ab3ab10a74c37e1f3b8f3f1 (patch)
tree3cf67a559ef450500ddfd7df9d457f3e1a994caf /ethchain/error.go
parent9ee6295c752a518603de01e4feaec787c61a5dcf (diff)
parent1938bfcddfd2722880a692c59cad344b611711c8 (diff)
downloadgo-tangerine-8a2e50ab2a6c903a6ab3ab10a74c37e1f3b8f3f1.tar.gz
go-tangerine-8a2e50ab2a6c903a6ab3ab10a74c37e1f3b8f3f1.tar.zst
go-tangerine-8a2e50ab2a6c903a6ab3ab10a74c37e1f3b8f3f1.zip
Merge branch 'develop' into interop
Conflicts: peer.go
Diffstat (limited to 'ethchain/error.go')
-rw-r--r--ethchain/error.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/ethchain/error.go b/ethchain/error.go
index 8d37b0208..29896bc59 100644
--- a/ethchain/error.go
+++ b/ethchain/error.go
@@ -2,6 +2,7 @@ package ethchain
import (
"fmt"
+ "math/big"
)
// Parent error. In case a parent is unknown this error will be thrown
@@ -43,6 +44,23 @@ func IsValidationErr(err error) bool {
return ok
}
+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}
+}
+
type NonceErr struct {
Message string
Is, Exp uint64