Skip to content

Commit 7cb88fa

Browse files
authored
chore(api): get_sync_progress returns short_desc (#6504)
Description --- Add `short_desc` to the `SyncProgressResponse` Motivation and Context --- Using `short_desc` would be very handy for the Tari Universe How Has This Been Tested? --- What process can a PR reviewer use to test or verify this change? --- <!-- Checklist --> <!-- 1. Is the title of your PR in the form that would make nice release notes? The title, excluding the conventional commit tag, will be included exactly as is in the CHANGELOG, so please think about it carefully. --> Breaking Changes --- - [x] None - [ ] Requires data directory on base node to be deleted - [ ] Requires hard fork - [ ] Other - Please specify <!-- Does this include a breaking change? If so, include this line as a footer --> <!-- BREAKING CHANGE: Description what the user should do, e.g. delete a database, resync the chain -->
1 parent 7a1150d commit 7cb88fa

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

applications/minotari_app_grpc/proto/base_node.proto

+1
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,7 @@ message SyncProgressResponse {
356356
uint64 tip_height = 1;
357357
uint64 local_height = 2;
358358
SyncState state = 3;
359+
string short_desc = 4;
359360
}
360361

361362
enum SyncState {

applications/minotari_node/src/grpc/base_node_grpc_server.rs

+6
Original file line numberDiff line numberDiff line change
@@ -2003,26 +2003,31 @@ impl tari_rpc::base_node_server::BaseNode for BaseNodeGrpcServer {
20032003
.borrow()
20042004
.state_info
20052005
.clone();
2006+
let short_desc = state.short_desc();
20062007
let response = match state {
20072008
StateInfo::HeaderSync(None) => tari_rpc::SyncProgressResponse {
20082009
tip_height: 0,
20092010
local_height: 0,
20102011
state: tari_rpc::SyncState::HeaderStarting.into(),
2012+
short_desc,
20112013
},
20122014
StateInfo::HeaderSync(Some(info)) => tari_rpc::SyncProgressResponse {
20132015
tip_height: info.tip_height,
20142016
local_height: info.local_height,
20152017
state: tari_rpc::SyncState::Header.into(),
2018+
short_desc,
20162019
},
20172020
StateInfo::Connecting(_) => tari_rpc::SyncProgressResponse {
20182021
tip_height: 0,
20192022
local_height: 0,
20202023
state: tari_rpc::SyncState::BlockStarting.into(),
2024+
short_desc,
20212025
},
20222026
StateInfo::BlockSync(info) => tari_rpc::SyncProgressResponse {
20232027
tip_height: info.tip_height,
20242028
local_height: info.local_height,
20252029
state: tari_rpc::SyncState::Block.into(),
2030+
short_desc,
20262031
},
20272032
_ => tari_rpc::SyncProgressResponse {
20282033
tip_height: 0,
@@ -2032,6 +2037,7 @@ impl tari_rpc::base_node_server::BaseNode for BaseNodeGrpcServer {
20322037
} else {
20332038
tari_rpc::SyncState::Startup.into()
20342039
},
2040+
short_desc,
20352041
},
20362042
};
20372043
Ok(Response::new(response))

0 commit comments

Comments
 (0)