Skip to content

Commit

Permalink
RPC-470 moving the getPriorityFeeEstimate to use v2, for easier migra…
Browse files Browse the repository at this point in the history
…tion in CF workder
  • Loading branch information
dmitriy-helius committed Dec 9, 2024
1 parent dba6286 commit 9d5d107
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/rpc_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,11 @@ pub trait AtlasPriorityFeeEstimatorRpc {

// TODO: DKH - delete after all the users were notified about moving to strict parsing
#[method(name = "getPriorityFeeEstimate")]
fn get_priority_fee_estimate_light(
fn get_priority_fee_estimate(
&self,
get_priority_fee_estimate_request: GetPriorityFeeEstimateRequestLight,
get_priority_fee_estimate_request: GetPriorityFeeEstimateRequest,
) -> RpcResult<GetPriorityFeeEstimateResponse> {
self.get_priority_fee_estimate_v1(get_priority_fee_estimate_request)
self.get_priority_fee_estimate_v2(get_priority_fee_estimate_request)
}

#[method(name = "getPriorityFeeEstimateV1")]
Expand Down Expand Up @@ -537,9 +537,9 @@ mod tests {
max_lookback_slots: 150,
};

let result = server.get_priority_fee_estimate_light(GetPriorityFeeEstimateRequestLight {
let result = server.get_priority_fee_estimate(GetPriorityFeeEstimateRequest {
account_keys: Some(vec![acc1.to_string(), acc2.to_string()]),
options: Some(GetPriorityFeeEstimateOptionsLight::default()),
options: Some(GetPriorityFeeEstimateOptions::default()),
..Default::default()
});
let resp = result.unwrap();
Expand All @@ -562,7 +562,7 @@ mod tests {
max_lookback_slots: 150,
};

let result = server.get_priority_fee_estimate_light(GetPriorityFeeEstimateRequestLight {
let result = server.get_priority_fee_estimate(GetPriorityFeeEstimateRequest {
account_keys: Some(vec![acc1.to_string(), acc2.to_string()]),
..Default::default()
});
Expand All @@ -587,19 +587,19 @@ mod tests {
max_lookback_slots: 150,
};

let result = server.get_priority_fee_estimate_light(GetPriorityFeeEstimateRequestLight {
let result = server.get_priority_fee_estimate(GetPriorityFeeEstimateRequest {
account_keys: Some(vec![acc1.to_string(), acc2.to_string()]),
options: Some(GetPriorityFeeEstimateOptionsLight {
options: Some(GetPriorityFeeEstimateOptions {
include_all_priority_fee_levels: Some(true),
..Default::default()
}),
..Default::default()
});
let resp = result.unwrap();
let levels = resp.priority_fee_levels.unwrap();
assert_eq!(levels.min, 100.0);
assert_eq!(levels.low, 100.0);
assert_eq!(levels.medium, 150.0);
assert_eq!(levels.min, 200.0);
assert_eq!(levels.low, 200.0);
assert_eq!(levels.medium, 200.0);
assert_eq!(levels.high, 200.0);
assert_eq!(levels.very_high, 200.0);
assert_eq!(levels.unsafe_max, 200.0);
Expand All @@ -621,9 +621,9 @@ mod tests {
max_lookback_slots: 150,
};

let result = server.get_priority_fee_estimate_light(GetPriorityFeeEstimateRequestLight {
let result = server.get_priority_fee_estimate(GetPriorityFeeEstimateRequest {
account_keys: Some(vec![acc1.to_string(), acc2.to_string()]),
options: Some(GetPriorityFeeEstimateOptionsLight {
options: Some(GetPriorityFeeEstimateOptions {
recommended: Some(true),
..Default::default()
}),
Expand Down

0 comments on commit 9d5d107

Please sign in to comment.