use crate::Address;
use crate::Digest;
use crate::EpochId;
use crate::GasCostSummary;
use crate::ObjectReference;
use crate::execution_status::ExecutionStatus;
use crate::object::Owner;
use crate::object::Version;
#[derive(Eq, PartialEq, Clone, Debug)]
#[cfg_attr(
feature = "serde",
derive(serde_derive::Serialize, serde_derive::Deserialize)
)]
#[cfg_attr(feature = "proptest", derive(test_strategy::Arbitrary))]
pub struct TransactionEffectsV1 {
pub status: ExecutionStatus,
pub epoch: EpochId,
pub gas_used: GasCostSummary,
#[cfg_attr(feature = "proptest", any(proptest::collection::size_range(0..=5).lift()))]
pub modified_at_versions: Vec<ModifiedAtVersion>,
#[cfg_attr(feature = "proptest", any(proptest::collection::size_range(0..=5).lift()))]
pub consensus_objects: Vec<ObjectReference>,
pub transaction_digest: Digest,
#[cfg_attr(feature = "proptest", any(proptest::collection::size_range(0..=5).lift()))]
pub created: Vec<ObjectReferenceWithOwner>,
#[cfg_attr(feature = "proptest", any(proptest::collection::size_range(0..=5).lift()))]
pub mutated: Vec<ObjectReferenceWithOwner>,
#[cfg_attr(feature = "proptest", any(proptest::collection::size_range(0..=5).lift()))]
pub unwrapped: Vec<ObjectReferenceWithOwner>,
#[cfg_attr(feature = "proptest", any(proptest::collection::size_range(0..=5).lift()))]
pub deleted: Vec<ObjectReference>,
#[cfg_attr(feature = "proptest", any(proptest::collection::size_range(0..=5).lift()))]
pub unwrapped_then_deleted: Vec<ObjectReference>,
#[cfg_attr(feature = "proptest", any(proptest::collection::size_range(0..=5).lift()))]
pub wrapped: Vec<ObjectReference>,
pub gas_object: ObjectReferenceWithOwner,
pub events_digest: Option<Digest>,
#[cfg_attr(feature = "proptest", any(proptest::collection::size_range(0..=5).lift()))]
pub dependencies: Vec<Digest>,
}
#[derive(Eq, PartialEq, Clone, Debug)]
#[cfg_attr(
feature = "serde",
derive(serde_derive::Serialize, serde_derive::Deserialize)
)]
#[cfg_attr(feature = "proptest", derive(test_strategy::Arbitrary))]
pub struct ModifiedAtVersion {
pub object_id: Address,
pub version: Version,
}
#[derive(Eq, PartialEq, Clone, Debug)]
#[cfg_attr(
feature = "serde",
derive(serde_derive::Serialize, serde_derive::Deserialize)
)]
#[cfg_attr(feature = "proptest", derive(test_strategy::Arbitrary))]
pub struct ObjectReferenceWithOwner {
pub reference: ObjectReference,
pub owner: Owner,
}
impl TransactionEffectsV1 {
pub fn status(&self) -> &ExecutionStatus {
&self.status
}
pub fn epoch(&self) -> EpochId {
self.epoch
}
pub fn gas_summary(&self) -> &GasCostSummary {
&self.gas_used
}
}