Skip to main content

hopper_dynamic_tail

Macro hopper_dynamic_tail 

Source
macro_rules! hopper_dynamic_tail {
    (
        $(#[$meta:meta])*
        $vis:vis struct $name:ident {
            $( $field:ident : $ty:ty ),* $(,)?
        }
    ) => { ... };
}
Expand description

Declare a dynamic-tail payload with bounded dynamic fields.

The generated type implements TailCodec, so it can be used directly with #[hopper::state(dynamic_tail = MyTail)]. Fields are encoded in declaration order. Use HopperString<N> for bounded UTF-8 strings and HopperVec<T, N> for bounded element lists. The longer BoundedString<N> and BoundedVec<T, N> names remain available when a protocol wants the storage tradeoff to be explicit in source. For Quasar-shaped account syntax, prefer #[hopper::dynamic_account]; use this macro when you want an explicit custom TailCodec payload.

hopper::hopper_dynamic_tail! {
    pub struct MultisigTail {
        label: HopperString<32>,
        signers: HopperVec<Address, 10>,
    }
}