Skip to content

Commit

Permalink
optimism -> op_bridge
Browse files Browse the repository at this point in the history
  • Loading branch information
shekhirin committed Apr 11, 2024
1 parent 80dca67 commit cfaa417
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ members = [
"examples/trace-transaction-cli/",
"examples/polygon-p2p/",
"examples/custom-inspector/",
"examples/exex/optimism/",
"examples/exex/op_bridge/",
"testing/ef-tests/",
]
default-members = ["bin/reth"]
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ use rusqlite::Connection;
sol!(L1StandardBridge, "l1_standard_bridge_abi.json");
use crate::L1StandardBridge::{ETHBridgeFinalized, ETHBridgeInitiated, L1StandardBridgeEvents};

struct OptimismExEx<Node: FullNodeTypes> {
struct OPBridgeExEx<Node: FullNodeTypes> {
ctx: ExExContext<Node>,
connection: Connection,
}

impl<Node: FullNodeTypes> OptimismExEx<Node> {
impl<Node: FullNodeTypes> OPBridgeExEx<Node> {
fn new(ctx: ExExContext<Node>, connection: Connection) -> eyre::Result<Self> {
// Create deposits and withdrawals tables
connection.execute(
Expand Down Expand Up @@ -85,7 +85,7 @@ impl<Node: FullNodeTypes> OptimismExEx<Node> {
}
}

impl<Node: FullNodeTypes> Future for OptimismExEx<Node> {
impl<Node: FullNodeTypes> Future for OPBridgeExEx<Node> {
type Output = eyre::Result<()>;

fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
Expand Down Expand Up @@ -189,6 +189,8 @@ impl<Node: FullNodeTypes> Future for OptimismExEx<Node> {
}
}

/// Decode chain of blocks into a flattened list of receipt logs, and filter only
/// [L1StandardBridgeEvents].
fn decode_chain_into_events(
chain: &Chain,
) -> impl Iterator<Item = (&SealedBlockWithSenders, &TransactionSigned, &Log, L1StandardBridgeEvents)>
Expand Down Expand Up @@ -218,9 +220,9 @@ fn main() -> eyre::Result<()> {
reth::cli::Cli::parse_args().run(|builder, _| async move {
let handle = builder
.node(EthereumNode::default())
.install_exex("Optimism", move |ctx| async {
let connection = Connection::open("optimism.db")?;
OptimismExEx::new(ctx, connection)
.install_exex("OPBridge", move |ctx| async {
let connection = Connection::open("op_bridge.db")?;
OPBridgeExEx::new(ctx, connection)
})
.launch()
.await?;
Expand Down

0 comments on commit cfaa417

Please sign in to comment.