Skip to main content

TransactionEffectsExt

Trait TransactionEffectsExt 

Source
pub trait TransactionEffectsExt: Sealed {
    // Required methods
    fn new_from_execution_v1(
        status: ExecutionStatus,
        epoch: EpochId,
        gas_cost_summary: GasCostSummary,
        shared_objects: Vec<SharedInput>,
        loaded_per_epoch_config_objects: BTreeSet<ObjectId>,
        transaction_digest: TransactionDigest,
        lamport_version: SequenceNumber,
        changed_objects: BTreeMap<ObjectId, EffectsObjectChange>,
        gas_object: Option<ObjectId>,
        events_digest: Option<TransactionEventsDigest>,
        dependencies: Vec<TransactionDigest>,
    ) -> Self;
    fn new_empty_v1(transaction_digest: TransactionDigest) -> Self;
    fn execution_digests(&self) -> ExecutionDigests;
    fn all_changed_objects(&self) -> Vec<(ObjectRef, Owner, WriteKind)>;
    fn all_removed_objects(&self) -> Vec<(ObjectRef, ObjectRemoveKind)>;
    fn all_tombstones(&self) -> Vec<(ObjectId, SequenceNumber)>;
    fn created_then_wrapped_objects(&self) -> Vec<(ObjectId, SequenceNumber)>;
    fn mutated_excluding_gas(&self) -> Vec<(ObjectRef, Owner)>;
    fn all_affected_objects(&self) -> Vec<ObjectRef>;
    fn summary_for_debug(&self) -> TransactionEffectsDebugSummary;

    // Provided method
    fn estimate_size_upperbound_v1(
        num_writes: usize,
        num_modifies: usize,
        num_deps: usize,
    ) -> usize { ... }
}
Expand description

The version-selecting constructor and aggregating queries for the TransactionEffects enum. Sealed; implemented only for the enum.

Required Methods§

Source

fn new_from_execution_v1( status: ExecutionStatus, epoch: EpochId, gas_cost_summary: GasCostSummary, shared_objects: Vec<SharedInput>, loaded_per_epoch_config_objects: BTreeSet<ObjectId>, transaction_digest: TransactionDigest, lamport_version: SequenceNumber, changed_objects: BTreeMap<ObjectId, EffectsObjectChange>, gas_object: Option<ObjectId>, events_digest: Option<TransactionEventsDigest>, dependencies: Vec<TransactionDigest>, ) -> Self

Build effects from the results of executing a transaction under the V1 protocol shape.

Source

fn new_empty_v1(transaction_digest: TransactionDigest) -> Self

Build empty V1 effects for transaction_digest: success status, no object changes, and no gas object. For tests that need a placeholder whose effects content is irrelevant, e.g. system transactions.

Source

fn execution_digests(&self) -> ExecutionDigests

Returns the (transaction_digest, effects_digest) pair identifying this execution.

Source

fn all_changed_objects(&self) -> Vec<(ObjectRef, Owner, WriteKind)>

Return an iterator that iterates through all changed objects, including mutated, created and unwrapped objects. In other words, all objects that still exist in the object state after this transaction. It doesn’t include deleted/wrapped objects.

Source

fn all_removed_objects(&self) -> Vec<(ObjectRef, ObjectRemoveKind)>

Return all objects that existed in the state prior to the transaction but no longer exist in the state after the transaction. It includes deleted and wrapped objects, but does not include unwrapped_then_deleted objects.

Source

fn all_tombstones(&self) -> Vec<(ObjectId, SequenceNumber)>

Returns all objects that will become a tombstone after this transaction. This includes deleted, unwrapped_then_deleted and wrapped objects.

Source

fn created_then_wrapped_objects(&self) -> Vec<(ObjectId, SequenceNumber)>

Returns all objects that were created + wrapped in the same transaction.

Source

fn mutated_excluding_gas(&self) -> Vec<(ObjectRef, Owner)>

Return an iterator of mutated objects, but excluding the gas object.

Source

fn all_affected_objects(&self) -> Vec<ObjectRef>

Returns all affected objects in this transaction effects. Affected objects include created, mutated, unwrapped, deleted, unwrapped_then_deleted, wrapped and input shared objects.

Source

fn summary_for_debug(&self) -> TransactionEffectsDebugSummary

Returns a condensed TransactionEffectsDebugSummary suitable for logging and inspection.

Provided Methods§

Source

fn estimate_size_upperbound_v1( num_writes: usize, num_modifies: usize, num_deps: usize, ) -> usize

Upper-bound estimate of the serialized size in bytes of effects with the given number of writes, modifies, and dependencies under the V1 protocol shape.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§