From fc92abec2cc6e27e7e56a6a05850ad4ebbf63d7e Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Thu, 15 Jan 2015 23:21:41 +0100 Subject: 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. --- rlp/decode_test.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'rlp/decode_test.go') 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 } -- cgit