aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/messages_test.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-03-20 19:07:19 +0800
committerobscuren <geffobscura@gmail.com>2015-03-20 19:07:19 +0800
commit41c493ace9182bc99226d66dc4479277fbbf749d (patch)
tree2f8f1b7f00903d328f21701b94dd416313882666 /rpc/messages_test.go
parent55fdf3e46272ec50a4d55f519b542df790920306 (diff)
parenteb452115018e7686dc94ce1e92d2e9f85d76ab09 (diff)
downloaddexon-41c493ace9182bc99226d66dc4479277fbbf749d.tar
dexon-41c493ace9182bc99226d66dc4479277fbbf749d.tar.gz
dexon-41c493ace9182bc99226d66dc4479277fbbf749d.tar.bz2
dexon-41c493ace9182bc99226d66dc4479277fbbf749d.tar.lz
dexon-41c493ace9182bc99226d66dc4479277fbbf749d.tar.xz
dexon-41c493ace9182bc99226d66dc4479277fbbf749d.tar.zst
dexon-41c493ace9182bc99226d66dc4479277fbbf749d.zip
Merge branch 'rpcfrontier' of github.com-obscure:ethereum/go-ethereum into rpcfrontier
Diffstat (limited to 'rpc/messages_test.go')
-rw-r--r--rpc/messages_test.go41
1 files changed, 41 insertions, 0 deletions
diff --git a/rpc/messages_test.go b/rpc/messages_test.go
new file mode 100644
index 000000000..5274c91e4
--- /dev/null
+++ b/rpc/messages_test.go
@@ -0,0 +1,41 @@
+package rpc
+
+import (
+ "testing"
+)
+
+func TestInsufficientParamsError(t *testing.T) {
+ err := NewInsufficientParamsError(0, 1)
+ expected := "insufficient params, want 1 have 0"
+
+ if err.Error() != expected {
+ t.Error(err.Error())
+ }
+}
+
+func TestNotImplementedError(t *testing.T) {
+ err := NewNotImplementedError("foo")
+ expected := "foo method not implemented"
+
+ if err.Error() != expected {
+ t.Error(err.Error())
+ }
+}
+
+func TestDecodeParamError(t *testing.T) {
+ err := NewDecodeParamError("foo")
+ expected := "could not decode, foo"
+
+ if err.Error() != expected {
+ t.Error(err.Error())
+ }
+}
+
+func TestValidationError(t *testing.T) {
+ err := NewValidationError("foo", "should be `bar`")
+ expected := "foo not valid, should be `bar`"
+
+ if err.Error() != expected {
+ t.Error(err.Error())
+ }
+}