Skip to content

Commit

Permalink
feat: add mekong
Browse files Browse the repository at this point in the history
  • Loading branch information
iankressin committed Nov 11, 2024
1 parent a640bf6 commit 3a0b09c
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion crates/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ readme = "README.md"
alloy = { version = "0.2", features = ["std", "contract", "provider-http", "network", "rpc-types"] }
pest = "2.7.10"
pest_derive = "2.6"
tokio = { version = "1", features = ["macros"] }
tokio = { version = "1", features = ["macros", "rt"] }
serde = { version = "1" }
serde_json = { version = "1" }
serde_with = "1.14"
Expand Down
7 changes: 7 additions & 0 deletions crates/core/src/common/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ pub enum Chain {
Fantom,
Kava,
Gnosis,

// Short-lived Pectra testnet
Mekong,
}

#[derive(thiserror::Error, Debug)]
Expand Down Expand Up @@ -137,6 +140,7 @@ impl Chain {
Chain::Fantom => "https://fantom.drpc.org",
Chain::Kava => "https://evm.kava.io",
Chain::Gnosis => "https://gnosis.drpc.org",
Chain::Mekong => "https://rpc.mekong.ethpandaops.io",
}
}
}
Expand Down Expand Up @@ -174,6 +178,7 @@ impl TryFrom<&str> for Chain {
"fantom" => Ok(Chain::Fantom),
"kava" => Ok(Chain::Kava),
"gnosis" => Ok(Chain::Gnosis),
"mekong" => Ok(Chain::Mekong),
_ => Err(ChainError::InvalidChain(chain.to_string())),
}
}
Expand Down Expand Up @@ -204,6 +209,7 @@ impl From<&Chain> for u64 {
Chain::Fantom => 250,
Chain::Kava => 2222,
Chain::Gnosis => 100,
Chain::Mekong => 7078815900,
}
}
}
Expand Down Expand Up @@ -265,6 +271,7 @@ impl fmt::Display for Chain {
Chain::Fantom => "fantom",
Chain::Kava => "kava",
Chain::Gnosis => "gnosis",
Chain::Mekong => "mekong",
};
write!(f, "{}", chain_str)
}
Expand Down
4 changes: 3 additions & 1 deletion crates/core/src/interpreter/backend/resolve_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ pub async fn batch_get_blocks(
for block_number in block_numbers {
let provider = Arc::clone(&provider);
let block_future = async move {
get_block(BlockNumberOrTag::Number(block_number), provider, hydrate).await
let block = get_block(BlockNumberOrTag::Number(block_number), provider, hydrate).await;
println!("block: {:#?}", block);
block
};
block_futures.push(block_future);
}
Expand Down
3 changes: 2 additions & 1 deletion crates/core/src/interpreter/frontend/productions.pest
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,8 @@ chain = {
"ronin" |
"fantom" |
"kava" |
"gnosis"
"gnosis" |
"mekong"
}
rpc_url = { ("http://" | "https://") ~ (ASCII_ALPHANUMERIC | "." | "-" | ":" | "/")+ }
address = { "0x" ~ (ASCII_HEX_DIGIT){40} }
Expand Down
6 changes: 6 additions & 0 deletions eqlup/default-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@
"rpcs": [
"https://gnosis.drpc.org"
]
},
"mekong": {
"default": "https://rpc.mekong.ethpandaops.io",
"rpcs": [
"https://rpc.mekong.ethpandaops.io"
]
}
}
}

0 comments on commit 3a0b09c

Please sign in to comment.