Skip to content

Commit

Permalink
fix(storage): return withdrawals for address for l1 and l2 addrs matc…
Browse files Browse the repository at this point in the history
…hes (#378)

# What ❔

> When address A makes withdrawal to address B, api will only show that
withdrawal on address B. While we want to show it for both A and B.

## Why ❔

<!-- Why are these changes done? What goal do they contribute to? What
are the principles behind them? -->
<!-- Example: PR templates ensure PR reviewers, observers, and future
iterators are in context about the evolution of repos. -->

## Checklist

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [ ] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [ ] Tests for the changes have been added / updated.
- [ ] Documentation comments have been added / updated.
- [ ] Code has been formatted via `cargo fmt`.
  • Loading branch information
montekki committed Jan 30, 2024
1 parent 70b317e commit b0628f1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion storage/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1403,7 +1403,10 @@ pub async fn withdrawals_for_address(
AND finalization_data.l2_tx_number_in_block = l2_to_l1_events.tx_number_in_block
JOIN withdrawals ON
withdrawals.id = finalization_data.withdrawal_id
WHERE l2_to_l1_events.to_address = $1
WHERE
l2_to_l1_events.to_address = $1
OR
finalization_data.sender = $1
ORDER BY l2_to_l1_events.l2_block_number DESC
LIMIT $2
",
Expand Down

0 comments on commit b0628f1

Please sign in to comment.