mirror of
https://github.com/hinto-janai/cuprate.git
synced 2024-12-23 03:59:37 +00:00
remove BlockchainManagerRequest::Overview
This commit is contained in:
parent
d9787f95ff
commit
b42a110c98
2 changed files with 0 additions and 36 deletions
|
@ -97,20 +97,6 @@ pub enum BlockchainManagerRequest {
|
||||||
/// The address that will receive the coinbase reward.
|
/// The address that will receive the coinbase reward.
|
||||||
wallet_address: String,
|
wallet_address: String,
|
||||||
},
|
},
|
||||||
|
|
||||||
/// Get a visual [`String`] overview of blockchain progress.
|
|
||||||
///
|
|
||||||
/// This is a highly implementation specific format used by
|
|
||||||
/// `monerod` in the `sync_info` RPC call's `overview` field;
|
|
||||||
/// it is essentially an ASCII visual of blocks.
|
|
||||||
///
|
|
||||||
/// See also:
|
|
||||||
/// - <https://www.getmonero.org/resources/developer-guides/daemon-rpc.html#sync_info>
|
|
||||||
/// - <https://github.com/monero-project/monero/blob/master/src/cryptonote_protocol/block_queue.cpp#L178>
|
|
||||||
Overview {
|
|
||||||
/// TODO: the current blockchain height? do we need to pass this?
|
|
||||||
height: usize,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// TODO: use real type when public.
|
/// TODO: use real type when public.
|
||||||
|
@ -157,9 +143,6 @@ pub enum BlockchainManagerResponse {
|
||||||
/// The new top height. (TODO: is this correct?)
|
/// The new top height. (TODO: is this correct?)
|
||||||
height: usize,
|
height: usize,
|
||||||
},
|
},
|
||||||
|
|
||||||
/// Response to [`BlockchainManagerRequest::Overview`]
|
|
||||||
Overview(String),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// TODO: use real type when public.
|
/// TODO: use real type when public.
|
||||||
|
|
|
@ -214,22 +214,3 @@ pub(crate) async fn generate_blocks(
|
||||||
|
|
||||||
Ok((blocks, usize_to_u64(height)))
|
Ok((blocks, usize_to_u64(height)))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// [`BlockchainManagerRequest::Overview`]
|
|
||||||
pub(crate) async fn overview(
|
|
||||||
blockchain_manager: &mut BlockchainManagerHandle,
|
|
||||||
height: u64,
|
|
||||||
) -> Result<String, Error> {
|
|
||||||
let BlockchainManagerResponse::Overview(overview) = blockchain_manager
|
|
||||||
.ready()
|
|
||||||
.await?
|
|
||||||
.call(BlockchainManagerRequest::Overview {
|
|
||||||
height: u64_to_usize(height),
|
|
||||||
})
|
|
||||||
.await?
|
|
||||||
else {
|
|
||||||
unreachable!();
|
|
||||||
};
|
|
||||||
|
|
||||||
Ok(overview)
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue