-
Notifications
You must be signed in to change notification settings - Fork 638
Open
Description
Summary
If a contributor adds a new chain to networkMapping before the ethereum-lists/chains dataset includes that chain, ./gradlew onChainCheck throws a NoSuchElementException instead of skipping the on-chain validation.
Steps to reproduce
- Checkout
masterat e0794ee`. - Extend
networkMappingwith a placeholder entry, e.g. add"demo" to 4242424242. - Create
tokens/demo/0x0000000000000000000000000000000000000001.jsonwith valid metadata. - Run
export JAVA_HOME=$HOME/.jdks/jdk-17.0.13+11 && export PATH=$JAVA_HOME/bin:$PATH. - Run
./gradlew onChainCheck -PfileToCheck=tokens/demo/0x0000000000000000000000000000000000000001.json.
Actual result
checking tokens/demo/0x0000000000000000000000000000000000000001.jsonException in thread "main"
java.util.NoSuchElementException: Collection contains no element matching the predicate.
at org.ethereum.lists.tokens.TokenCheckerKt.getRPC-B0vcT2Q(TokenChecker.kt:198)
at org.ethereum.lists.tokens.TokenCheckerKt.checkTokenFile-StX6v-4(TokenChecker.kt:100)
…
The task aborts instead of continuing with pure JSON validation.
Expected result
If no RPC endpoint exists for the chain yet, we should emit a warning and skip the RPC checks, letting the remainder of the validations finish successfully.
Environment
- Commit: e0794ee
- JDK:
openjdk version "17.0.13" 2024-10-15 (Temurin-17.0.13+11) - OS: Ubuntu 22.04 (WSL)
Related PR
- fix: handle missing RPC endpoints for new chains #978 makes
getRPCresilient by usingfirstOrNulland returningnullwhen no RPC exists, soonChainCheckcan proceed with a descriptive warning instead of crashing.
Metadata
Metadata
Assignees
Labels
No labels