aboutsummaryrefslogtreecommitdiffstats
path: root/rlp/encode_test.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2015-01-30 23:52:48 +0800
committerFelix Lange <fjl@twurst.com>2015-02-06 07:00:36 +0800
commit8c3095faf03fb6c8138e6b8691df49be4a6fffae (patch)
tree0734942413dcc168f0e59b609df4b28eb4ea34a1 /rlp/encode_test.go
parent410b35e9135baa86e92bc07e0ef85d04e3ac0561 (diff)
downloaddexon-8c3095faf03fb6c8138e6b8691df49be4a6fffae.tar
dexon-8c3095faf03fb6c8138e6b8691df49be4a6fffae.tar.gz
dexon-8c3095faf03fb6c8138e6b8691df49be4a6fffae.tar.bz2
dexon-8c3095faf03fb6c8138e6b8691df49be4a6fffae.tar.lz
dexon-8c3095faf03fb6c8138e6b8691df49be4a6fffae.tar.xz
dexon-8c3095faf03fb6c8138e6b8691df49be4a6fffae.tar.zst
dexon-8c3095faf03fb6c8138e6b8691df49be4a6fffae.zip
rlp: fix encoding of arrays with byte element type
Diffstat (limited to 'rlp/encode_test.go')
-rw-r--r--rlp/encode_test.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/rlp/encode_test.go b/rlp/encode_test.go
index 18b843737..0309b9258 100644
--- a/rlp/encode_test.go
+++ b/rlp/encode_test.go
@@ -40,6 +40,8 @@ func (e *encodableReader) Read(b []byte) (int, error) {
panic("called")
}
+type namedByteType byte
+
var (
_ = Encoder(&testEncoder{})
_ = Encoder(byteEncoder(0))
@@ -102,6 +104,10 @@ var encTests = []encTest{
// byte slices, strings
{val: []byte{}, output: "80"},
{val: []byte{1, 2, 3}, output: "83010203"},
+
+ {val: []namedByteType{1, 2, 3}, output: "83010203"},
+ {val: [...]namedByteType{1, 2, 3}, output: "83010203"},
+
{val: "", output: "80"},
{val: "dog", output: "83646F67"},
{