gleeth/encoding/rlp
Types
Errors that can occur during RLP decoding
pub type RlpError {
InvalidPrefix(Int)
UnexpectedEnd
ExtraData
InvalidLength
}
Constructors
-
InvalidPrefix(Int) -
UnexpectedEnd -
ExtraData -
InvalidLength
Values
pub fn encode_hex_field(hex_string: String) -> RlpItem
Convert a “0x…” hex string to an RLP item with minimal encoding. Strips the 0x prefix, decodes hex to bytes, and removes leading zero bytes.
pub fn encode_int(value: Int) -> RlpItem
Convert an integer to an RLP item. Uses big-endian minimal encoding: 0 becomes empty bytes.
pub fn encode_string(value: String) -> RlpItem
Convert a UTF-8 string to an RLP item