Skip to content

Commit

Permalink
Replace jasoncarver.eth with ens.eth (#3022)
Browse files Browse the repository at this point in the history
* Replace jasoncarver.eth with ens.eth

* Set proper current address for ens.eth

* Revert non-ens docs

* Update bytes representation of address
  • Loading branch information
reedsa authored Jul 6, 2023
1 parent db7e344 commit 305b3c3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
36 changes: 18 additions & 18 deletions docs/ens_overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ Get the Address for an ENS Name
.. code-block:: python
from ens.auto import ns
eth_address = ns.address('jasoncarver.eth')
assert eth_address == '0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD'
eth_address = ns.address('ens.eth')
assert eth_address == '0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7'
The ``ENS`` module has no opinion as to which TLD you can use,
but will not infer a TLD if it is not provided with the name.
Expand All @@ -199,13 +199,13 @@ Get the ENS Name for an Address

.. code-block:: python
domain = ns.name('0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD')
domain = ns.name('0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7')
# name() also accepts the bytes version of the address
assert ns.name(b'[ c$o!\x91\xf1\x8f&u\xce\xdb\x8b(\x10.\x95tX') == domain
assert ns.name(b'\xfe\x89\xccz\xbb,A\x83h:\xb7\x16S\xc4\xcd\xc9\xb0-D\xb7') == domain
# confirm that the name resolves back to the address that you looked up:
assert ns.address(domain) == '0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD'
assert ns.address(domain) == '0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7'
.. note:: For accuracy, and as a recommendation from the ENS documentation on
`reverse resolution <https://docs.ens.domains/dapp-developer-guide/resolving-names#reverse-resolution>`_,
Expand Down Expand Up @@ -233,24 +233,24 @@ you must already be the owner of the domain (or its parent).

.. code-block:: python
ns.setup_address('jasoncarver.eth', '0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD')
ns.setup_address('ens.eth', '0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7')
In the common case where you want to point the name to the owning address, you can skip the address.

.. code-block:: python
ns.setup_address('jasoncarver.eth')
ns.setup_address('ens.eth')
You can claim arbitrarily deep subdomains.

.. code-block:: python
ns.setup_address('supreme.executive.power.derives.from.a.mandate.from.the.masses.jasoncarver.eth')
ns.setup_address('supreme.executive.power.derives.from.a.mandate.from.the.masses.ens.eth')
# wait for the transaction to be mined, then:
assert (
ns.address('supreme.executive.power.derives.from.a.mandate.from.the.masses.jasoncarver.eth')
== '0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD'
ns.address('supreme.executive.power.derives.from.a.mandate.from.the.masses.ens.eth')
== '0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7'
)
.. warning:: Gas costs scale up with the number of subdomains!
Expand All @@ -265,14 +265,14 @@ this is referred to as "reverse" resolution. The ENS Reverse Resolver is used fo

.. code-block:: python
ns.setup_name('jasoncarver.eth', '0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD')
ns.setup_name('ens.eth', '0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7')
If you don't supply the address, :meth:`~ens.ENS.setup_name` will assume you want the
address returned by :meth:`~ens.ENS.address`.

.. code-block:: python
ns.setup_name('jasoncarver.eth')
ns.setup_name('ens.eth')
If the name doesn't already point to an address, :meth:`~ens.ENS.setup_name` will
call :meth:`~ens.ENS.setup_address` for you.
Expand All @@ -281,7 +281,7 @@ Wait for the transaction to be mined, then:

.. code-block:: python
assert ns.name('0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD') == 'jasoncarver.eth'
assert ns.name('0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7') == 'ens.eth'
....

Expand All @@ -298,15 +298,15 @@ You'll need to setup the address first, and then the text can be set:

.. code-block:: python
ns.setup_address('jasoncarver.eth', '0x582AC4D8929f58c217d4a52aDD361AE470a8a4cD')
ns.set_text('jasoncarver.eth', 'url', 'https://example.com')
ns.setup_address('ens.eth', '0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7')
ns.set_text('ens.eth', 'url', 'https://example.com')
A transaction dictionary can be passed as the last argument if desired:

.. code-block:: python
transaction_dict = {'from': '0x123...'}
ns.set_text('jasoncarver.eth', 'url', 'https://example.com', transaction_dict)
ns.set_text('ens.eth', 'url', 'https://example.com', transaction_dict)
If the transaction dictionary is not passed, sensible defaults will be used, and if
a transaction dictionary is passed but does not have a ``from`` value,
Expand All @@ -319,7 +319,7 @@ Anyone can read the data from an ENS Record:

.. code-block:: python
url = ns.get_text('jasoncarver.eth', 'url')
url = ns.get_text('ens.eth', 'url')
assert url == 'https://example.com'
....
Expand All @@ -334,7 +334,7 @@ You can get the resolver for an ENS name via the :meth:`~ens.ENS.resolver` metho

.. code-block:: python
>>> resolver = ns.resolver('jasoncarver.eth')
>>> resolver = ns.resolver('ens.eth')
>>> resolver.address
'0x5B2063246F2191f18F2675ceDB8b28102e957458'
Expand Down
1 change: 1 addition & 0 deletions newsfragments/3020.docs.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Replace references to ``jasoncarver.eth`` with ``ens.eth``.

0 comments on commit 305b3c3

Please sign in to comment.