aboutsummaryrefslogtreecommitdiffstats
path: root/rlp/decode_test.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2015-01-16 06:21:41 +0800
committerFelix Lange <fjl@twurst.com>2015-01-16 06:35:26 +0800
commitfc92abec2cc6e27e7e56a6a05850ad4ebbf63d7e (patch)
treef8ba38e7c5ad3be52fc22c09600b619e1f968c53 /rlp/decode_test.go
parent29c46cdf3405d6462deb2cb5cef87b1b4fb2bdc7 (diff)
downloaddexon-fc92abec2cc6e27e7e56a6a05850ad4ebbf63d7e.tar
dexon-fc92abec2cc6e27e7e56a6a05850ad4ebbf63d7e.tar.gz
dexon-fc92abec2cc6e27e7e56a6a05850ad4ebbf63d7e.tar.bz2
dexon-fc92abec2cc6e27e7e56a6a05850ad4ebbf63d7e.tar.lz
dexon-fc92abec2cc6e27e7e56a6a05850ad4ebbf63d7e.tar.xz
dexon-fc92abec2cc6e27e7e56a6a05850ad4ebbf63d7e.tar.zst
dexon-fc92abec2cc6e27e7e56a6a05850ad4ebbf63d7e.zip
rlp: allow encoding non-empty interface values
This needs to be supported because []someInterface does occur sometimes. Funny enough, the fix involves changes to the decoder. makeDecoder cannot return an error for non-empty interfaces anymore because the type cache builds both decoder and writer. Do the check at 'runtime' instead.
Diffstat (limited to 'rlp/decode_test.go')
-rw-r--r--rlp/decode_test.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/rlp/decode_test.go b/rlp/decode_test.go
index 9142ef56d..9f66840b1 100644
--- a/rlp/decode_test.go
+++ b/rlp/decode_test.go
@@ -325,6 +325,11 @@ var decodeTests = []decodeTest{
{input: "850505050505", ptr: new(interface{}), value: []byte{5, 5, 5, 5, 5}},
{input: "C0", ptr: new(interface{}), value: []interface{}{}},
{input: "C50183040404", ptr: new(interface{}), value: []interface{}{[]byte{1}, []byte{4, 4, 4}}},
+ {
+ input: "C3010203",
+ ptr: new([]io.Reader),
+ error: "rlp: type io.Reader is not RLP-serializable",
+ },
}
func uintp(i uint) *uint { return &i }