Skip to content

Commit

Permalink
fix: filter out chains with invalid chain_id
Browse files Browse the repository at this point in the history
  • Loading branch information
lok52 committed Dec 12, 2024
1 parent 959019c commit bf0df8b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions multichain-aggregator/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion multichain-aggregator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ alloy-primitives = "0.8"
anyhow = "1.0"
async-std = { version = "1", features = ["attributes", "tokio1"] }
async-trait = "0.1"
blockscout-chains = { git = "https://github.com/blockscout/blockscout-rs", version = "0.1.0" }
blockscout-chains = { git = "https://github.com/blockscout/blockscout-rs", version = "0.2.0" }
config = "0.13"
env-collector = { git = "https://github.com/blockscout/blockscout-rs", version = "0.1.1" }
pretty_assertions = "1.3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ pub async fn run(settings: Settings) -> Result<(), anyhow::Error> {
.fetch_all()
.await?
.into_iter()
.map(|(id, chain)| (id as i64, chain).into())
.filter_map(|(id, chain)| {
let id = id.parse::<i64>().ok()?;
Some((id, chain).into())
})
.collect::<Vec<_>>();
repository::chains::upsert_many(&db, blockscout_chains.clone()).await?;

Expand Down

0 comments on commit bf0df8b

Please sign in to comment.