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(())
}
Structs§
- PodSlot
Hash - A bytemuck-compatible (plain old data) version of
SlotHash
. - PodSlot
Hashes - API for querying of the
SlotHashes
sysvar by on-chain programs. - Slot
Hashes - Slot
Hashes Sysvar Deprecated - API for querying the
SlotHashes
sysvar.
Constants§
- ID
- The const program ID.
Traits§
- Sysvar
Id - A type that holds sysvar data and has an associated sysvar
Pubkey
.