aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/messages_test.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2015-03-21 05:47:27 +0800
committerFelix Lange <fjl@twurst.com>2015-03-21 05:47:27 +0800
commit81800ca39ea03da7f63d8ecfbd74773f4ca73323 (patch)
tree6d56577858304d970c7754bcd5ac24c2b282f079 /rpc/messages_test.go
parentb95ff54632d9a31286f5b629556071b6043d274a (diff)
parentf4e9638867f5dab01eeb6db5fdbd85737a11fbd6 (diff)
downloaddexon-81800ca39ea03da7f63d8ecfbd74773f4ca73323.tar
dexon-81800ca39ea03da7f63d8ecfbd74773f4ca73323.tar.gz
dexon-81800ca39ea03da7f63d8ecfbd74773f4ca73323.tar.bz2
dexon-81800ca39ea03da7f63d8ecfbd74773f4ca73323.tar.lz
dexon-81800ca39ea03da7f63d8ecfbd74773f4ca73323.tar.xz
dexon-81800ca39ea03da7f63d8ecfbd74773f4ca73323.tar.zst
dexon-81800ca39ea03da7f63d8ecfbd74773f4ca73323.zip
Merge remote-tracking branch 'ethereum/conversion' into conversion
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())
+ }
+}