Skip to main content

encode_contract_id_list

Function encode_contract_id_list 

Source
pub fn encode_contract_id_list<'a, I>(ids: I) -> Vec<u8> 
where I: IntoIterator<Item = &'a [u8; 32]>,
Expand description

Serialize contract instance ids for DelegateCtx::list_subscriptions: the raw 32 bytes of each id, back to back, with no framing.

Ids are fixed width, so unlike the secret-key list below they need no length prefix. The encoding lives here rather than only in the host so that both sides and the round-trip tests share one authoritative definition — a codec written twice is a codec that will disagree with itself eventually.