aboutsummaryrefslogtreecommitdiffstats
path: root/rlp_test.go
diff options
context:
space:
mode:
authorobscuren <obscuren@obscura.com>2013-12-28 22:17:26 +0800
committerobscuren <obscuren@obscura.com>2013-12-28 22:17:26 +0800
commit95d877f701371108dc18967319d1f7b4e6763caf (patch)
tree31e00c66a27d57600624e84cc230d6bae047cce0 /rlp_test.go
parentbb8afba20a56552cef71681f72fb192bcda88c1d (diff)
downloaddexon-95d877f701371108dc18967319d1f7b4e6763caf.tar.gz
dexon-95d877f701371108dc18967319d1f7b4e6763caf.tar.zst
dexon-95d877f701371108dc18967319d1f7b4e6763caf.zip
Fixed rlp encoding
Diffstat (limited to 'rlp_test.go')
-rw-r--r--rlp_test.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/rlp_test.go b/rlp_test.go
index ae8dcced4..6a34aecbc 100644
--- a/rlp_test.go
+++ b/rlp_test.go
@@ -27,6 +27,27 @@ func TestEncode(t *testing.T) {
fmt.Printf("raw: %v encoded: %q == %v\n", dec, slice, strs)
}
+func TestMultiEncode(t *testing.T) {
+ inter := []interface{}{
+ []interface{}{
+ "1","2","3",
+ },
+ []string{
+ "string",
+ "string2",
+ "\x86A0J1234567890A\x00B20A0\x82F395843F657986",
+ "\x86A0J1234567890A\x00B20A0\x8cF395843F657986I335612448F524099H16716881A0H13114947G2039362G1507139H16719697G1048387E65360",
+ },
+ "test",
+ }
+
+ bytes := Encode(inter)
+ fmt.Printf("%q\n", bytes)
+
+ dec, _ := Decode(bytes, 0)
+ fmt.Println(dec)
+}
+
func BenchmarkEncodeDecode(b *testing.B) {
for i := 0; i < b.N; i++ {
bytes := Encode([]string{"dog", "god", "cat"})