Closed
Description
What feature should we add?
We are properly encoding a name for ENS but really it's just a few simple rules on top of DNS encoding. It is referred to as just DNS Encoding the name in the ENS docs. I think for consistency we should create a dns_encode
method that returns ens_encode
under the hood, then deprecate ens_encode
and remove in v8
. I think we should wrap the return value for the new method in HexBytes
so that to_0x_hex()
is accessible as an option on the return value. This is mainly to keep consistency across languages for web3 tooling, as well as consistency in naming with the ENS docs.
- Rename
ens_encode
utility method asdns_encode
- Wrap the return value in
HexBytes
so it can be more easily represented as a 0x-prefixed hex - Create
ens_encode
(to keep backward compatibility inv7
) andreturn bytes(dns_encode(name))
- Deprecate
ens_encode
to be removed inv8
with a message to usedns_encode