Trait frame_support::traits::StorePreimage
source · pub trait StorePreimage: QueryPreimage {
const MAX_LENGTH: usize;
// Required method
fn note(bytes: Cow<'_, [u8]>) -> Result<Hash, DispatchError>;
// Provided methods
fn unnote(hash: &Hash) { ... }
fn bound<T: Encode>(t: T) -> Result<Bounded<T>, DispatchError> { ... }
}
Expand description
A interface for managing preimages to hashes on chain.
Note that this API does not assume any underlying user is calling, and thus does not handle any preimage ownership or fees. Other system level logic that uses this API should implement that on their own side.
Required Associated Constants§
sourceconst MAX_LENGTH: usize
const MAX_LENGTH: usize
The maximum length of preimage we can store.
This is the maximum length of the encoded value that can be passed to bound
.