Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/iota-rest-api/openapi/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -4126,12 +4126,12 @@
"type": "boolean"
},
"safe_mode_computation_charges": {
"description": "Amount of computation rewards accumulated (and not yet distributed) during safe mode.",
"description": "Amount of computation charges accumulated (and not yet distributed) during safe mode.",
"type": "string",
"format": "u64"
},
"safe_mode_computation_charges_burned": {
"description": "Amount of burned computation rewards accumulated during safe mode.",
"description": "Amount of burned computation charges accumulated during safe mode.",
"type": "string",
"format": "u64"
},
Expand Down
10 changes: 7 additions & 3 deletions crates/iota-rest-api/src/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,17 @@ impl StateReader {
}

pub fn get_system_state_summary(&self) -> Result<super::system::SystemStateSummary> {
use iota_types::iota_system_state::IotaSystemStateTrait;
use iota_types::iota_system_state::{
IotaSystemStateTrait, iota_system_state_summary::IotaSystemStateSummaryV2,
};

let system_state = iota_types::iota_system_state::get_iota_system_state(self.inner())
.map_err(StorageError::custom)?;
let summary = system_state.into_iota_system_state_summary().into();
let summary =
IotaSystemStateSummaryV2::try_from(system_state.into_iota_system_state_summary())
.map_err(StorageError::custom)?;

Ok(summary)
Ok(summary.into())
}

pub fn get_transaction(
Expand Down
10 changes: 5 additions & 5 deletions crates/iota-rest-api/src/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,12 @@ pub struct SystemStateSummary {
#[serde_as(as = "iota_types::iota_serde::BigInt<u64>")]
#[schemars(with = "crate::_schemars::U64")]
pub safe_mode_storage_charges: u64,
/// Amount of computation rewards accumulated (and not yet distributed)
/// Amount of computation charges accumulated (and not yet distributed)
/// during safe mode.
#[serde_as(as = "iota_types::iota_serde::BigInt<u64>")]
#[schemars(with = "crate::_schemars::U64")]
pub safe_mode_computation_charges: u64,
/// Amount of burned computation rewards accumulated during safe mode.
/// Amount of burned computation charges accumulated during safe mode.
#[serde_as(as = "iota_types::iota_serde::BigInt<u64>")]
#[schemars(with = "crate::_schemars::U64")]
pub safe_mode_computation_charges_burned: u64,
Expand Down Expand Up @@ -430,13 +430,13 @@ impl From<iota_types::iota_system_state::iota_system_state_summary::IotaValidato
}
}

impl From<iota_types::iota_system_state::iota_system_state_summary::IotaSystemStateSummary>
impl From<iota_types::iota_system_state::iota_system_state_summary::IotaSystemStateSummaryV2>
for SystemStateSummary
{
fn from(
value: iota_types::iota_system_state::iota_system_state_summary::IotaSystemStateSummary,
value: iota_types::iota_system_state::iota_system_state_summary::IotaSystemStateSummaryV2,
) -> Self {
let iota_types::iota_system_state::iota_system_state_summary::IotaSystemStateSummary {
let iota_types::iota_system_state::iota_system_state_summary::IotaSystemStateSummaryV2 {
epoch,
protocol_version,
system_state_version,
Expand Down
Loading