Expand description
Pure sp-statement-store encoding and decoding functions.
No I/O. No network calls. WASM-safe.
Implements the binary statement format used by Substrate’s statement store pallet.
Callers are responsible for providing the current time (as Unix seconds) so that
this module remains free of std::time and is WASM-safe.
Re-exports§
pub use crate::hex_decode;pub use crate::hex_encode;
Structs§
- Statement
- A decoded statement from the statement store.
Functions§
- assemble_
statement - Assemble a complete encoded statement from a signing payload and sr25519 signature.
- blake2b_
256 - Compute a blake2b-256 hash.
- blake2b_
256_ keyed - Keyed Blake2b-256 hash.
- build_
signing_ payload - Build the signing payload for a statement.
- decode_
compact_ u32 - Decode SCALE Compact
, returns (value, bytes_consumed). - decode_
statement - Decode a statement from SCALE binary encoding (sp-statement-store format).
- derive_
topic_ from_ account - Derive a 32-byte topic from a context string, a raw AccountId, and optional extra bytes.
- encode_
compact_ u32 - Encode SCALE Compact
. - encode_
statement - Encode a statement into the sp-statement-store SCALE binary format.
- extract_
signing_ payload - Extract the signing payload from a raw encoded statement.
- string_
to_ topic - Hash a string into a 32-byte Topic (blake2b-256).
Type Aliases§
- Topic
- Topic = 32-byte blake2b hash.