Skip to content

Commit

Permalink
feat(iota-graphql-rpc): expose treasury cap id (#3557)
Browse files Browse the repository at this point in the history
  • Loading branch information
kodemartin authored Oct 22, 2024
1 parent 7a2d0a3 commit 5fabf77
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
4 changes: 4 additions & 0 deletions crates/iota-graphql-rpc/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -1169,6 +1169,10 @@ type Epoch {
"""
iotaTotalSupply: Int
"""
The treasury-cap id.
"""
iotaTreasuryCapId: IotaAddress
"""
Details of the system that are decided during genesis.
"""
systemParameters: SystemParameters
Expand Down
9 changes: 7 additions & 2 deletions crates/iota-graphql-rpc/src/types/system_state_summary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ use async_graphql::*;
use iota_types::iota_system_state::iota_system_state_summary::IotaSystemStateSummary as NativeSystemStateSummary;

use crate::types::{
big_int::BigInt, gas::GasCostSummary, safe_mode::SafeMode, storage_fund::StorageFund,
system_parameters::SystemParameters, uint53::UInt53,
big_int::BigInt, gas::GasCostSummary, iota_address::IotaAddress, safe_mode::SafeMode,
storage_fund::StorageFund, system_parameters::SystemParameters, uint53::UInt53,
};

#[derive(Clone, Debug)]
Expand Down Expand Up @@ -59,6 +59,11 @@ impl SystemStateSummary {
Some(self.native.iota_total_supply)
}

/// The treasury-cap id.
async fn iota_treasury_cap_id(&self) -> Option<IotaAddress> {
Some(self.native.iota_treasury_cap_id.into())
}

/// Details of the system that are decided during genesis.
async fn system_parameters(&self) -> Option<SystemParameters> {
Some(SystemParameters {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1173,6 +1173,10 @@ type Epoch {
"""
iotaTotalSupply: Int
"""
The treasury-cap id.
"""
iotaTreasuryCapId: IotaAddress
"""
Details of the system that are decided during genesis.
"""
systemParameters: SystemParameters
Expand Down

0 comments on commit 5fabf77

Please sign in to comment.