Skip to main content

Module statement_store

Module statement_store 

Source
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.