v0.4.8-pre.010
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
// file: kb-pipeline/src/metadata_solana_program_stateful.rs
|
||||
// version: 2
|
||||
// version: 4
|
||||
|
||||
//! Bounded Solana Program Metadata account reads and authoritative state projections.
|
||||
|
||||
/// Maximum complete Solana Program Metadata account data accepted by one RPC read.
|
||||
///
|
||||
/// The decoder can validate larger account byte arrays supplied by offline or chunked sources, but
|
||||
/// the current execution RPC adapter intentionally bounds one complete `getAccountInfo` response.
|
||||
pub const MAX_SOLANA_PROGRAM_METADATA_STATEFUL_ACCOUNT_BYTES: usize =
|
||||
kb_lib::DC_METADATA_SPM_MAX_ACCOUNT_BYTES;
|
||||
kb_onchain_transport::MAX_COMPLETE_ACCOUNT_DATA_BYTES;
|
||||
|
||||
/// Expected state of one Solana Program Metadata account read.
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
|
||||
@@ -422,4 +425,18 @@ mod tests {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn stateful_complete_read_bound_matches_the_transport_contract() {
|
||||
assert_eq!(
|
||||
crate::MAX_SOLANA_PROGRAM_METADATA_STATEFUL_ACCOUNT_BYTES,
|
||||
kb_onchain_transport::MAX_COMPLETE_ACCOUNT_DATA_BYTES
|
||||
);
|
||||
const {
|
||||
assert!(
|
||||
crate::MAX_SOLANA_PROGRAM_METADATA_STATEFUL_ACCOUNT_BYTES
|
||||
< kb_lib::DC_METADATA_SPM_MAX_ACCOUNT_BYTES
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user