diff --git a/rlp/decode.go b/rlp/decode.go index e638c01eaf..0fd104e32f 100644 --- a/rlp/decode.go +++ b/rlp/decode.go @@ -115,15 +115,17 @@ type Decoder interface { // type, Decode will return an error. Decode also supports *big.Int. // There is no size limit for big integers. // +// To decode into a boolean, the input must contain an unsigned integer +// of value zero (false) or one (true). +// // To decode into an interface value, Decode stores one of these // in the value: // // []interface{}, for RLP lists // []byte, for RLP strings // -// Non-empty interface types are not supported, nor are booleans, -// signed integers, floating point numbers, maps, channels and -// functions. +// Non-empty interface types are not supported, nor are signed integers, +// floating point numbers, maps, channels and functions. // // Note that Decode does not set an input limit for all readers // and may be vulnerable to panics cause by huge value sizes. If diff --git a/rlp/encode.go b/rlp/encode.go index 445b4b5b21..bd2c5aab8f 100644 --- a/rlp/encode.go +++ b/rlp/encode.go @@ -73,10 +73,12 @@ type Encoder interface { // An unsigned integer value is encoded as an RLP string. Zero always // encodes as an empty RLP string. Encode also supports *big.Int. // +// Boolean values are encoded as unsigned integers zero (false) and one (true). +// // An interface value encodes as the value contained in the interface. // -// Boolean values are not supported, nor are signed integers, floating -// point numbers, maps, channels and functions. +// Signed integers are not supported, nor are floating point numbers, maps, +// channels and functions. func Encode(w io.Writer, val interface{}) error { if outer, ok := w.(*encbuf); ok { // Encode was called by some type's EncodeRLP.