Attribute Macro frame_support::pallet_macros::compact
#[compact]Expand description
Declares the arguments of a call function to be encoded using
[codec::Compact]. This will results in smaller extrinsic encoding.
A common example of compact is for numeric values that are often times far far away
from their theoretical maximum. For example, in the context of a crypto-currency, the
balance of an individual account is often times way less then what the numeric type
allows. In all such cases, using compact is sensible.
#[frame_support::pallet(dev_mode)]
pub mod custom_pallet {
#[pallet::call]
impl<T: Config> Pallet<T> {
pub fn some_dispatchable(_origin: OriginFor<T>, #[pallet::compact] _input: u32) -> DispatchResult {
Ok(())
}
}
}
---
**Rust-Analyzer users**: See the documentation of the Rust item in
`frame_support::pallet_macros::call`.