mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-19 11:20:45 +00:00
rlp: move ListSize to raw.go
This commit is contained in:
parent
24bb68e7cf
commit
fc8b246109
2 changed files with 6 additions and 6 deletions
|
|
@ -45,12 +45,6 @@ type Encoder interface {
|
||||||
EncodeRLP(io.Writer) error
|
EncodeRLP(io.Writer) error
|
||||||
}
|
}
|
||||||
|
|
||||||
// ListSize returns the encoded size of an RLP list with the given
|
|
||||||
// content size.
|
|
||||||
func ListSize(contentSize uint64) uint64 {
|
|
||||||
return uint64(headsize(contentSize)) + contentSize
|
|
||||||
}
|
|
||||||
|
|
||||||
// Encode writes the RLP encoding of val to w. Note that Encode may
|
// Encode writes the RLP encoding of val to w. Note that Encode may
|
||||||
// perform many small writes in some cases. Consider making w
|
// perform many small writes in some cases. Consider making w
|
||||||
// buffered.
|
// buffered.
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,12 @@ type RawValue []byte
|
||||||
|
|
||||||
var rawValueType = reflect.TypeOf(RawValue{})
|
var rawValueType = reflect.TypeOf(RawValue{})
|
||||||
|
|
||||||
|
// ListSize returns the encoded size of an RLP list with the given
|
||||||
|
// content size.
|
||||||
|
func ListSize(contentSize uint64) uint64 {
|
||||||
|
return uint64(headsize(contentSize)) + contentSize
|
||||||
|
}
|
||||||
|
|
||||||
// Split returns the content of first RLP value and any
|
// Split returns the content of first RLP value and any
|
||||||
// bytes after the value as subslices of b.
|
// bytes after the value as subslices of b.
|
||||||
func Split(b []byte) (k Kind, content, rest []byte, err error) {
|
func Split(b []byte) (k Kind, content, rest []byte, err error) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue