Closed DavidRomanovizc closed 10 months ago
Hey @DavidRomanovizc nice work here and great to see the tests. Thinking about long term maintenance, I think we should just load and parse the JSON straight from https://chainid.network/chains_mini.json and then just loop over those to initialize each Network
object.
If you have a chance to update how the initialization is done we'll get these merged! Thanks.
Hey @DavidRomanovizc nice work here and great to see the tests. Thinking about long term maintenance, I think we should just load and parse the JSON straight from https://chainid.network/chains_mini.json and then just loop over those to initialize each
Network
object.If you have a chance to update how the initialization is done we'll get these merged! Thanks.
Hello! I have updated the code. Now we load data from JSON, but our ChainId is not updating. If we have to load a new network from JSON and there is no ChainId present, it will raise a ValueError. Maybe we need update class ChainId
Got it, that makes sense. I'll make sure to update eth-typings with the latest networks periodically.
Got it, that makes sense. I'll make sure to update eth-typings with the latest networks periodically.
Also I've been thinking about the fact that we can get the symbol
from the JSON, so we won't need the ChainId. Can we do that or we need use ChainId
in this task?
@DavidRomanovizc that's a good thought, though the Network typings are better off if we keep ChainId
. It shouldn't take much to maintain the list in eth-typing, where I'll be adding a script to update that list for us.
@DavidRomanovizc one more thank you! Appreciate the contribution.
What was wrong?
Related to Issue #253 Closes #253
How was it fixed?
Created dictionaries
network_names
andnetwork_short_names
and the list networks that contains objects of the Network class with data about the network, includingchain_id
,name
,shortName
, andsymbol
. And implemented three functions: the first one extracts data from Network, the second one returns the Network name, and the third one returns the short network name. Additionally, I covered the code with parameterized tests.Todo:
[x] Clean up commit history
[x] Add or update documentation related to these changes
[x] Add entry to the release notes
Cute Animal Picture