aboutsummaryrefslogtreecommitdiffstats
path: root/rlp/decode.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-03-18 21:16:07 +0800
committerobscuren <geffobscura@gmail.com>2015-03-18 21:16:07 +0800
commit4d0ae8b0cb32e9de63092bc36022ea4af76cad8b (patch)
tree240356371b44765d64c9ceed9be84064258e8c1d /rlp/decode.go
parent48dd601de0ffea4e1bf57a8923f2a6126553b575 (diff)
parent064279c0ec2f048cbdd965c095ea332bb8666f94 (diff)
downloadgo-tangerine-4d0ae8b0cb32e9de63092bc36022ea4af76cad8b.tar.gz
go-tangerine-4d0ae8b0cb32e9de63092bc36022ea4af76cad8b.tar.zst
go-tangerine-4d0ae8b0cb32e9de63092bc36022ea4af76cad8b.zip
Merge branch 'conversion' of github.com-obscure:ethereum/go-ethereum into conversion
Diffstat (limited to 'rlp/decode.go')
-rw-r--r--rlp/decode.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/rlp/decode.go b/rlp/decode.go
index 55f7187a3..6d7e670c2 100644
--- a/rlp/decode.go
+++ b/rlp/decode.go
@@ -2,6 +2,7 @@ package rlp
import (
"bufio"
+ "bytes"
"encoding/binary"
"errors"
"fmt"
@@ -73,6 +74,12 @@ func Decode(r io.Reader, val interface{}) error {
return NewStream(r).Decode(val)
}
+// DecodeBytes parses RLP data from b into val.
+// Please see the documentation of Decode for the decoding rules.
+func DecodeBytes(b []byte, val interface{}) error {
+ return NewStream(bytes.NewReader(b)).Decode(val)
+}
+
type decodeError struct {
msg string
typ reflect.Type