Skip to content

Commit

Permalink
types: add CheckpointData
Browse files Browse the repository at this point in the history
  • Loading branch information
bmwill committed Apr 15, 2024
1 parent 3094b49 commit 75d92b4
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
26 changes: 26 additions & 0 deletions src/types/checkpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@ use super::CheckpointContentsDigest;
use super::CheckpointDigest;
use super::Digest;
use super::GasCostSummary;
use super::Object;
use super::SignedTransaction;
use super::TransactionDigest;
use super::TransactionEffects;
use super::TransactionEffectsDigest;
use super::TransactionEvents;
use super::UserSignature;
use super::ValidatorAggregatedSignature;
use super::ValidatorCommitteeMember;
Expand Down Expand Up @@ -76,6 +80,7 @@ pub struct CheckpointSummary {
pub version_specific_data: Vec<u8>,
}

#[derive(Clone, Debug, PartialEq)]
#[cfg_attr(
feature = "serde",
derive(serde_derive::Serialize, serde_derive::Deserialize)
Expand All @@ -99,6 +104,27 @@ pub struct CheckpointTransactionInfo {
pub signatures: Vec<UserSignature>,
}

#[derive(Clone, Debug)]
pub struct CheckpointData {
pub checkpoint_summary: SignedCheckpointSummary,
pub checkpoint_contents: CheckpointContents,
pub transactions: Vec<CheckpointTransaction>,
}

#[derive(Clone, Debug)]
pub struct CheckpointTransaction {
/// The input Transaction
pub transaction: SignedTransaction,
/// The effects produced by executing this transaction
pub effects: TransactionEffects,
/// The events, if any, emitted by this transaciton during execution
pub events: Option<TransactionEvents>,
/// The state of all inputs to this transaction as they were prior to execution.
pub input_objects: Vec<Object>,
/// The state of all output objects created or mutated by this transaction.
pub output_objects: Vec<Object>,
}

#[cfg(feature = "serde")]
#[cfg_attr(doc_cfg, doc(cfg(feature = "serde")))]
mod serialization {
Expand Down
6 changes: 3 additions & 3 deletions src/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ mod u256;

pub use address::Address;
pub use checkpoint::{
CheckpointCommitment, CheckpointContents, CheckpointSequenceNumber, CheckpointSummary,
CheckpointTimestamp, CheckpointTransactionInfo, EndOfEpochData, EpochId, ProtocolVersion,
SignedCheckpointSummary, StakeUnit,
CheckpointCommitment, CheckpointContents, CheckpointData, CheckpointSequenceNumber,
CheckpointSummary, CheckpointTimestamp, CheckpointTransaction, CheckpointTransactionInfo,
EndOfEpochData, EpochId, ProtocolVersion, SignedCheckpointSummary, StakeUnit,
};
pub use crypto::{
AddressSeed, Bls12381PrivateKey, Bls12381PublicKey, Bls12381Signature, Claim,
Expand Down

0 comments on commit 75d92b4

Please sign in to comment.