Skip to content

Commit

Permalink
feat(pragma_exex): Renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
akhercha committed Oct 2, 2024
1 parent d3ff359 commit 724c961
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion crates/client/sync/src/l2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ fn notify_exexs(exex_manager: &Option<ExExManagerHandle>, block_n: u64) -> anyho
return Ok(());
};

let notification = ExExNotification::BlockSynced { new: BlockNumber(block_n) };
let notification = ExExNotification::BlockSynced { block_number: BlockNumber(block_n) };
manager.send(notification).map_err(|e| anyhow::anyhow!("Could not send ExEx notification: {}", e))
}

Expand Down
5 changes: 2 additions & 3 deletions crates/node/src/extensions/pragma_dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,14 @@ pub async fn exex_pragma_dispatch(mut ctx: ExExContext) -> anyhow::Result<()> {
while let Some(notification) = ctx.notifications.next().await {
let block_number = match notification {
ExExNotification::BlockProduced { block: _, block_number } => block_number,
ExExNotification::BlockSynced { new } => {
ExExNotification::BlockSynced { block_number } => {
// This ExEx doesn't do anything for Synced blocks from the Full node
ctx.events.send(ExExEvent::FinishedHeight(new))?;
ctx.events.send(ExExEvent::FinishedHeight(block_number))?;
continue;
}
};

let dispatch_tx = create_dispatch_tx(&ctx.starknet)?;

log::info!("🧩 [#{}] Pragma's ExEx: Adding dispatch transaction...", block_number);
ctx.starknet.add_invoke_transaction(dispatch_tx).await?;

Expand Down
2 changes: 1 addition & 1 deletion crates/primitives/exex/src/notification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub enum ExExNotification {
/// A new block got produced by the Block Production task.
BlockProduced { block: Box<MadaraPendingBlock>, block_number: BlockNumber },
/// A new block got synced by the full node.
BlockSynced { new: BlockNumber },
BlockSynced { block_number: BlockNumber },
}

/// A stream of [`ExExNotification`]s. The stream will emit notifications for all blocks.
Expand Down

0 comments on commit 724c961

Please sign in to comment.