aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain/error.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-05-05 21:55:43 +0800
committerobscuren <geffobscura@gmail.com>2014-05-05 21:55:43 +0800
commit2096b3a9edb3289a8f30da81704181dec7b39917 (patch)
tree1a38e845f32ecfc94a73546ec4cfdb971b740830 /ethchain/error.go
parent6a86c517c4f4b372cad0ae1d92e926a482eac5ba (diff)
parentfedd4c906ff9f6139cb2d88e4f1adefbf6ea81a6 (diff)
downloadgo-tangerine-2096b3a9edb3289a8f30da81704181dec7b39917.tar
go-tangerine-2096b3a9edb3289a8f30da81704181dec7b39917.tar.gz
go-tangerine-2096b3a9edb3289a8f30da81704181dec7b39917.tar.bz2
go-tangerine-2096b3a9edb3289a8f30da81704181dec7b39917.tar.lz
go-tangerine-2096b3a9edb3289a8f30da81704181dec7b39917.tar.xz
go-tangerine-2096b3a9edb3289a8f30da81704181dec7b39917.tar.zst
go-tangerine-2096b3a9edb3289a8f30da81704181dec7b39917.zip
Merge branch 'release/poc5-rc1'
Diffstat (limited to 'ethchain/error.go')
-rw-r--r--ethchain/error.go23
1 files changed, 22 insertions, 1 deletions
diff --git a/ethchain/error.go b/ethchain/error.go
index 0f1d061c0..8d37b0208 100644
--- a/ethchain/error.go
+++ b/ethchain/error.go
@@ -1,6 +1,8 @@
package ethchain
-import "fmt"
+import (
+ "fmt"
+)
// Parent error. In case a parent is unknown this error will be thrown
// by the block manager
@@ -40,3 +42,22 @@ func IsValidationErr(err error) bool {
return ok
}
+
+type NonceErr struct {
+ Message string
+ Is, Exp uint64
+}
+
+func (err *NonceErr) Error() string {
+ return err.Message
+}
+
+func NonceError(is, exp uint64) *NonceErr {
+ return &NonceErr{Message: fmt.Sprintf("Nonce err. Is %d, expected %d", is, exp), Is: is, Exp: exp}
+}
+
+func IsNonceErr(err error) bool {
+ _, ok := err.(*NonceErr)
+
+ return ok
+}