pub struct Transaction<'a> {
pub header: &'a TransactionHeader,
pub read_slots: &'a [TransactionSlot],
pub write_slots: &'a [TransactionSlot],
pub payload: &'a [u128],
pub seal: &'a [u8],
}
Expand description
Similar to Transaction
, but doesn’t require allow
or data ownership.
Can be created with Transaction::as_ref()
call.
Fields§
§header: &'a TransactionHeader
§read_slots: &'a [TransactionSlot]
Slots in the form of TransactionSlot
that may be read during transaction processing.
These are the only slots that can be used in authorization code.
The code slot of the contract that is being executed and balance of native token are
implicitly included and doesn’t need to be specified (see Transaction::read_slots()
.
Also slots that may also be written to do not need to be repeated in the read slots.
write_slots: &'a [TransactionSlot]
Slots in the form of TransactionSlot
that may be written during transaction processing
payload: &'a [u128]
§seal: &'a [u8]
Implementations§
Source§impl Transaction<'_>
impl Transaction<'_>
Sourcepub fn hash(&self) -> TransactionHash
pub fn hash(&self) -> TransactionHash
Compute transaction hash.
Note: this computes transaction hash on every call, so worth caching if it is expected to be called often.
Sourcepub fn read_slots(&self) -> impl Iterator<Item = TransactionSlot>
pub fn read_slots(&self) -> impl Iterator<Item = TransactionSlot>
Read slots touched by the transaction.
In contrast to read_slots
property, this includes implicitly used slots.
Sourcepub fn slots(&self) -> impl Iterator<Item = TransactionSlot>
pub fn slots(&self) -> impl Iterator<Item = TransactionSlot>
All slots touched by the transaction.
In contrast to read_slots
and write_slots
properties, this includes implicitly used
slots.
Trait Implementations§
Source§impl<'a> Clone for Transaction<'a>
impl<'a> Clone for Transaction<'a>
Source§fn clone(&self) -> Transaction<'a>
fn clone(&self) -> Transaction<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more