Expand description
The most recent hashes of a slot’s parent banks.
The slot hashes sysvar provides access to the SlotHashes
type.
The Sysvar::from_account_info
and Sysvar::get
methods always return
ProgramError::UnsupportedSysvar
because this sysvar account is too large
to process on-chain. Thus this sysvar cannot be accessed on chain, though
one can still use the SysvarId::id
, SysvarId::check_id
and
Sysvar::size_of
methods in an on-chain program, and it can be accessed
off-chain through RPC.
§Examples
Calling via the RPC client:
fn print_sysvar_slot_hashes(client: &RpcClient) -> Result<()> {
let slot_hashes = client.get_account(&slot_hashes::ID)?;
let data: SlotHashes = bincode::deserialize(&slot_hashes.data)?;
Ok(())
}
Re-exports§
pub use crate::slot_hashes::SlotHashes;
Constants§
- The const program ID.
Functions§
- Returns
true
if given pubkey is the program ID. - Returns the program ID.