#[cfg(test)]
mod tests;
use crate::fleet_ensure::model::{ActualCycleConservation, u128_text};
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(untagged)]
pub enum FleetRetirementConservationRecord {
ExternalDebit(Box<RetirementExternalDebitRecord>),
NetBalance(ActualCycleConservation),
RecordedExecution(RecordedExecutionConservationRecord),
}
#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct RecordedExecutionConservationRecord {
#[serde(with = "u128_text")]
estate_funding_cycles: u128,
#[serde(with = "u128_text")]
exact_estate_creation_fee_cycles: u128,
#[serde(with = "u128_text")]
exact_unavoidable_fee_cycles: u128,
#[serde(with = "u128_text")]
final_controlled_cycles: u128,
#[serde(with = "u128_text")]
measured_execution_burn_cycles: u128,
#[serde(with = "u128_text")]
observed_starting_cycles: u128,
#[serde(with = "u128_text")]
observed_settlement_credit_cycles: u128,
#[serde(with = "u128_text")]
operator_debit_cycles: u128,
#[serde(with = "u128_text")]
received_new_funding_cycles: u128,
}
#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct RetirementExternalDebitRecord {
pub source_conservation: ActualCycleConservation,
pub external_debit: RetirementWithdrawalRecord,
}
#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct RetirementWithdrawalRecord {
pub ledger: String,
pub operator: String,
pub destination: String,
pub network_identity_sha256: String,
pub block_sha256: String,
pub block_index: u64,
pub timestamp_ns: u64,
#[serde(with = "u128_text")]
pub amount_cycles: u128,
#[serde(with = "u128_text")]
pub fee_cycles: u128,
}