Skip to content

Commit

Permalink
feat(rooch-rpc-api): add avail_backends to DAInfoView
Browse files Browse the repository at this point in the history
Extend `DAInfoView` with an `avail_backends` field to include backend availability details. Updated `From<DAServerStatus>` impl to map the new field as part of the conversion.
  • Loading branch information
popcnt1 committed Jan 20, 2025
1 parent 02089c6 commit 386a1e8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions crates/rooch-rpc-api/src/jsonrpc_types/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ pub struct DAInfoView {
pub last_avail_block_number: Option<StrView<u128>>,
pub last_avail_tx_order: Option<StrView<u64>>,
pub last_avail_block_update_time: Option<StrView<u64>>,
pub avail_backends: Vec<(String, StrView<u128>)>,
}

impl From<DAServerStatus> for DAInfoView {
Expand All @@ -92,6 +93,11 @@ impl From<DAServerStatus> for DAInfoView {
last_avail_block_number: info.last_avail_block_number.map(Into::into),
last_avail_tx_order: info.last_avail_tx_order.map(Into::into),
last_avail_block_update_time: info.last_avail_block_update_time.map(Into::into),
avail_backends: info
.avail_backends
.into_iter()
.map(|(k, v)| (k, v.into()))
.collect(),
}
}
}
Expand Down

0 comments on commit 386a1e8

Please sign in to comment.