Trait Encodable7594

Source
pub trait Encodable7594 {
    // Required methods
    fn encode_7594_len(&self) -> usize;
    fn encode_7594(&self, out: &mut dyn BufMut);

    // Provided method
    fn encoded_7594(&self) -> Vec<u8>  { ... }
}
Expand description

A helper trait for encoding EIP-7594 sidecars.

Required Methods§

Source

fn encode_7594_len(&self) -> usize

The length of the 7594 encoded envelope. This is the length of the wrapper version + the length of the inner encoding.

Source

fn encode_7594(&self, out: &mut dyn BufMut)

Encode the sidecar according to EIP-7594 rules. First a 1-byte wrapper version (if any), then the body of the sidecar.

EIP-7594 inner encodings are unspecified, and produce an opaque bytestring.

Provided Methods§

Source

fn encoded_7594(&self) -> Vec<u8>

Encode the sidecar according to [EIP-7594] rules. First a 1-byte wrapper version (if any), then the body of the sidecar.

This is a convenience method for encoding into a vec, and returning the vec.

Implementors§