-
Notifications
You must be signed in to change notification settings - Fork 550
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bugfix - using ens domains for contract addresses
- Loading branch information
1 parent
f5ad639
commit 9e371c0
Showing
3 changed files
with
28 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/python3 | ||
|
||
import pytest | ||
from ens.exceptions import InvalidName | ||
|
||
from brownie.exceptions import UnsetENSName | ||
from brownie.network.contract import Contract | ||
|
||
|
||
def test_lookup(network): | ||
network.connect("mainnet") | ||
c = Contract("Test", "ens.snakecharmers.eth", []) | ||
assert c == "0x808B53bF4D70A24bA5cb720D37A4835621A9df00" | ||
assert c == "ens.snakecharmers.eth" | ||
|
||
|
||
def test_invalid(network): | ||
network.connect("mainnet") | ||
with pytest.raises(InvalidName): | ||
Contract("Test", "this-is-not-an-ENS-address,isit?.eth", []) | ||
|
||
|
||
def test_unset(network): | ||
network.connect("mainnet") | ||
with pytest.raises(UnsetENSName): | ||
Contract("Test", "pleasedonot.buythisoryouwill.breakmytests.eth", []) |