ethpm / ethpm-cli

CLI tool for interacting with the ethPM ecosystem.
https://ethpm-cli.readthedocs.io/
MIT License
42 stars 12 forks source link

Normalize ens registry uris #85

Open njgheorghita opened 4 years ago

njgheorghita commented 4 years ago

What was wrong?

When adding a registry uri to the registry store via ethpm registry add [URI] - all uris should be normalized to their form with a checksummed address before being recorded in the registry store, to avoid duplicate registries in the store where one is recorded with its ENS name and the other with its checksum address. The ENS name should be saved as the registry's alias - unless an alias is passed in with a flag. Any URIs using a erc1319 scheme should also be normalized to use the ethpm scheme.

Normalized form. ethpm://CHECKSUM_ADDR:CHAIN_ID

How can it be fixed?

Most of the code that will need to be changed is in commands/registry.py and update cli tests in tests/cli/test_registry_cli.py and unit tests in tests/core/test_registry.py

It would also be nice to do some minimal validation that a registry contract exists at the given address before adding it to the store