get_fee_estimate

This commit is contained in:
hinto.janai 2024-10-14 20:15:51 -04:00
parent d7fef15cd6
commit 1e0ab56a5e
No known key found for this signature in database
GPG key ID: D47CE05FA175A499
2 changed files with 14 additions and 6 deletions

View file

@ -600,14 +600,18 @@ async fn get_version(
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L3015-L3031> /// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L3015-L3031>
async fn get_fee_estimate( async fn get_fee_estimate(
state: CupratedRpcHandler, mut state: CupratedRpcHandler,
request: GetFeeEstimateRequest, request: GetFeeEstimateRequest,
) -> Result<GetFeeEstimateResponse, Error> { ) -> Result<GetFeeEstimateResponse, Error> {
let estimate =
blockchain_context::fee_estimate(&mut state.blockchain_context, request.grace_blocks)
.await?;
Ok(GetFeeEstimateResponse { Ok(GetFeeEstimateResponse {
base: AccessResponseBase::ok(), base: AccessResponseBase::ok(),
fee: todo!(), fee: estimate.fee,
fees: todo!(), fees: estimate.fees,
quantization_mask: todo!(), quantization_mask: estimate.quantization_mask,
}) })
} }

View file

@ -1143,8 +1143,12 @@ define_request_and_response! {
get_fee_estimate, get_fee_estimate,
cc73fe71162d564ffda8e549b79a350bca53c454 => cc73fe71162d564ffda8e549b79a350bca53c454 =>
core_rpc_server_commands_defs.h => 2250..=2277, core_rpc_server_commands_defs.h => 2250..=2277,
GetFeeEstimate (empty),
Request {}, GetFeeEstimate,
Request {
grace_blocks: u64 = default_zero::<u64>(), "default_zero",
},
#[doc = serde_doc_test!( #[doc = serde_doc_test!(
GET_FEE_ESTIMATE_RESPONSE => GetFeeEstimateResponse { GET_FEE_ESTIMATE_RESPONSE => GetFeeEstimateResponse {