pub enum VersionedMessage {
Legacy(Message),
V0(Message),
}
Expand description
Either a legacy message or a v0 message.
§Serialization
If the first bit is set, the remaining 7 bits will be used to determine
which message version is serialized starting from version 0
. If the first
is bit is not set, all bytes are used to encode the legacy Message
format.
Variants§
Implementations§
Source§impl VersionedMessage
impl VersionedMessage
pub fn sanitize(&self) -> Result<(), SanitizeError>
pub fn header(&self) -> &MessageHeader
pub fn static_account_keys(&self) -> &[Pubkey]
pub fn address_table_lookups(&self) -> Option<&[MessageAddressTableLookup]>
Sourcepub fn is_signer(&self, index: usize) -> bool
pub fn is_signer(&self, index: usize) -> bool
Returns true if the account at the specified index signed this message.
Sourcepub fn is_maybe_writable(
&self,
index: usize,
reserved_account_keys: Option<&HashSet<Pubkey>>,
) -> bool
pub fn is_maybe_writable( &self, index: usize, reserved_account_keys: Option<&HashSet<Pubkey>>, ) -> bool
Returns true if the account at the specified index is writable by the instructions in this message. Since dynamically loaded addresses can’t have write locks demoted without loading addresses, this shouldn’t be used in the runtime.
pub fn is_key_passed_to_program(&self, key_index: usize) -> bool
is_instruction_account
insteadpub fn is_invoked(&self, key_index: usize) -> bool
Sourcepub fn is_non_loader_key(&self, key_index: usize) -> bool
pub fn is_non_loader_key(&self, key_index: usize) -> bool
Returns true if the account at the specified index is not invoked as a program or, if invoked, is passed to a program.
pub fn recent_blockhash(&self) -> &Hash
pub fn set_recent_blockhash(&mut self, recent_blockhash: Hash)
Sourcepub fn instructions(&self) -> &[CompiledInstruction]
pub fn instructions(&self) -> &[CompiledInstruction]
Program instructions that will be executed in sequence and committed in one atomic transaction if all succeed.
pub fn serialize(&self) -> Vec<u8> ⓘ
Sourcepub fn hash_raw_message(message_bytes: &[u8]) -> Hash
pub fn hash_raw_message(message_bytes: &[u8]) -> Hash
Compute the blake3 hash of a raw transaction message
Trait Implementations§
Source§impl Clone for VersionedMessage
impl Clone for VersionedMessage
Source§fn clone(&self) -> VersionedMessage
fn clone(&self) -> VersionedMessage
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more