Skip to content

Commit

Permalink
Merge branch 'main' into 759-part-3
Browse files Browse the repository at this point in the history
  • Loading branch information
cylewitruk committed Nov 18, 2024
2 parents 9969048 + c4a13c8 commit 10c8b44
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions emily/handler/src/api/handlers/internal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ pub async fn execute_reorg_handler(
// and withdrawal table we'll wipe out all the history that's no longer relevant.

// Get all deposits that would be impacted by this reorg.
let all_deposits = accessors::get_all_deposit_entries_modified_after_height(
let all_deposits = accessors::get_all_deposit_entries_modified_from_height(
context,
request.canonical_tip.stacks_block_height - 1,
request.canonical_tip.stacks_block_height,
None,
)
.await?;
Expand Down Expand Up @@ -152,9 +152,9 @@ pub async fn execute_reorg_handler(
);

// Get all withdrawals that would be impacted by this reorg.
let all_withdrawals = accessors::get_all_withdrawal_entries_modified_after_height(
let all_withdrawals = accessors::get_all_withdrawal_entries_modified_from_height(
context,
request.canonical_tip.stacks_block_height - 1,
request.canonical_tip.stacks_block_height,
None,
)
.await?;
Expand Down
24 changes: 12 additions & 12 deletions emily/handler/src/database/accessors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,15 @@ const ALL_STATUSES: &[Status] = &[
Status::Reprocessing,
];

/// Gets all deposit entries modified after a given height.
pub async fn get_all_deposit_entries_modified_after_height(
/// Gets all deposit entries modified from (on or after) a given height.
pub async fn get_all_deposit_entries_modified_from_height(
context: &EmilyContext,
minimum_height: u64,
maybe_page_size: Option<i32>,
) -> Result<Vec<DepositInfoEntry>, Error> {
let mut all = Vec::new();
for status in ALL_STATUSES {
let mut received = get_all_deposit_entries_modified_after_height_with_status(
let mut received = get_all_deposit_entries_modified_from_height_with_status(
context,
status,
minimum_height,
Expand All @@ -108,8 +108,8 @@ pub async fn get_all_deposit_entries_modified_after_height(
Ok(all)
}

/// Gets all deposit entries modified after a given height.
pub async fn get_all_deposit_entries_modified_after_height_with_status(
/// Gets all deposit entries modified from (on or after) a given height.
pub async fn get_all_deposit_entries_modified_from_height_with_status(
context: &EmilyContext,
status: &Status,
minimum_height: u64,
Expand All @@ -120,7 +120,7 @@ pub async fn get_all_deposit_entries_modified_after_height_with_status(
context,
status,
&minimum_height,
">",
">=",
maybe_page_size,
)
.await
Expand Down Expand Up @@ -303,15 +303,15 @@ pub async fn get_withdrawal_entries(
.await
}

/// Gets all withdrawal entries modified after a given height.
pub async fn get_all_withdrawal_entries_modified_after_height(
/// Gets all withdrawal entries modified from (on or after) a given height.
pub async fn get_all_withdrawal_entries_modified_from_height(
context: &EmilyContext,
minimum_height: u64,
maybe_page_size: Option<i32>,
) -> Result<Vec<WithdrawalInfoEntry>, Error> {
let mut all = Vec::new();
for status in ALL_STATUSES {
let mut received = get_all_withdrawal_entries_modified_after_height_with_status(
let mut received = get_all_withdrawal_entries_modified_from_height_with_status(
context,
status,
minimum_height,
Expand All @@ -324,8 +324,8 @@ pub async fn get_all_withdrawal_entries_modified_after_height(
Ok(all)
}

/// Gets all withdrawal entries modified after a given height.
pub async fn get_all_withdrawal_entries_modified_after_height_with_status(
/// Gets all withdrawal entries modified from (on or after) a given height.
pub async fn get_all_withdrawal_entries_modified_from_height_with_status(
context: &EmilyContext,
status: &Status,
minimum_height: u64,
Expand All @@ -336,7 +336,7 @@ pub async fn get_all_withdrawal_entries_modified_after_height_with_status(
context,
status,
&minimum_height,
">",
">=",
maybe_page_size,
)
.await
Expand Down

0 comments on commit 10c8b44

Please sign in to comment.