aboutsummaryrefslogtreecommitdiffstats
path: root/ethutil/rlp.go
diff options
context:
space:
mode:
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)