use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct TransactionGenesisTransaction {
#[serde(rename = "version")]
pub version: String,
#[serde(rename = "hash")]
pub hash: String,
#[serde(rename = "state_change_hash")]
pub state_change_hash: String,
#[serde(rename = "event_root_hash")]
pub event_root_hash: String,
#[serde(rename = "state_checkpoint_hash", skip_serializing_if = "Option::is_none")]
pub state_checkpoint_hash: Option<String>,
#[serde(rename = "gas_used")]
pub gas_used: String,
#[serde(rename = "success")]
pub success: bool,
#[serde(rename = "vm_status")]
pub vm_status: String,
#[serde(rename = "accumulator_root_hash")]
pub accumulator_root_hash: String,
#[serde(rename = "changes")]
pub changes: Vec<models::WriteSetChange>,
#[serde(rename = "payload")]
pub payload: Box<models::GenesisPayload>,
#[serde(rename = "events")]
pub events: Vec<models::Event>,
#[serde(rename = "type")]
pub r#type: Type,
}
impl TransactionGenesisTransaction {
pub fn new(version: String, hash: String, state_change_hash: String, event_root_hash: String, gas_used: String, success: bool, vm_status: String, accumulator_root_hash: String, changes: Vec<models::WriteSetChange>, payload: models::GenesisPayload, events: Vec<models::Event>, r#type: Type) -> TransactionGenesisTransaction {
TransactionGenesisTransaction {
version,
hash,
state_change_hash,
event_root_hash,
state_checkpoint_hash: None,
gas_used,
success,
vm_status,
accumulator_root_hash,
changes,
payload: Box::new(payload),
events,
r#type,
}
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
#[serde(rename = "genesis_transaction")]
GenesisTransaction,
}
impl Default for Type {
fn default() -> Type {
Self::GenesisTransaction
}
}