Skip to content

Commit da55a5e

Browse files
authored
chore(l2): rename L1Watcher's get_logs and process_logs functions (#3189)
**Motivation** The L1Watcher's `get_logs` and `process_logs` function names are misleading, as they only handle **deposit** logs, not all logs. **Description** Renames `get_logs` to `get_deposit_logs`, and `process_logs` to `process_deposit_logs` for clarity.
1 parent 5669bfd commit da55a5e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

crates/l2/sequencer/l1_watcher.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ impl GenServer for L1Watcher {
135135
}
136136

137137
async fn watch(state: &mut L1WatcherState) {
138-
let Ok(logs) = get_logs(state)
138+
let Ok(logs) = get_deposit_logs(state)
139139
.await
140140
.inspect_err(|err| error!("L1 Watcher Error: {err}"))
141141
else {
@@ -144,13 +144,13 @@ async fn watch(state: &mut L1WatcherState) {
144144

145145
// We may not have a deposit nor a withdrawal, that means no events -> no logs.
146146
if !logs.is_empty() {
147-
let _ = process_logs(state, logs)
147+
let _ = process_deposit_logs(state, logs)
148148
.await
149149
.inspect_err(|err| error!("L1 Watcher Error: {}", err));
150150
};
151151
}
152152

153-
pub async fn get_logs(state: &mut L1WatcherState) -> Result<Vec<RpcLog>, L1WatcherError> {
153+
pub async fn get_deposit_logs(state: &mut L1WatcherState) -> Result<Vec<RpcLog>, L1WatcherError> {
154154
if state.last_block_fetched.is_zero() {
155155
state.last_block_fetched = state
156156
.eth_client
@@ -221,7 +221,7 @@ pub async fn get_logs(state: &mut L1WatcherState) -> Result<Vec<RpcLog>, L1Watch
221221
Ok(logs)
222222
}
223223

224-
pub async fn process_logs(
224+
pub async fn process_deposit_logs(
225225
state: &L1WatcherState,
226226
logs: Vec<RpcLog>,
227227
) -> Result<Vec<H256>, L1WatcherError> {

0 commit comments

Comments
 (0)