Skip to content

Commit

Permalink
main: 📜 ExEx logs
Browse files Browse the repository at this point in the history
  • Loading branch information
akhercha committed Oct 28, 2024
1 parent 6bd214b commit f97ebfd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/node/src/extensions/pragma_dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,16 +158,17 @@ async fn update_feed_ids_if_necessary(
Ok(())
}

/// Create a Dispatch tx and sends it.
/// Logs info about the tx status.
/// Create a Dispatch tx and sends it.
/// Waits for the tx & logs info about the status.
async fn process_dispatch_transaction(ctx: &ExExContext, block_number: u64, feed_ids: &[Felt]) -> anyhow::Result<()> {
let invoke_result = create_and_add_dispatch_tx(&ctx.starknet, feed_ids, block_number).await?;
log::info!(
"🧩 [#{}] Pragma's ExEx: Transaction sent, hash: {:#064x}",
block_number,
&invoke_result.transaction_hash
);

wait_for_tx(&ctx.starknet, invoke_result.transaction_hash, CHECK_INTERVAL, block_number).await?;
log::info!("🧩 [#{}] Pragma's ExEx: transaction {:#064x} accepted!", block_number, invoke_result.transaction_hash);
Ok(())
}

Expand All @@ -180,7 +181,6 @@ async fn create_and_add_dispatch_tx(
let dispatch_tx = create_dispatch_tx(starknet, feed_ids)?;
log::info!("🧩 [#{}] Pragma's ExEx: Adding dispatch transaction...", block_number);
let invoke_result = starknet.add_invoke_transaction(dispatch_tx).await?;
wait_for_tx(starknet, invoke_result.transaction_hash, CHECK_INTERVAL, block_number).await?;
Ok(invoke_result)
}

Expand Down

0 comments on commit f97ebfd

Please sign in to comment.