aboutsummaryrefslogtreecommitdiffstats
path: root/ethutil/rlp.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-09-23 01:34:31 +0800
committerobscuren <geffobscura@gmail.com>2014-09-23 01:34:31 +0800
commitce149d2733bd55e8e9b16dd4b60b6bad17c3d7d9 (patch)
treeac183aa3312a4589cb3e4995cc103cfa58ef95da /ethutil/rlp.go
parent8ef17c2fb138ae254a0cc7ac509a7ab1177ee4ac (diff)
parent7d08e4f7d14600ee4ed38fc9d435e9c2e0e0fdac (diff)
downloadgo-tangerine-ce149d2733bd55e8e9b16dd4b60b6bad17c3d7d9.tar
go-tangerine-ce149d2733bd55e8e9b16dd4b60b6bad17c3d7d9.tar.gz
go-tangerine-ce149d2733bd55e8e9b16dd4b60b6bad17c3d7d9.tar.bz2
go-tangerine-ce149d2733bd55e8e9b16dd4b60b6bad17c3d7d9.tar.lz
go-tangerine-ce149d2733bd55e8e9b16dd4b60b6bad17c3d7d9.tar.xz
go-tangerine-ce149d2733bd55e8e9b16dd4b60b6bad17c3d7d9.tar.zst
go-tangerine-ce149d2733bd55e8e9b16dd4b60b6bad17c3d7d9.zip
Merge branch 'release/0.6.5'
Diffstat (limited to 'ethutil/rlp.go')
-rw-r--r--ethutil/rlp.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/ethutil/rlp.go b/ethutil/rlp.go
index 17ff627eb..55406133b 100644
--- a/ethutil/rlp.go
+++ b/ethutil/rlp.go
@@ -15,6 +15,10 @@ type RlpEncodeDecode interface {
RlpValue() []interface{}
}
+func Rlp(encoder RlpEncode) []byte {
+ return encoder.RlpEncode()
+}
+
type RlpEncoder struct {
rlpData []byte
}
@@ -124,6 +128,8 @@ func Encode(object interface{}) []byte {
} else {
buff.Write(Encode(t.Bytes()))
}
+ case Bytes:
+ buff.Write(Encode([]byte(t)))
case []byte:
if len(t) == 1 && t[0] <= 0x7f {
buff.Write(t)