Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var PredicateEndByte = byte(0xff)
PredicateEndByte is used as a delimiter for the bytes packed into a precompile predicate. Precompile predicates are encoded in the Access List of transactions in the access tuples which means that its length must be a multiple of 32 (common.HashLength). For messages with a length that does not comply to that, this delimiter is used to append/remove padding.
Functions ¶
func BytesToHashSlice ¶
BytesToHashSlice packs [b] into a slice of hash values with zero padding to the right if the length of b is not a multiple of 32.
func HashSliceToBytes ¶
HashSliceToBytes serializes a []common.Hash into a tightly packed byte array.
func PackPredicate ¶
PackPredicate packs [predicate] by delimiting the actual message with PredicateEndByte and zero padding to reach a length that is a multiple of 32.
func UnpackPredicate ¶
UnpackPredicate unpacks a predicate by stripping right padded zeroes, checking for the delimter, ensuring there is not excess padding, and returning the original message. Returns an error if it finds an incorrect encoding.
Types ¶
This section is empty.