molpha_verifier/payload.rs
1//! Plain `DataUpdate` payload struct.
2//!
3//! Field order and types match the on-chain `SubmitDataUpdateArgs` instruction argument so a
4//! mechanical field copy converts between the two. With the `borsh` feature enabled the byte
5//! layout also matches the 161-byte anchor borsh layout, but the crate does not rely on that.
6
7/// A signed Molpha data update.
8#[derive(Clone, Debug, PartialEq, Eq)]
9#[cfg_attr(
10 feature = "borsh",
11 derive(borsh::BorshSerialize, borsh::BorshDeserialize)
12)]
13pub struct DataUpdate {
14 pub feed_id: [u8; 32],
15 pub registry_version: u32,
16 pub value: [u8; 32],
17 pub canonical_timestamp: i64,
18 pub signatures_required: u8,
19
20 /// Aggregate Schnorr signature scalar `s`.
21 pub agg_sig_s: [u8; 32],
22 /// Ethereum-style commitment address (20 bytes).
23 pub commitment_addr: [u8; 20],
24 /// EVM `uint256` bitmap (big-endian) of which nodes signed.
25 pub signers_bitmap: [u8; 32],
26}