diff --git a/.DS_Store b/.DS_Store index 0391c02..9847829 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/web3s/.DS_Store b/web3s/.DS_Store new file mode 100644 index 0000000..3126573 Binary files /dev/null and b/web3s/.DS_Store differ diff --git a/web3s/__init__.py b/web3s/__init__.py index e58fa6e..8909af6 100644 --- a/web3s/__init__.py +++ b/web3s/__init__.py @@ -17,7 +17,7 @@ TestRPCProvider, ) -__version__ ='4.9.0' +__version__ ='4.9.1' __all__ = [ "__version__", diff --git a/web3s/contract.py b/web3s/contract.py index b51a84c..b257912 100644 --- a/web3s/contract.py +++ b/web3s/contract.py @@ -240,7 +240,7 @@ def __init__(self, address=None): ) if address: - self.address = normalize_address(self.web3s.ens, address) + self.address = normalize_address( address) if not self.address: raise TypeError("The address argument is required to instantiate a contract.") @@ -256,7 +256,7 @@ def factory(cls, web3s, class_name=None, **kwargs): normalizers = { 'abi': normalize_abi, - 'address': partial(normalize_address, kwargs['web3s'].ens), + 'address': normalize_address, 'bytecode': normalize_bytecode, 'bytecode_runtime': normalize_bytecode, } diff --git a/web3s/ens/__init__.py b/web3s/ens/__init__.py deleted file mode 100644 index c3a463a..0000000 --- a/web3s/ens/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# flake8: noqa - -from .main import ( - ENS, -) - -from .exceptions import ( - AddressMismatch, - BidTooLow, - InvalidLabel, - InvalidName, - UnauthorizedError, - UnderfundedBid, - UnownedName, -) diff --git a/web3s/ens/__pycache__/__init__.cpython-37.pyc b/web3s/ens/__pycache__/__init__.cpython-37.pyc deleted file mode 100644 index 55c18ec..0000000 Binary files a/web3s/ens/__pycache__/__init__.cpython-37.pyc and /dev/null differ diff --git a/web3s/ens/__pycache__/abis.cpython-37.pyc b/web3s/ens/__pycache__/abis.cpython-37.pyc deleted file mode 100644 index d67ffcd..0000000 Binary files a/web3s/ens/__pycache__/abis.cpython-37.pyc and /dev/null differ diff --git a/web3s/ens/__pycache__/auto.cpython-37.pyc b/web3s/ens/__pycache__/auto.cpython-37.pyc deleted file mode 100644 index 0885fa2..0000000 Binary files a/web3s/ens/__pycache__/auto.cpython-37.pyc and /dev/null differ diff --git a/web3s/ens/__pycache__/constants.cpython-37.pyc b/web3s/ens/__pycache__/constants.cpython-37.pyc deleted file mode 100644 index 74ba9b8..0000000 Binary files a/web3s/ens/__pycache__/constants.cpython-37.pyc and /dev/null differ diff --git a/web3s/ens/__pycache__/contract_data.cpython-37.pyc b/web3s/ens/__pycache__/contract_data.cpython-37.pyc deleted file mode 100644 index def2b36..0000000 Binary files a/web3s/ens/__pycache__/contract_data.cpython-37.pyc and /dev/null differ diff --git a/web3s/ens/__pycache__/exceptions.cpython-37.pyc b/web3s/ens/__pycache__/exceptions.cpython-37.pyc deleted file mode 100644 index 6eee930..0000000 Binary files a/web3s/ens/__pycache__/exceptions.cpython-37.pyc and /dev/null differ diff --git a/web3s/ens/__pycache__/main.cpython-37.pyc b/web3s/ens/__pycache__/main.cpython-37.pyc deleted file mode 100644 index 6324989..0000000 Binary files a/web3s/ens/__pycache__/main.cpython-37.pyc and /dev/null differ diff --git a/web3s/ens/__pycache__/registrar.cpython-37.pyc b/web3s/ens/__pycache__/registrar.cpython-37.pyc deleted file mode 100644 index 399ae5f..0000000 Binary files a/web3s/ens/__pycache__/registrar.cpython-37.pyc and /dev/null differ diff --git a/web3s/ens/__pycache__/utils.cpython-37.pyc b/web3s/ens/__pycache__/utils.cpython-37.pyc deleted file mode 100644 index 1a279eb..0000000 Binary files a/web3s/ens/__pycache__/utils.cpython-37.pyc and /dev/null differ diff --git a/web3s/ens/abis.py b/web3s/ens/abis.py deleted file mode 100644 index d29b4d8..0000000 --- a/web3s/ens/abis.py +++ /dev/null @@ -1,1394 +0,0 @@ -# flake8: noqa - -ENS = [ - { - "constant": True, - "inputs": [ - { - "name": "node", - "type": "bytes32" - } - ], - "name": "resolver", - "outputs": [ - { - "name": "", - "type": "address" - } - ], - "payable": False, - "type": "function" - }, - { - "constant": True, - "inputs": [ - { - "name": "node", - "type": "bytes32" - } - ], - "name": "owner", - "outputs": [ - { - "name": "", - "type": "address" - } - ], - "payable": False, - "type": "function" - }, - { - "constant": False, - "inputs": [ - { - "name": "node", - "type": "bytes32" - }, - { - "name": "label", - "type": "bytes32" - }, - { - "name": "owner", - "type": "address" - } - ], - "name": "setSubnodeOwner", - "outputs": [], - "payable": False, - "type": "function" - }, - { - "constant": False, - "inputs": [ - { - "name": "node", - "type": "bytes32" - }, - { - "name": "ttl", - "type": "uint64" - } - ], - "name": "setTTL", - "outputs": [], - "payable": False, - "type": "function" - }, - { - "constant": True, - "inputs": [ - { - "name": "node", - "type": "bytes32" - } - ], - "name": "ttl", - "outputs": [ - { - "name": "", - "type": "uint64" - } - ], - "payable": False, - "type": "function" - }, - { - "constant": False, - "inputs": [ - { - "name": "node", - "type": "bytes32" - }, - { - "name": "resolver", - "type": "address" - } - ], - "name": "setResolver", - "outputs": [], - "payable": False, - "type": "function" - }, - { - "constant": False, - "inputs": [ - { - "name": "node", - "type": "bytes32" - }, - { - "name": "owner", - "type": "address" - } - ], - "name": "setOwner", - "outputs": [], - "payable": False, - "type": "function" - }, - { - "anonymous": False, - "inputs": [ - { - "indexed": True, - "name": "node", - "type": "bytes32" - }, - { - "indexed": False, - "name": "owner", - "type": "address" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "anonymous": False, - "inputs": [ - { - "indexed": True, - "name": "node", - "type": "bytes32" - }, - { - "indexed": True, - "name": "label", - "type": "bytes32" - }, - { - "indexed": False, - "name": "owner", - "type": "address" - } - ], - "name": "NewOwner", - "type": "event" - }, - { - "anonymous": False, - "inputs": [ - { - "indexed": True, - "name": "node", - "type": "bytes32" - }, - { - "indexed": False, - "name": "resolver", - "type": "address" - } - ], - "name": "NewResolver", - "type": "event" - }, - { - "anonymous": False, - "inputs": [ - { - "indexed": True, - "name": "node", - "type": "bytes32" - }, - { - "indexed": False, - "name": "ttl", - "type": "uint64" - } - ], - "name": "NewTTL", - "type": "event" - } -] - -AUCTION_REGISTRAR = [ - { - "constant": False, - "inputs": [ - { - "name": "_hash", - "type": "bytes32" - } - ], - "name": "releaseDeed", - "outputs": [], - "payable": False, - "type": "function" - }, - { - "constant": True, - "inputs": [ - { - "name": "_hash", - "type": "bytes32" - } - ], - "name": "getAllowedTime", - "outputs": [ - { - "name": "timestamp", - "type": "uint256" - } - ], - "payable": False, - "type": "function" - }, - { - "constant": False, - "inputs": [ - { - "name": "unhashedName", - "type": "string" - } - ], - "name": "invalidateName", - "outputs": [], - "payable": False, - "type": "function" - }, - { - "constant": True, - "inputs": [ - { - "name": "hash", - "type": "bytes32" - }, - { - "name": "owner", - "type": "address" - }, - { - "name": "value", - "type": "uint256" - }, - { - "name": "salt", - "type": "bytes32" - } - ], - "name": "shaBid", - "outputs": [ - { - "name": "sealedBid", - "type": "bytes32" - } - ], - "payable": False, - "type": "function" - }, - { - "constant": False, - "inputs": [ - { - "name": "bidder", - "type": "address" - }, - { - "name": "seal", - "type": "bytes32" - } - ], - "name": "cancelBid", - "outputs": [], - "payable": False, - "type": "function" - }, - { - "constant": True, - "inputs": [ - { - "name": "_hash", - "type": "bytes32" - } - ], - "name": "entries", - "outputs": [ - { - "name": "", - "type": "uint8" - }, - { - "name": "", - "type": "address" - }, - { - "name": "", - "type": "uint256" - }, - { - "name": "", - "type": "uint256" - }, - { - "name": "", - "type": "uint256" - } - ], - "payable": False, - "type": "function" - }, - { - "constant": True, - "inputs": [], - "name": "ens", - "outputs": [ - { - "name": "", - "type": "address" - } - ], - "payable": False, - "type": "function" - }, - { - "constant": False, - "inputs": [ - { - "name": "_hash", - "type": "bytes32" - }, - { - "name": "_value", - "type": "uint256" - }, - { - "name": "_salt", - "type": "bytes32" - } - ], - "name": "unsealBid", - "outputs": [], - "payable": False, - "type": "function" - }, - { - "constant": False, - "inputs": [ - { - "name": "_hash", - "type": "bytes32" - } - ], - "name": "transferRegistrars", - "outputs": [], - "payable": False, - "type": "function" - }, - { - "constant": True, - "inputs": [ - { - "name": "", - "type": "address" - }, - { - "name": "", - "type": "bytes32" - } - ], - "name": "sealedBids", - "outputs": [ - { - "name": "", - "type": "address" - } - ], - "payable": False, - "type": "function" - }, - { - "constant": True, - "inputs": [ - { - "name": "_hash", - "type": "bytes32" - } - ], - "name": "state", - "outputs": [ - { - "name": "", - "type": "uint8" - } - ], - "payable": False, - "type": "function" - }, - { - "constant": False, - "inputs": [ - { - "name": "_hash", - "type": "bytes32" - }, - { - "name": "newOwner", - "type": "address" - } - ], - "name": "transfer", - "outputs": [], - "payable": False, - "type": "function" - }, - { - "constant": True, - "inputs": [ - { - "name": "_hash", - "type": "bytes32" - }, - { - "name": "_timestamp", - "type": "uint256" - } - ], - "name": "isAllowed", - "outputs": [ - { - "name": "allowed", - "type": "bool" - } - ], - "payable": False, - "type": "function" - }, - { - "constant": False, - "inputs": [ - { - "name": "_hash", - "type": "bytes32" - } - ], - "name": "finalizeAuction", - "outputs": [], - "payable": False, - "type": "function" - }, - { - "constant": True, - "inputs": [], - "name": "registryStarted", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": False, - "type": "function" - }, - { - "constant": True, - "inputs": [], - "name": "launchLength", - "outputs": [ - { - "name": "", - "type": "uint32" - } - ], - "payable": False, - "type": "function" - }, - { - "constant": False, - "inputs": [ - { - "name": "sealedBid", - "type": "bytes32" - } - ], - "name": "newBid", - "outputs": [], - "payable": True, - "type": "function" - }, - { - "constant": False, - "inputs": [ - { - "name": "labels", - "type": "bytes32[]" - } - ], - "name": "eraseNode", - "outputs": [], - "payable": False, - "type": "function" - }, - { - "constant": False, - "inputs": [ - { - "name": "_hashes", - "type": "bytes32[]" - } - ], - "name": "startAuctions", - "outputs": [], - "payable": False, - "type": "function" - }, - { - "constant": False, - "inputs": [ - { - "name": "hash", - "type": "bytes32" - }, - { - "name": "deed", - "type": "address" - }, - { - "name": "registrationDate", - "type": "uint256" - } - ], - "name": "acceptRegistrarTransfer", - "outputs": [], - "payable": False, - "type": "function" - }, - { - "constant": False, - "inputs": [ - { - "name": "_hash", - "type": "bytes32" - } - ], - "name": "startAuction", - "outputs": [], - "payable": False, - "type": "function" - }, - { - "constant": True, - "inputs": [], - "name": "rootNode", - "outputs": [ - { - "name": "", - "type": "bytes32" - } - ], - "payable": False, - "type": "function" - }, - { - "constant": False, - "inputs": [ - { - "name": "hashes", - "type": "bytes32[]" - }, - { - "name": "sealedBid", - "type": "bytes32" - } - ], - "name": "startAuctionsAndBid", - "outputs": [], - "payable": True, - "type": "function" - }, - { - "inputs": [ - { - "name": "_ens", - "type": "address" - }, - { - "name": "_rootNode", - "type": "bytes32" - }, - { - "name": "_startDate", - "type": "uint256" - } - ], - "payable": False, - "type": "constructor" - }, - { - "anonymous": False, - "inputs": [ - { - "indexed": True, - "name": "hash", - "type": "bytes32" - }, - { - "indexed": False, - "name": "registrationDate", - "type": "uint256" - } - ], - "name": "AuctionStarted", - "type": "event" - }, - { - "anonymous": False, - "inputs": [ - { - "indexed": True, - "name": "hash", - "type": "bytes32" - }, - { - "indexed": True, - "name": "bidder", - "type": "address" - }, - { - "indexed": False, - "name": "deposit", - "type": "uint256" - } - ], - "name": "NewBid", - "type": "event" - }, - { - "anonymous": False, - "inputs": [ - { - "indexed": True, - "name": "hash", - "type": "bytes32" - }, - { - "indexed": True, - "name": "owner", - "type": "address" - }, - { - "indexed": False, - "name": "value", - "type": "uint256" - }, - { - "indexed": False, - "name": "status", - "type": "uint8" - } - ], - "name": "BidRevealed", - "type": "event" - }, - { - "anonymous": False, - "inputs": [ - { - "indexed": True, - "name": "hash", - "type": "bytes32" - }, - { - "indexed": True, - "name": "owner", - "type": "address" - }, - { - "indexed": False, - "name": "value", - "type": "uint256" - }, - { - "indexed": False, - "name": "registrationDate", - "type": "uint256" - } - ], - "name": "HashRegistered", - "type": "event" - }, - { - "anonymous": False, - "inputs": [ - { - "indexed": True, - "name": "hash", - "type": "bytes32" - }, - { - "indexed": False, - "name": "value", - "type": "uint256" - } - ], - "name": "HashReleased", - "type": "event" - }, - { - "anonymous": False, - "inputs": [ - { - "indexed": True, - "name": "hash", - "type": "bytes32" - }, - { - "indexed": True, - "name": "name", - "type": "string" - }, - { - "indexed": False, - "name": "value", - "type": "uint256" - }, - { - "indexed": False, - "name": "registrationDate", - "type": "uint256" - } - ], - "name": "HashInvalidated", - "type": "event" - } -] - -DEED = [ - { - "constant": True, - "inputs": [], - "name": "creationDate", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": False, - "type": "function" - }, - { - "constant": False, - "inputs": [], - "name": "destroyDeed", - "outputs": [], - "payable": False, - "type": "function" - }, - { - "constant": False, - "inputs": [ - { - "name": "newOwner", - "type": "address" - } - ], - "name": "setOwner", - "outputs": [], - "payable": False, - "type": "function" - }, - { - "constant": True, - "inputs": [], - "name": "registrar", - "outputs": [ - { - "name": "", - "type": "address" - } - ], - "payable": False, - "type": "function" - }, - { - "constant": True, - "inputs": [], - "name": "owner", - "outputs": [ - { - "name": "", - "type": "address" - } - ], - "payable": False, - "type": "function" - }, - { - "constant": False, - "inputs": [ - { - "name": "refundRatio", - "type": "uint256" - } - ], - "name": "closeDeed", - "outputs": [], - "payable": False, - "type": "function" - }, - { - "constant": False, - "inputs": [ - { - "name": "newRegistrar", - "type": "address" - } - ], - "name": "setRegistrar", - "outputs": [], - "payable": False, - "type": "function" - }, - { - "constant": False, - "inputs": [ - { - "name": "newValue", - "type": "uint256" - } - ], - "name": "setBalance", - "outputs": [], - "payable": True, - "type": "function" - }, - { - "inputs": [], - "type": "constructor" - }, - { - "payable": True, - "type": "fallback" - }, - { - "anonymous": False, - "inputs": [ - { - "indexed": False, - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerChanged", - "type": "event" - }, - { - "anonymous": False, - "inputs": [], - "name": "DeedClosed", - "type": "event" - } -] - -FIFS_REGISTRAR = [ - { - "constant": True, - "inputs": [], - "name": "ens", - "outputs": [ - { - "name": "", - "type": "address" - } - ], - "payable": False, - "type": "function" - }, - { - "constant": True, - "inputs": [ - { - "name": "", - "type": "bytes32" - } - ], - "name": "expiryTimes", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": False, - "type": "function" - }, - { - "constant": False, - "inputs": [ - { - "name": "subnode", - "type": "bytes32" - }, - { - "name": "owner", - "type": "address" - } - ], - "name": "register", - "outputs": [], - "payable": False, - "type": "function" - }, - { - "constant": True, - "inputs": [], - "name": "rootNode", - "outputs": [ - { - "name": "", - "type": "bytes32" - } - ], - "payable": False, - "type": "function" - }, - { - "inputs": [ - { - "name": "ensAddr", - "type": "address" - }, - { - "name": "node", - "type": "bytes32" - } - ], - "type": "constructor" - } -] - -RESOLVER = [ - { - "constant": True, - "inputs": [ - { - "name": "interfaceID", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": False, - "type": "function" - }, - { - "constant": True, - "inputs": [ - { - "name": "node", - "type": "bytes32" - }, - { - "name": "contentTypes", - "type": "uint256" - } - ], - "name": "ABI", - "outputs": [ - { - "name": "contentType", - "type": "uint256" - }, - { - "name": "data", - "type": "bytes" - } - ], - "payable": False, - "type": "function" - }, - { - "constant": False, - "inputs": [ - { - "name": "node", - "type": "bytes32" - }, - { - "name": "x", - "type": "bytes32" - }, - { - "name": "y", - "type": "bytes32" - } - ], - "name": "setPubkey", - "outputs": [], - "payable": False, - "type": "function" - }, - { - "constant": True, - "inputs": [ - { - "name": "node", - "type": "bytes32" - } - ], - "name": "content", - "outputs": [ - { - "name": "ret", - "type": "bytes32" - } - ], - "payable": False, - "type": "function" - }, - { - "constant": True, - "inputs": [ - { - "name": "node", - "type": "bytes32" - } - ], - "name": "addr", - "outputs": [ - { - "name": "ret", - "type": "address" - } - ], - "payable": False, - "type": "function" - }, - { - "constant": False, - "inputs": [ - { - "name": "node", - "type": "bytes32" - }, - { - "name": "contentType", - "type": "uint256" - }, - { - "name": "data", - "type": "bytes" - } - ], - "name": "setABI", - "outputs": [], - "payable": False, - "type": "function" - }, - { - "constant": True, - "inputs": [ - { - "name": "node", - "type": "bytes32" - } - ], - "name": "name", - "outputs": [ - { - "name": "ret", - "type": "string" - } - ], - "payable": False, - "type": "function" - }, - { - "constant": False, - "inputs": [ - { - "name": "node", - "type": "bytes32" - }, - { - "name": "name", - "type": "string" - } - ], - "name": "setName", - "outputs": [], - "payable": False, - "type": "function" - }, - { - "constant": False, - "inputs": [ - { - "name": "node", - "type": "bytes32" - }, - { - "name": "hash", - "type": "bytes32" - } - ], - "name": "setContent", - "outputs": [], - "payable": False, - "type": "function" - }, - { - "constant": True, - "inputs": [ - { - "name": "node", - "type": "bytes32" - } - ], - "name": "pubkey", - "outputs": [ - { - "name": "x", - "type": "bytes32" - }, - { - "name": "y", - "type": "bytes32" - } - ], - "payable": False, - "type": "function" - }, - { - "constant": False, - "inputs": [ - { - "name": "node", - "type": "bytes32" - }, - { - "name": "addr", - "type": "address" - } - ], - "name": "setAddr", - "outputs": [], - "payable": False, - "type": "function" - }, - { - "inputs": [ - { - "name": "ensAddr", - "type": "address" - } - ], - "payable": False, - "type": "constructor" - }, - { - "anonymous": False, - "inputs": [ - { - "indexed": True, - "name": "node", - "type": "bytes32" - }, - { - "indexed": False, - "name": "a", - "type": "address" - } - ], - "name": "AddrChanged", - "type": "event" - }, - { - "anonymous": False, - "inputs": [ - { - "indexed": True, - "name": "node", - "type": "bytes32" - }, - { - "indexed": False, - "name": "hash", - "type": "bytes32" - } - ], - "name": "ContentChanged", - "type": "event" - }, - { - "anonymous": False, - "inputs": [ - { - "indexed": True, - "name": "node", - "type": "bytes32" - }, - { - "indexed": False, - "name": "name", - "type": "string" - } - ], - "name": "NameChanged", - "type": "event" - }, - { - "anonymous": False, - "inputs": [ - { - "indexed": True, - "name": "node", - "type": "bytes32" - }, - { - "indexed": True, - "name": "contentType", - "type": "uint256" - } - ], - "name": "ABIChanged", - "type": "event" - }, - { - "anonymous": False, - "inputs": [ - { - "indexed": True, - "name": "node", - "type": "bytes32" - }, - { - "indexed": False, - "name": "x", - "type": "bytes32" - }, - { - "indexed": False, - "name": "y", - "type": "bytes32" - } - ], - "name": "PubkeyChanged", - "type": "event" - } -] - -REVERSE_REGISTRAR = [ - { - "constant": False, - "inputs": [ - { - "name": "owner", - "type": "address" - }, - { - "name": "resolver", - "type": "address" - } - ], - "name": "claimWithResolver", - "outputs": [ - { - "name": "node", - "type": "bytes32" - } - ], - "payable": False, - "type": "function" - }, - { - "constant": False, - "inputs": [ - { - "name": "owner", - "type": "address" - } - ], - "name": "claim", - "outputs": [ - { - "name": "node", - "type": "bytes32" - } - ], - "payable": False, - "type": "function" - }, - { - "constant": True, - "inputs": [], - "name": "ens", - "outputs": [ - { - "name": "", - "type": "address" - } - ], - "payable": False, - "type": "function" - }, - { - "constant": True, - "inputs": [], - "name": "defaultResolver", - "outputs": [ - { - "name": "", - "type": "address" - } - ], - "payable": False, - "type": "function" - }, - { - "constant": True, - "inputs": [ - { - "name": "addr", - "type": "address" - } - ], - "name": "node", - "outputs": [ - { - "name": "ret", - "type": "bytes32" - } - ], - "payable": False, - "type": "function" - }, - { - "constant": False, - "inputs": [ - { - "name": "name", - "type": "string" - } - ], - "name": "setName", - "outputs": [ - { - "name": "node", - "type": "bytes32" - } - ], - "payable": False, - "type": "function" - }, - { - "inputs": [ - { - "name": "ensAddr", - "type": "address" - }, - { - "name": "resolverAddr", - "type": "address" - } - ], - "payable": False, - "type": "constructor" - } -] diff --git a/web3s/ens/auto.py b/web3s/ens/auto.py deleted file mode 100644 index 7132eb0..0000000 --- a/web3s/ens/auto.py +++ /dev/null @@ -1,3 +0,0 @@ -from web3s.ens import ENS - -ns = ENS() diff --git a/web3s/ens/constants.py b/web3s/ens/constants.py deleted file mode 100644 index f1c8ce2..0000000 --- a/web3s/ens/constants.py +++ /dev/null @@ -1,14 +0,0 @@ - -ACCEPTABLE_STALE_HOURS = 48 - -AUCTION_START_GAS_CONSTANT = 25000 -AUCTION_START_GAS_MARGINAL = 39000 - -EMPTY_SHA3_BYTES = b'\0' * 32 -EMPTY_ADDR_HEX = '0x' + '00' * 20 - -MIN_ETH_LABEL_LENGTH = 7 - -RECOGNIZED_TLDS = ['eth', 'reverse', 'test'] - -REVERSE_REGISTRAR_DOMAIN = 'addr.reverse' diff --git a/web3s/ens/contract_data.py b/web3s/ens/contract_data.py deleted file mode 100644 index 76e5a40..0000000 --- a/web3s/ens/contract_data.py +++ /dev/null @@ -1,19 +0,0 @@ -# flake8: noqa -import json - -registrar_abi = json.loads('[{"constant":false,"inputs":[{"name":"_hash","type":"bytes32"}],"name":"releaseDeed","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_hash","type":"bytes32"}],"name":"getAllowedTime","outputs":[{"name":"timestamp","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"unhashedName","type":"string"}],"name":"invalidateName","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"hash","type":"bytes32"},{"name":"owner","type":"address"},{"name":"value","type":"uint256"},{"name":"salt","type":"bytes32"}],"name":"shaBid","outputs":[{"name":"sealedBid","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"bidder","type":"address"},{"name":"seal","type":"bytes32"}],"name":"cancelBid","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_hash","type":"bytes32"}],"name":"entries","outputs":[{"name":"","type":"uint8"},{"name":"","type":"address"},{"name":"","type":"uint256"},{"name":"","type":"uint256"},{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"ens","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_hash","type":"bytes32"},{"name":"_value","type":"uint256"},{"name":"_salt","type":"bytes32"}],"name":"unsealBid","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_hash","type":"bytes32"}],"name":"transferRegistrars","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"},{"name":"","type":"bytes32"}],"name":"sealedBids","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_hash","type":"bytes32"}],"name":"state","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_hash","type":"bytes32"},{"name":"newOwner","type":"address"}],"name":"transfer","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_hash","type":"bytes32"},{"name":"_timestamp","type":"uint256"}],"name":"isAllowed","outputs":[{"name":"allowed","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_hash","type":"bytes32"}],"name":"finalizeAuction","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"registryStarted","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"launchLength","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"sealedBid","type":"bytes32"}],"name":"newBid","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"labels","type":"bytes32[]"}],"name":"eraseNode","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_hashes","type":"bytes32[]"}],"name":"startAuctions","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"hash","type":"bytes32"},{"name":"deed","type":"address"},{"name":"registrationDate","type":"uint256"}],"name":"acceptRegistrarTransfer","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_hash","type":"bytes32"}],"name":"startAuction","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"rootNode","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"hashes","type":"bytes32[]"},{"name":"sealedBid","type":"bytes32"}],"name":"startAuctionsAndBid","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"inputs":[{"name":"_ens","type":"address"},{"name":"_rootNode","type":"bytes32"},{"name":"_startDate","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"hash","type":"bytes32"},{"indexed":false,"name":"registrationDate","type":"uint256"}],"name":"AuctionStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"hash","type":"bytes32"},{"indexed":true,"name":"bidder","type":"address"},{"indexed":false,"name":"deposit","type":"uint256"}],"name":"NewBid","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"hash","type":"bytes32"},{"indexed":true,"name":"owner","type":"address"},{"indexed":false,"name":"value","type":"uint256"},{"indexed":false,"name":"status","type":"uint8"}],"name":"BidRevealed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"hash","type":"bytes32"},{"indexed":true,"name":"owner","type":"address"},{"indexed":false,"name":"value","type":"uint256"},{"indexed":false,"name":"registrationDate","type":"uint256"}],"name":"HashRegistered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"hash","type":"bytes32"},{"indexed":false,"name":"value","type":"uint256"}],"name":"HashReleased","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"hash","type":"bytes32"},{"indexed":true,"name":"name","type":"string"},{"indexed":false,"name":"value","type":"uint256"},{"indexed":false,"name":"registrationDate","type":"uint256"}],"name":"HashInvalidated","type":"event"}]') -registrar_bytecode = "6060604052341561000f57600080fd5b60405160608061275783398101604052808051919060200180519190602001805160008054600160a060020a031916600160a060020a0387161781556001859055909250821190506100615742610063565b805b6004555050506126df806100786000396000f300606060405236156101175763ffffffff60e060020a6000350416630230a07c811461011c57806313c89a8f1461013457806315f733311461015c57806322ec1244146101ad5780632525f5c1146101d5578063267b6922146101f75780633f15457f1461025f57806347872b421461028e5780635ddae283146102aa5780635e431709146102c057806361d585da146102e257806379ce9fac1461031c578063935033371461033e578063983b94fb1461036b5780639c67f06f14610381578063ae1a0b0c14610394578063ce92dced146103c0578063de10f04b146103cb578063e27fe50f1461041a578063ea9e107a14610469578063ede8acdb1461048e578063faff50a8146104a4578063febefd61146104b7575b600080fd5b341561012757600080fd5b6101326004356104fd565b005b341561013f57600080fd5b61014a60043561072a565b60405190815260200160405180910390f35b341561016757600080fd5b61013260046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061074e95505050505050565b34156101b857600080fd5b61014a600435600160a060020a0360243516604435606435610a7a565b34156101e057600080fd5b610132600160a060020a0360043516602435610ac5565b341561020257600080fd5b61020d600435610c8c565b6040518086600581111561021d57fe5b60ff16815260200185600160a060020a0316600160a060020a031681526020018481526020018381526020018281526020019550505050505060405180910390f35b341561026a57600080fd5b610272610cd8565b604051600160a060020a03909116815260200160405180910390f35b341561029957600080fd5b610132600435602435604435610ce7565b34156102b557600080fd5b610132600435611254565b34156102cb57600080fd5b610272600160a060020a03600435166024356114b4565b34156102ed57600080fd5b6102f86004356114da565b6040518082600581111561030857fe5b60ff16815260200191505060405180910390f35b341561032757600080fd5b610132600435600160a060020a0360243516611550565b341561034957600080fd5b61035760043560243561169b565b604051901515815260200160405180910390f35b341561037657600080fd5b6101326004356116b1565b341561038c57600080fd5b61014a611919565b341561039f57600080fd5b6103a761191f565b60405163ffffffff909116815260200160405180910390f35b610132600435611926565b34156103d657600080fd5b6101326004602481358181019083013580602081810201604051908101604052809392919081815260200183836020028082843750949650611a1a95505050505050565b341561042557600080fd5b6101326004602481358181019083013580602081810201604051908101604052809392919081815260200183836020028082843750949650611a7595505050505050565b341561047457600080fd5b610132600435600160a060020a0360243516604435611aab565b341561049957600080fd5b610132600435611ab0565b34156104af57600080fd5b61014a611bfc565b61013260046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496505093359350611c0292505050565b60008082600261050c826114da565b600581111561051757fe5b1415806105a3575060008181526002602052604080822054600160a060020a031691638da5cb5b9151602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561057257600080fd5b6102c65a03f1151561058357600080fd5b50505060405180519050600160a060020a031633600160a060020a031614155b156105ad57600080fd5b600084815260026020526040902080546001820154919450600160a060020a031692506301e13380014210801561065f575060008054600154600160a060020a03308116939216916302571be391906040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561063957600080fd5b6102c65a03f1151561064a57600080fd5b50505060405180519050600160a060020a0316145b1561066957600080fd5b60006002840181905560038401558254600160a060020a031916835561068e84611c14565b81600160a060020a031663bbe427716103e860405160e060020a63ffffffff84160281526004810191909152602401600060405180830381600087803b15156106d657600080fd5b6102c65a03f115156106e757600080fd5b505050600283015484907f292b79b9246fa2c8e77d3fe195b251f9cb839d7d038e667c069ee7708c631e169060405190815260200160405180910390a250505050565b6004547001000000000000000000000000000000006249d400818404020401919050565b600080826040518082805190602001908083835b602083106107815780518252601f199092019160209182019101610762565b6001836020036101000a03801982511681845116179092525050509190910192506040915050519081900390206002806107ba836114da565b60058111156107c557fe5b146107cf57600080fd5b60066107da86611e12565b11156107e557600080fd5b846040518082805190602001908083835b602083106108155780518252601f1990920191602091820191016107f6565b6001836020036101000a03801982511681845116179092525050509190910192506040915050519081900390206000818152600260205260409020909450925061085e84611c14565b8254600160a060020a0316156109b5576108838360020154662386f26fc10000611ec3565b60028085018290558454600160a060020a03169163b0c80972919004600060405160e060020a63ffffffff8516028152600481019290925215156024820152604401600060405180830381600087803b15156108de57600080fd5b6102c65a03f115156108ef57600080fd5b50508354600160a060020a031690506313af40353360405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b151561094257600080fd5b6102c65a03f1151561095357600080fd5b50508354600160a060020a0316905063bbe427716103e860405160e060020a63ffffffff84160281526004810191909152602401600060405180830381600087803b15156109a057600080fd5b6102c65a03f115156109b157600080fd5b5050505b846040518082805190602001908083835b602083106109e55780518252601f1990920191602091820191016109c6565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902084600019167f1f9c649fe47e58bb60f4e52f0d90e4c47a526c9f90c5113df842c025970b66ad8560020154866001015460405191825260208201526040908101905180910390a3505060006002820181905560038201558054600160a060020a03191690555050565b600084848484604051938452600160a060020a03929092166c010000000000000000000000000260208401526034830152605482015260740160405180910390209050949350505050565b600160a060020a03808316600090815260036020908152604080832085845290915290205416801580610b61575062069780600160a060020a0382166305b344106000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610b3d57600080fd5b6102c65a03f11515610b4e57600080fd5b5050506040518051905001621275000142105b15610b6b57600080fd5b80600160a060020a03166313af40353360405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b1515610bb957600080fd5b6102c65a03f11515610bca57600080fd5b50505080600160a060020a031663bbe42771600560405160e060020a63ffffffff84160281526004810191909152602401600060405180830381600087803b1515610c1457600080fd5b6102c65a03f11515610c2557600080fd5b505050600160a060020a03831660008181526003602090815260408083208684529091528082208054600160a060020a03191690558491600080516020612694833981519152916005905191825260ff1660208201526040908101905180910390a3505050565b60008181526002602052604081208190819081908190610cab876114da565b815460018301546002840154600390940154929a600160a060020a03909216995097509195509350915050565b600054600160a060020a031681565b600080600080600080610cfc89338a8a610a7a565b600160a060020a033381166000908152600360209081526040808320858452909152902054919750169450841515610d3357600080fd5b600160a060020a0333811660009081526003602090815260408083208a845282528083208054600160a060020a03191690558c835260029091528082209650610dd6928b9290891691633fa4f245919051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610db657600080fd5b6102c65a03f11515610dc757600080fd5b50505060405180519050611edb565b925084600160a060020a031663b0c8097284600160405160e060020a63ffffffff8516028152600481019290925215156024820152604401600060405180830381600087803b1515610e2757600080fd5b6102c65a03f11515610e3857600080fd5b505050610e44896114da565b91506002826005811115610e5457fe5b1415610ef25784600160a060020a031663bbe42771600560405160e060020a63ffffffff84160281526004810191909152602401600060405180830381600087803b1515610ea157600080fd5b6102c65a03f11515610eb257600080fd5b5050600160a060020a03331690508960008051602061269483398151915285600160405191825260ff1660208201526040908101905180910390a3611249565b6004826005811115610f0057fe5b14610f0a57600080fd5b662386f26fc10000831080610f88575060018401546202a2ff1901600160a060020a0386166305b344106000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610f6b57600080fd5b6102c65a03f11515610f7c57600080fd5b50505060405180519050115b156110265784600160a060020a031663bbe427716103e360405160e060020a63ffffffff84160281526004810191909152602401600060405180830381600087803b1515610fd557600080fd5b6102c65a03f11515610fe657600080fd5b5050600160a060020a03331690508960008051602061269483398151915285600060405191825260ff1660208201526040908101905180910390a3611249565b8360030154831115611108578354600160a060020a0316156110a257508254600160a060020a03168063bbe427716103e360405160e060020a63ffffffff84160281526004810191909152602401600060405180830381600087803b151561108d57600080fd5b6102c65a03f1151561109e57600080fd5b5050505b600384018054600280870191909155908490558454600160a060020a031916600160a060020a038781169190911786553316908a9060008051602061269483398151915290869060405191825260ff1660208201526040908101905180910390a3611249565b83600201548311156111b45760028401839055600160a060020a03851663bbe427716103e360405160e060020a63ffffffff84160281526004810191909152602401600060405180830381600087803b151561116357600080fd5b6102c65a03f1151561117457600080fd5b5050600160a060020a03331690508960008051602061269483398151915285600360405191825260ff1660208201526040908101905180910390a3611249565b84600160a060020a031663bbe427716103e360405160e060020a63ffffffff84160281526004810191909152602401600060405180830381600087803b15156111fc57600080fd5b6102c65a03f1151561120d57600080fd5b5050600160a060020a03331690508960008051602061269483398151915285600460405191825260ff1660208201526040908101905180910390a35b505050505050505050565b600080826002611263826114da565b600581111561126e57fe5b1415806112fa575060008181526002602052604080822054600160a060020a031691638da5cb5b9151602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156112c957600080fd5b6102c65a03f115156112da57600080fd5b50505060405180519050600160a060020a031633600160a060020a031614155b1561130457600080fd5b60008054600154600160a060020a03909116916302571be391906040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561135b57600080fd5b6102c65a03f1151561136c57600080fd5b50505060405180519050925030600160a060020a031683600160a060020a0316141561139757600080fd5b600084815260026020526040908190208054909350600160a060020a03169063faab9d399085905160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b15156113fa57600080fd5b6102c65a03f1151561140b57600080fd5b505082546001840154600160a060020a03808716935063ea9e107a92889291169060405160e060020a63ffffffff86160281526004810193909352600160a060020a0390911660248301526044820152606401600060405180830381600087803b151561147757600080fd5b6102c65a03f1151561148857600080fd5b50508254600160a060020a03191683555050600060018201819055600282018190556003909101555050565b6003602090815260009283526040808420909152908252902054600160a060020a031681565b60008181526002602052604081206114f2834261169b565b1515611501576005915061154a565b80600101544210156115315760018101546202a2ff1901421015611528576001915061154a565b6004915061154a565b60038101541515611545576000915061154a565b600291505b50919050565b600082600261155e826114da565b600581111561156957fe5b1415806115f5575060008181526002602052604080822054600160a060020a031691638da5cb5b9151602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156115c457600080fd5b6102c65a03f115156115d557600080fd5b50505060405180519050600160a060020a031633600160a060020a031614155b156115ff57600080fd5b600160a060020a038316151561161457600080fd5b600084815260026020526040908190208054909350600160a060020a0316906313af40359085905160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b151561167757600080fd5b6102c65a03f1151561168857600080fd5b5050506116958484611eec565b50505050565b60006116a68361072a565b821190505b92915050565b60008160026116bf826114da565b60058111156116ca57fe5b141580611756575060008181526002602052604080822054600160a060020a031691638da5cb5b9151602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561172557600080fd5b6102c65a03f1151561173657600080fd5b50505060405180519050600160a060020a031633600160a060020a031614155b1561176057600080fd5b60008381526002602081905260409091209081015490925061178990662386f26fc10000611ec3565b600283018190558254600160a060020a03169063b0c8097290600160405160e060020a63ffffffff8516028152600481019290925215156024820152604401600060405180830381600087803b15156117e157600080fd5b6102c65a03f115156117f257600080fd5b5050825461186291508490600160a060020a0316638da5cb5b6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561184257600080fd5b6102c65a03f1151561185357600080fd5b50505060405180519050611eec565b8154600160a060020a0316638da5cb5b6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156118a957600080fd5b6102c65a03f115156118ba57600080fd5b50505060405180519050600160a060020a031683600019167f0f0c27adfd84b60b6f456b0e87cdccb1e5fb9603991588d87fa99f5b6b61e6708460020154856001015460405191825260208201526040908101905180910390a3505050565b60045481565b6249d40081565b600160a060020a0333811660009081526003602090815260408083208584529091528120549091168190111561195b57600080fd5b662386f26fc1000034101561196f57600080fd5b3433611979612187565b600160a060020a0390911681526020016040518091039082f080151561199e57600080fd5b33600160a060020a039081166000818152600360209081526040808320898452909152908190208054600160a060020a0319169385169390931790925591935090915083907fb556ff269c1b6714f432c36431e2041d28436a73b6c3f19c021827bbdc6bfc299034905190815260200160405180910390a35050565b80511515611a2757600080fd5b6002611a4b82600184510381518110611a3c57fe5b906020019060200201516114da565b6005811115611a5657fe5b1415611a6157600080fd5b611a72600182510382600154611fd6565b50565b60005b8151811015611aa757611a9f828281518110611a9057fe5b90602001906020020151611ab0565b600101611a78565b5050565b505050565b600080600454421080611aca5750600454630784ce000142115b80611b51575060008054600154600160a060020a03308116939216916302571be391906040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515611b2a57600080fd5b6102c65a03f11515611b3b57600080fd5b50505060405180519050600160a060020a031614155b15611b5b57600080fd5b611b64836114da565b91506001826005811115611b7457fe5b1415611b7f57611aab565b6000826005811115611b8d57fe5b14611b9757600080fd5b50600082815260026020819052604080832042620697800160018201819055928101849055600381019390935584917f87e97e825a1d1fa0c54e1d36c7506c1dea8b1efd451fe68b000cf96f7cf40003915190815260200160405180910390a2505050565b60015481565b611c0b82611a75565b611aa781611926565b60008054600154600160a060020a033081169216906302571be390846040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515611c6d57600080fd5b6102c65a03f11515611c7e57600080fd5b50505060405180519050600160a060020a03161415611aa757600054600154600160a060020a03909116906306ab592390843060405160e060020a63ffffffff861602815260048101939093526024830191909152600160a060020a03166044820152606401600060405180830381600087803b1515611cfd57600080fd5b6102c65a03f11515611d0e57600080fd5b5050506001548260405191825260208201526040908101905190819003902060008054919250600160a060020a0390911690631896f70a90839060405160e060020a63ffffffff85160281526004810192909252600160a060020a03166024820152604401600060405180830381600087803b1515611d8c57600080fd5b6102c65a03f11515611d9d57600080fd5b505060008054600160a060020a03169150635b0fc9c390839060405160e060020a63ffffffff85160281526004810192909252600160a060020a03166024820152604401600060405180830381600087803b1515611dfa57600080fd5b6102c65a03f11515611e0b57600080fd5b5050505050565b600060018201818080838651019250600091505b82841015611eba5760ff845116905060808160ff161015611e4c57600184019350611eaf565b60e08160ff161015611e6357600284019350611eaf565b60f08160ff161015611e7a57600384019350611eaf565b60f88160ff161015611e9157600484019350611eaf565b60fc8160ff161015611ea857600584019350611eaf565b6006840193505b600190910190611e26565b50949350505050565b600081831115611ed45750816116ab565b50806116ab565b600081831015611ed45750816116ab565b60008054600154600160a060020a03308116939216916302571be391906040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515611f4657600080fd5b6102c65a03f11515611f5757600080fd5b50505060405180519050600160a060020a03161415611aa757600054600154600160a060020a03909116906306ab592390848460405160e060020a63ffffffff861602815260048101939093526024830191909152600160a060020a03166044820152606401600060405180830381600087803b1515611dfa57600080fd5b600054600160a060020a03166306ab592382848681518110611ff457fe5b906020019060200201513060405160e060020a63ffffffff861602815260048101939093526024830191909152600160a060020a03166044820152606401600060405180830381600087803b151561204b57600080fd5b6102c65a03f1151561205c57600080fd5b5050508082848151811061206c57fe5b906020019060200201516040519182526020820152604090810190518091039020905060008311156120a6576120a6600184038383611fd6565b60008054600160a060020a031690631896f70a90839060405160e060020a63ffffffff85160281526004810192909252600160a060020a03166024820152604401600060405180830381600087803b151561210057600080fd5b6102c65a03f1151561211157600080fd5b505060008054600160a060020a03169150635b0fc9c390839060405160e060020a63ffffffff85160281526004810192909252600160a060020a03166024820152604401600060405180830381600087803b151561216e57600080fd5b6102c65a03f1151561217f57600080fd5b505050505050565b6040516104fc8061219883390190560060606040526040516020806104fc8339810160405280805160028054600160a060020a03928316600160a060020a03199182161790915560008054339093169290911691909117905550504260019081556005805460ff191690911790553460045561048c806100706000396000f300606060405236156100a15763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305b3441081146100a65780630b5ab3d5146100cb57806313af4035146100e05780632b20e397146100ff5780633fa4f2451461012e578063674f220f146101415780638da5cb5b14610154578063b0c8097214610167578063bbe4277114610182578063faab9d3914610198575b600080fd5b34156100b157600080fd5b6100b96101b7565b60405190815260200160405180910390f35b34156100d657600080fd5b6100de6101bd565b005b34156100eb57600080fd5b6100de600160a060020a0360043516610207565b341561010a57600080fd5b6101126102b0565b604051600160a060020a03909116815260200160405180910390f35b341561013957600080fd5b6100b96102bf565b341561014c57600080fd5b6101126102c5565b341561015f57600080fd5b6101126102d4565b341561017257600080fd5b6100de60043560243515156102e3565b341561018d57600080fd5b6100de60043561036c565b34156101a357600080fd5b6100de600160a060020a0360043516610416565b60015481565b60055460ff16156101cd57600080fd5b600254600160a060020a039081169030163180156108fc0290604051600060405180830381858888f19350505050156102055761deadff5b565b60005433600160a060020a0390811691161461022257600080fd5b600160a060020a038116151561023757600080fd5b6002805460038054600160a060020a0380841673ffffffffffffffffffffffffffffffffffffffff19928316179092559091169083161790557fa2ea9883a321a3e97b8266c2b078bfeec6d50c711ed71f874a90d500ae2eaf3681604051600160a060020a03909116815260200160405180910390a150565b600054600160a060020a031681565b60045481565b600354600160a060020a031681565b600254600160a060020a031681565b60005433600160a060020a039081169116146102fe57600080fd5b60055460ff16151561030f57600080fd5b81600454101561031e57600080fd5b6004829055600254600160a060020a039081169030163183900380156108fc0290604051600060405180830381858888f1935050505015801561035e5750805b1561036857600080fd5b5050565b60005433600160a060020a0390811691161461038757600080fd5b60055460ff16151561039857600080fd5b6005805460ff1916905561dead6103e8600160a060020a03301631838203020480156108fc0290604051600060405180830381858888f1935050505015156103df57600080fd5b7fbb2ce2f51803bba16bc85282b47deeea9a5c6223eabea1077be696b3f265cf1360405160405180910390a16104136101bd565b50565b60005433600160a060020a0390811691161461043157600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555600a165627a7a7230582023849fab751378a237489f526a289ede7796b7f6b7dac5a973b8c3ca25f368a800297b6c4b278d165a6b33958f8ea5dfb00c8c9d4d0acf1985bef5d10786898bc3e7a165627a7a72305820e6807b87ab11a69864cefed52eef7f9c4635fd0e26312e944bbbcbff5cd26d920029" -registrar_bytecode_runtime = "606060405236156101175763ffffffff60e060020a6000350416630230a07c811461011c57806313c89a8f1461013457806315f733311461015c57806322ec1244146101ad5780632525f5c1146101d5578063267b6922146101f75780633f15457f1461025f57806347872b421461028e5780635ddae283146102aa5780635e431709146102c057806361d585da146102e257806379ce9fac1461031c578063935033371461033e578063983b94fb1461036b5780639c67f06f14610381578063ae1a0b0c14610394578063ce92dced146103c0578063de10f04b146103cb578063e27fe50f1461041a578063ea9e107a14610469578063ede8acdb1461048e578063faff50a8146104a4578063febefd61146104b7575b600080fd5b341561012757600080fd5b6101326004356104fd565b005b341561013f57600080fd5b61014a60043561072a565b60405190815260200160405180910390f35b341561016757600080fd5b61013260046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061074e95505050505050565b34156101b857600080fd5b61014a600435600160a060020a0360243516604435606435610a7a565b34156101e057600080fd5b610132600160a060020a0360043516602435610ac5565b341561020257600080fd5b61020d600435610c8c565b6040518086600581111561021d57fe5b60ff16815260200185600160a060020a0316600160a060020a031681526020018481526020018381526020018281526020019550505050505060405180910390f35b341561026a57600080fd5b610272610cd8565b604051600160a060020a03909116815260200160405180910390f35b341561029957600080fd5b610132600435602435604435610ce7565b34156102b557600080fd5b610132600435611254565b34156102cb57600080fd5b610272600160a060020a03600435166024356114b4565b34156102ed57600080fd5b6102f86004356114da565b6040518082600581111561030857fe5b60ff16815260200191505060405180910390f35b341561032757600080fd5b610132600435600160a060020a0360243516611550565b341561034957600080fd5b61035760043560243561169b565b604051901515815260200160405180910390f35b341561037657600080fd5b6101326004356116b1565b341561038c57600080fd5b61014a611919565b341561039f57600080fd5b6103a761191f565b60405163ffffffff909116815260200160405180910390f35b610132600435611926565b34156103d657600080fd5b6101326004602481358181019083013580602081810201604051908101604052809392919081815260200183836020028082843750949650611a1a95505050505050565b341561042557600080fd5b6101326004602481358181019083013580602081810201604051908101604052809392919081815260200183836020028082843750949650611a7595505050505050565b341561047457600080fd5b610132600435600160a060020a0360243516604435611aab565b341561049957600080fd5b610132600435611ab0565b34156104af57600080fd5b61014a611bfc565b61013260046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496505093359350611c0292505050565b60008082600261050c826114da565b600581111561051757fe5b1415806105a3575060008181526002602052604080822054600160a060020a031691638da5cb5b9151602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561057257600080fd5b6102c65a03f1151561058357600080fd5b50505060405180519050600160a060020a031633600160a060020a031614155b156105ad57600080fd5b600084815260026020526040902080546001820154919450600160a060020a031692506301e13380014210801561065f575060008054600154600160a060020a03308116939216916302571be391906040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561063957600080fd5b6102c65a03f1151561064a57600080fd5b50505060405180519050600160a060020a0316145b1561066957600080fd5b60006002840181905560038401558254600160a060020a031916835561068e84611c14565b81600160a060020a031663bbe427716103e860405160e060020a63ffffffff84160281526004810191909152602401600060405180830381600087803b15156106d657600080fd5b6102c65a03f115156106e757600080fd5b505050600283015484907f292b79b9246fa2c8e77d3fe195b251f9cb839d7d038e667c069ee7708c631e169060405190815260200160405180910390a250505050565b6004547001000000000000000000000000000000006249d400818404020401919050565b600080826040518082805190602001908083835b602083106107815780518252601f199092019160209182019101610762565b6001836020036101000a03801982511681845116179092525050509190910192506040915050519081900390206002806107ba836114da565b60058111156107c557fe5b146107cf57600080fd5b60066107da86611e12565b11156107e557600080fd5b846040518082805190602001908083835b602083106108155780518252601f1990920191602091820191016107f6565b6001836020036101000a03801982511681845116179092525050509190910192506040915050519081900390206000818152600260205260409020909450925061085e84611c14565b8254600160a060020a0316156109b5576108838360020154662386f26fc10000611ec3565b60028085018290558454600160a060020a03169163b0c80972919004600060405160e060020a63ffffffff8516028152600481019290925215156024820152604401600060405180830381600087803b15156108de57600080fd5b6102c65a03f115156108ef57600080fd5b50508354600160a060020a031690506313af40353360405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b151561094257600080fd5b6102c65a03f1151561095357600080fd5b50508354600160a060020a0316905063bbe427716103e860405160e060020a63ffffffff84160281526004810191909152602401600060405180830381600087803b15156109a057600080fd5b6102c65a03f115156109b157600080fd5b5050505b846040518082805190602001908083835b602083106109e55780518252601f1990920191602091820191016109c6565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902084600019167f1f9c649fe47e58bb60f4e52f0d90e4c47a526c9f90c5113df842c025970b66ad8560020154866001015460405191825260208201526040908101905180910390a3505060006002820181905560038201558054600160a060020a03191690555050565b600084848484604051938452600160a060020a03929092166c010000000000000000000000000260208401526034830152605482015260740160405180910390209050949350505050565b600160a060020a03808316600090815260036020908152604080832085845290915290205416801580610b61575062069780600160a060020a0382166305b344106000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610b3d57600080fd5b6102c65a03f11515610b4e57600080fd5b5050506040518051905001621275000142105b15610b6b57600080fd5b80600160a060020a03166313af40353360405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b1515610bb957600080fd5b6102c65a03f11515610bca57600080fd5b50505080600160a060020a031663bbe42771600560405160e060020a63ffffffff84160281526004810191909152602401600060405180830381600087803b1515610c1457600080fd5b6102c65a03f11515610c2557600080fd5b505050600160a060020a03831660008181526003602090815260408083208684529091528082208054600160a060020a03191690558491600080516020612694833981519152916005905191825260ff1660208201526040908101905180910390a3505050565b60008181526002602052604081208190819081908190610cab876114da565b815460018301546002840154600390940154929a600160a060020a03909216995097509195509350915050565b600054600160a060020a031681565b600080600080600080610cfc89338a8a610a7a565b600160a060020a033381166000908152600360209081526040808320858452909152902054919750169450841515610d3357600080fd5b600160a060020a0333811660009081526003602090815260408083208a845282528083208054600160a060020a03191690558c835260029091528082209650610dd6928b9290891691633fa4f245919051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610db657600080fd5b6102c65a03f11515610dc757600080fd5b50505060405180519050611edb565b925084600160a060020a031663b0c8097284600160405160e060020a63ffffffff8516028152600481019290925215156024820152604401600060405180830381600087803b1515610e2757600080fd5b6102c65a03f11515610e3857600080fd5b505050610e44896114da565b91506002826005811115610e5457fe5b1415610ef25784600160a060020a031663bbe42771600560405160e060020a63ffffffff84160281526004810191909152602401600060405180830381600087803b1515610ea157600080fd5b6102c65a03f11515610eb257600080fd5b5050600160a060020a03331690508960008051602061269483398151915285600160405191825260ff1660208201526040908101905180910390a3611249565b6004826005811115610f0057fe5b14610f0a57600080fd5b662386f26fc10000831080610f88575060018401546202a2ff1901600160a060020a0386166305b344106000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610f6b57600080fd5b6102c65a03f11515610f7c57600080fd5b50505060405180519050115b156110265784600160a060020a031663bbe427716103e360405160e060020a63ffffffff84160281526004810191909152602401600060405180830381600087803b1515610fd557600080fd5b6102c65a03f11515610fe657600080fd5b5050600160a060020a03331690508960008051602061269483398151915285600060405191825260ff1660208201526040908101905180910390a3611249565b8360030154831115611108578354600160a060020a0316156110a257508254600160a060020a03168063bbe427716103e360405160e060020a63ffffffff84160281526004810191909152602401600060405180830381600087803b151561108d57600080fd5b6102c65a03f1151561109e57600080fd5b5050505b600384018054600280870191909155908490558454600160a060020a031916600160a060020a038781169190911786553316908a9060008051602061269483398151915290869060405191825260ff1660208201526040908101905180910390a3611249565b83600201548311156111b45760028401839055600160a060020a03851663bbe427716103e360405160e060020a63ffffffff84160281526004810191909152602401600060405180830381600087803b151561116357600080fd5b6102c65a03f1151561117457600080fd5b5050600160a060020a03331690508960008051602061269483398151915285600360405191825260ff1660208201526040908101905180910390a3611249565b84600160a060020a031663bbe427716103e360405160e060020a63ffffffff84160281526004810191909152602401600060405180830381600087803b15156111fc57600080fd5b6102c65a03f1151561120d57600080fd5b5050600160a060020a03331690508960008051602061269483398151915285600460405191825260ff1660208201526040908101905180910390a35b505050505050505050565b600080826002611263826114da565b600581111561126e57fe5b1415806112fa575060008181526002602052604080822054600160a060020a031691638da5cb5b9151602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156112c957600080fd5b6102c65a03f115156112da57600080fd5b50505060405180519050600160a060020a031633600160a060020a031614155b1561130457600080fd5b60008054600154600160a060020a03909116916302571be391906040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561135b57600080fd5b6102c65a03f1151561136c57600080fd5b50505060405180519050925030600160a060020a031683600160a060020a0316141561139757600080fd5b600084815260026020526040908190208054909350600160a060020a03169063faab9d399085905160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b15156113fa57600080fd5b6102c65a03f1151561140b57600080fd5b505082546001840154600160a060020a03808716935063ea9e107a92889291169060405160e060020a63ffffffff86160281526004810193909352600160a060020a0390911660248301526044820152606401600060405180830381600087803b151561147757600080fd5b6102c65a03f1151561148857600080fd5b50508254600160a060020a03191683555050600060018201819055600282018190556003909101555050565b6003602090815260009283526040808420909152908252902054600160a060020a031681565b60008181526002602052604081206114f2834261169b565b1515611501576005915061154a565b80600101544210156115315760018101546202a2ff1901421015611528576001915061154a565b6004915061154a565b60038101541515611545576000915061154a565b600291505b50919050565b600082600261155e826114da565b600581111561156957fe5b1415806115f5575060008181526002602052604080822054600160a060020a031691638da5cb5b9151602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156115c457600080fd5b6102c65a03f115156115d557600080fd5b50505060405180519050600160a060020a031633600160a060020a031614155b156115ff57600080fd5b600160a060020a038316151561161457600080fd5b600084815260026020526040908190208054909350600160a060020a0316906313af40359085905160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b151561167757600080fd5b6102c65a03f1151561168857600080fd5b5050506116958484611eec565b50505050565b60006116a68361072a565b821190505b92915050565b60008160026116bf826114da565b60058111156116ca57fe5b141580611756575060008181526002602052604080822054600160a060020a031691638da5cb5b9151602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561172557600080fd5b6102c65a03f1151561173657600080fd5b50505060405180519050600160a060020a031633600160a060020a031614155b1561176057600080fd5b60008381526002602081905260409091209081015490925061178990662386f26fc10000611ec3565b600283018190558254600160a060020a03169063b0c8097290600160405160e060020a63ffffffff8516028152600481019290925215156024820152604401600060405180830381600087803b15156117e157600080fd5b6102c65a03f115156117f257600080fd5b5050825461186291508490600160a060020a0316638da5cb5b6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561184257600080fd5b6102c65a03f1151561185357600080fd5b50505060405180519050611eec565b8154600160a060020a0316638da5cb5b6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156118a957600080fd5b6102c65a03f115156118ba57600080fd5b50505060405180519050600160a060020a031683600019167f0f0c27adfd84b60b6f456b0e87cdccb1e5fb9603991588d87fa99f5b6b61e6708460020154856001015460405191825260208201526040908101905180910390a3505050565b60045481565b6249d40081565b600160a060020a0333811660009081526003602090815260408083208584529091528120549091168190111561195b57600080fd5b662386f26fc1000034101561196f57600080fd5b3433611979612187565b600160a060020a0390911681526020016040518091039082f080151561199e57600080fd5b33600160a060020a039081166000818152600360209081526040808320898452909152908190208054600160a060020a0319169385169390931790925591935090915083907fb556ff269c1b6714f432c36431e2041d28436a73b6c3f19c021827bbdc6bfc299034905190815260200160405180910390a35050565b80511515611a2757600080fd5b6002611a4b82600184510381518110611a3c57fe5b906020019060200201516114da565b6005811115611a5657fe5b1415611a6157600080fd5b611a72600182510382600154611fd6565b50565b60005b8151811015611aa757611a9f828281518110611a9057fe5b90602001906020020151611ab0565b600101611a78565b5050565b505050565b600080600454421080611aca5750600454630784ce000142115b80611b51575060008054600154600160a060020a03308116939216916302571be391906040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515611b2a57600080fd5b6102c65a03f11515611b3b57600080fd5b50505060405180519050600160a060020a031614155b15611b5b57600080fd5b611b64836114da565b91506001826005811115611b7457fe5b1415611b7f57611aab565b6000826005811115611b8d57fe5b14611b9757600080fd5b50600082815260026020819052604080832042620697800160018201819055928101849055600381019390935584917f87e97e825a1d1fa0c54e1d36c7506c1dea8b1efd451fe68b000cf96f7cf40003915190815260200160405180910390a2505050565b60015481565b611c0b82611a75565b611aa781611926565b60008054600154600160a060020a033081169216906302571be390846040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515611c6d57600080fd5b6102c65a03f11515611c7e57600080fd5b50505060405180519050600160a060020a03161415611aa757600054600154600160a060020a03909116906306ab592390843060405160e060020a63ffffffff861602815260048101939093526024830191909152600160a060020a03166044820152606401600060405180830381600087803b1515611cfd57600080fd5b6102c65a03f11515611d0e57600080fd5b5050506001548260405191825260208201526040908101905190819003902060008054919250600160a060020a0390911690631896f70a90839060405160e060020a63ffffffff85160281526004810192909252600160a060020a03166024820152604401600060405180830381600087803b1515611d8c57600080fd5b6102c65a03f11515611d9d57600080fd5b505060008054600160a060020a03169150635b0fc9c390839060405160e060020a63ffffffff85160281526004810192909252600160a060020a03166024820152604401600060405180830381600087803b1515611dfa57600080fd5b6102c65a03f11515611e0b57600080fd5b5050505050565b600060018201818080838651019250600091505b82841015611eba5760ff845116905060808160ff161015611e4c57600184019350611eaf565b60e08160ff161015611e6357600284019350611eaf565b60f08160ff161015611e7a57600384019350611eaf565b60f88160ff161015611e9157600484019350611eaf565b60fc8160ff161015611ea857600584019350611eaf565b6006840193505b600190910190611e26565b50949350505050565b600081831115611ed45750816116ab565b50806116ab565b600081831015611ed45750816116ab565b60008054600154600160a060020a03308116939216916302571be391906040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515611f4657600080fd5b6102c65a03f11515611f5757600080fd5b50505060405180519050600160a060020a03161415611aa757600054600154600160a060020a03909116906306ab592390848460405160e060020a63ffffffff861602815260048101939093526024830191909152600160a060020a03166044820152606401600060405180830381600087803b1515611dfa57600080fd5b600054600160a060020a03166306ab592382848681518110611ff457fe5b906020019060200201513060405160e060020a63ffffffff861602815260048101939093526024830191909152600160a060020a03166044820152606401600060405180830381600087803b151561204b57600080fd5b6102c65a03f1151561205c57600080fd5b5050508082848151811061206c57fe5b906020019060200201516040519182526020820152604090810190518091039020905060008311156120a6576120a6600184038383611fd6565b60008054600160a060020a031690631896f70a90839060405160e060020a63ffffffff85160281526004810192909252600160a060020a03166024820152604401600060405180830381600087803b151561210057600080fd5b6102c65a03f1151561211157600080fd5b505060008054600160a060020a03169150635b0fc9c390839060405160e060020a63ffffffff85160281526004810192909252600160a060020a03166024820152604401600060405180830381600087803b151561216e57600080fd5b6102c65a03f1151561217f57600080fd5b505050505050565b6040516104fc8061219883390190560060606040526040516020806104fc8339810160405280805160028054600160a060020a03928316600160a060020a03199182161790915560008054339093169290911691909117905550504260019081556005805460ff191690911790553460045561048c806100706000396000f300606060405236156100a15763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305b3441081146100a65780630b5ab3d5146100cb57806313af4035146100e05780632b20e397146100ff5780633fa4f2451461012e578063674f220f146101415780638da5cb5b14610154578063b0c8097214610167578063bbe4277114610182578063faab9d3914610198575b600080fd5b34156100b157600080fd5b6100b96101b7565b60405190815260200160405180910390f35b34156100d657600080fd5b6100de6101bd565b005b34156100eb57600080fd5b6100de600160a060020a0360043516610207565b341561010a57600080fd5b6101126102b0565b604051600160a060020a03909116815260200160405180910390f35b341561013957600080fd5b6100b96102bf565b341561014c57600080fd5b6101126102c5565b341561015f57600080fd5b6101126102d4565b341561017257600080fd5b6100de60043560243515156102e3565b341561018d57600080fd5b6100de60043561036c565b34156101a357600080fd5b6100de600160a060020a0360043516610416565b60015481565b60055460ff16156101cd57600080fd5b600254600160a060020a039081169030163180156108fc0290604051600060405180830381858888f19350505050156102055761deadff5b565b60005433600160a060020a0390811691161461022257600080fd5b600160a060020a038116151561023757600080fd5b6002805460038054600160a060020a0380841673ffffffffffffffffffffffffffffffffffffffff19928316179092559091169083161790557fa2ea9883a321a3e97b8266c2b078bfeec6d50c711ed71f874a90d500ae2eaf3681604051600160a060020a03909116815260200160405180910390a150565b600054600160a060020a031681565b60045481565b600354600160a060020a031681565b600254600160a060020a031681565b60005433600160a060020a039081169116146102fe57600080fd5b60055460ff16151561030f57600080fd5b81600454101561031e57600080fd5b6004829055600254600160a060020a039081169030163183900380156108fc0290604051600060405180830381858888f1935050505015801561035e5750805b1561036857600080fd5b5050565b60005433600160a060020a0390811691161461038757600080fd5b60055460ff16151561039857600080fd5b6005805460ff1916905561dead6103e8600160a060020a03301631838203020480156108fc0290604051600060405180830381858888f1935050505015156103df57600080fd5b7fbb2ce2f51803bba16bc85282b47deeea9a5c6223eabea1077be696b3f265cf1360405160405180910390a16104136101bd565b50565b60005433600160a060020a0390811691161461043157600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555600a165627a7a7230582023849fab751378a237489f526a289ede7796b7f6b7dac5a973b8c3ca25f368a800297b6c4b278d165a6b33958f8ea5dfb00c8c9d4d0acf1985bef5d10786898bc3e7a165627a7a72305820e6807b87ab11a69864cefed52eef7f9c4635fd0e26312e944bbbcbff5cd26d920029" - -resolver_abi = json.loads('[{"constant":true,"inputs":[{"name":"interfaceID","type":"bytes4"}],"name":"supportsInterface","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"node","type":"bytes32"},{"name":"key","type":"string"},{"name":"value","type":"string"}],"name":"setText","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"node","type":"bytes32"},{"name":"contentTypes","type":"uint256"}],"name":"ABI","outputs":[{"name":"contentType","type":"uint256"},{"name":"data","type":"bytes"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"node","type":"bytes32"},{"name":"x","type":"bytes32"},{"name":"y","type":"bytes32"}],"name":"setPubkey","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"node","type":"bytes32"}],"name":"content","outputs":[{"name":"ret","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"node","type":"bytes32"}],"name":"addr","outputs":[{"name":"ret","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"node","type":"bytes32"},{"name":"key","type":"string"}],"name":"text","outputs":[{"name":"ret","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"node","type":"bytes32"},{"name":"contentType","type":"uint256"},{"name":"data","type":"bytes"}],"name":"setABI","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"node","type":"bytes32"}],"name":"name","outputs":[{"name":"ret","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"node","type":"bytes32"},{"name":"name","type":"string"}],"name":"setName","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"node","type":"bytes32"},{"name":"hash","type":"bytes32"}],"name":"setContent","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"node","type":"bytes32"}],"name":"pubkey","outputs":[{"name":"x","type":"bytes32"},{"name":"y","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"node","type":"bytes32"},{"name":"addr","type":"address"}],"name":"setAddr","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"ensAddr","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"node","type":"bytes32"},{"indexed":false,"name":"a","type":"address"}],"name":"AddrChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"node","type":"bytes32"},{"indexed":false,"name":"hash","type":"bytes32"}],"name":"ContentChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"node","type":"bytes32"},{"indexed":false,"name":"name","type":"string"}],"name":"NameChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"node","type":"bytes32"},{"indexed":true,"name":"contentType","type":"uint256"}],"name":"ABIChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"node","type":"bytes32"},{"indexed":false,"name":"x","type":"bytes32"},{"indexed":false,"name":"y","type":"bytes32"}],"name":"PubkeyChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"node","type":"bytes32"},{"indexed":true,"name":"indexedKey","type":"string"},{"indexed":false,"name":"key","type":"string"}],"name":"TextChanged","type":"event"}]') -resolver_bytecode = "6060604052341561000f57600080fd5b6040516020806111b08339810160405280805160008054600160a060020a03909216600160a060020a0319909216919091179055505061115c806100546000396000f300606060405236156100a95763ffffffff60e060020a60003504166301ffc9a781146100ae57806310f13a8c146100e25780632203ab561461017c57806329cd62ea146102135780632dff69411461022f5780633b3b57de1461025757806359d1d43c14610289578063623195b014610356578063691f3431146103b257806377372213146103c8578063c3d014d61461041e578063c869023314610437578063d5fa2b0014610465575b600080fd5b34156100b957600080fd5b6100ce600160e060020a031960043516610487565b604051901515815260200160405180910390f35b34156100ed57600080fd5b61017a600480359060446024803590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496506105f495505050505050565b005b341561018757600080fd5b610195600435602435610805565b60405182815260406020820181815290820183818151815260200191508051906020019080838360005b838110156101d75780820151838201526020016101bf565b50505050905090810190601f1680156102045780820380516001836020036101000a031916815260200191505b50935050505060405180910390f35b341561021e57600080fd5b61017a60043560243560443561092f565b341561023a57600080fd5b610245600435610a2e565b60405190815260200160405180910390f35b341561026257600080fd5b61026d600435610a44565b604051600160a060020a03909116815260200160405180910390f35b341561029457600080fd5b6102df600480359060446024803590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610a5f95505050505050565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561031b578082015183820152602001610303565b50505050905090810190601f1680156103485780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561036157600080fd5b61017a600480359060248035919060649060443590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610b7e95505050505050565b34156103bd57600080fd5b6102df600435610c7a565b34156103d357600080fd5b61017a600480359060446024803590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610d4095505050505050565b341561042957600080fd5b61017a600435602435610e8a565b341561044257600080fd5b61044d600435610f63565b60405191825260208201526040908101905180910390f35b341561047057600080fd5b61017a600435600160a060020a0360243516610f80565b6000600160e060020a031982167f3b3b57de0000000000000000000000000000000000000000000000000000000014806104ea5750600160e060020a031982167fd8389dc500000000000000000000000000000000000000000000000000000000145b8061051e5750600160e060020a031982167f691f343100000000000000000000000000000000000000000000000000000000145b806105525750600160e060020a031982167f2203ab5600000000000000000000000000000000000000000000000000000000145b806105865750600160e060020a031982167fc869023300000000000000000000000000000000000000000000000000000000145b806105ba5750600160e060020a031982167f59d1d43c00000000000000000000000000000000000000000000000000000000145b806105ee5750600160e060020a031982167f01ffc9a700000000000000000000000000000000000000000000000000000000145b92915050565b600080548491600160a060020a033381169216906302571be39084906040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561064d57600080fd5b6102c65a03f1151561065e57600080fd5b50505060405180519050600160a060020a031614151561067d57600080fd5b6000848152600160205260409081902083916005909101908590518082805190602001908083835b602083106106c45780518252601f1990920191602091820191016106a5565b6001836020036101000a0380198251168184511680821785525050505050509050019150509081526020016040518091039020908051610708929160200190611083565b50826040518082805190602001908083835b602083106107395780518252601f19909201916020918201910161071a565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051908190039020847fd8c9334b1a9c2f9da342a0a2b32629c1a229b6445dad78947f674b44444a75508560405160208082528190810183818151815260200191508051906020019080838360005b838110156107c55780820151838201526020016107ad565b50505050905090810190601f1680156107f25780820380516001836020036101000a031916815260200191505b509250505060405180910390a350505050565b600061080f611101565b60008481526001602081905260409091209092505b838311610922578284161580159061085d5750600083815260068201602052604081205460026000196101006001841615020190911604115b15610917578060060160008481526020019081526020016000208054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561090b5780601f106108e05761010080835404028352916020019161090b565b820191906000526020600020905b8154815290600101906020018083116108ee57829003601f168201915b50505050509150610927565b600290920291610824565b600092505b509250929050565b600080548491600160a060020a033381169216906302571be39084906040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561098857600080fd5b6102c65a03f1151561099957600080fd5b50505060405180519050600160a060020a03161415156109b857600080fd5b6040805190810160409081528482526020808301859052600087815260019091522060030181518155602082015160019091015550837f1d6f5e03d3f63eb58751986629a5439baee5079ff04f345becb66e23eb154e46848460405191825260208201526040908101905180910390a250505050565b6000908152600160208190526040909120015490565b600090815260016020526040902054600160a060020a031690565b610a67611101565b60008381526001602052604090819020600501908390518082805190602001908083835b60208310610aaa5780518252601f199092019160209182019101610a8b565b6001836020036101000a03801982511681845116808217855250505050505090500191505090815260200160405180910390208054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b715780601f10610b4657610100808354040283529160200191610b71565b820191906000526020600020905b815481529060010190602001808311610b5457829003601f168201915b5050505050905092915050565b600080548491600160a060020a033381169216906302571be39084906040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515610bd757600080fd5b6102c65a03f11515610be857600080fd5b50505060405180519050600160a060020a0316141515610c0757600080fd5b6000198301831615610c1857600080fd5b60008481526001602090815260408083208684526006019091529020828051610c45929160200190611083565b5082847faa121bbeef5f32f5961a2a28966e769023910fc9479059ee3495d4c1a696efe360405160405180910390a350505050565b610c82611101565b6001600083600019166000191681526020019081526020016000206002018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d345780601f10610d0957610100808354040283529160200191610d34565b820191906000526020600020905b815481529060010190602001808311610d1757829003601f168201915b50505050509050919050565b600080548391600160a060020a033381169216906302571be39084906040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515610d9957600080fd5b6102c65a03f11515610daa57600080fd5b50505060405180519050600160a060020a0316141515610dc957600080fd5b6000838152600160205260409020600201828051610deb929160200190611083565b50827fb7d29e911041e8d9b843369e890bcb72c9388692ba48b65ac54e7214c4c348f78360405160208082528190810183818151815260200191508051906020019080838360005b83811015610e4b578082015183820152602001610e33565b50505050905090810190601f168015610e785780820380516001836020036101000a031916815260200191505b509250505060405180910390a2505050565b600080548391600160a060020a033381169216906302571be39084906040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515610ee357600080fd5b6102c65a03f11515610ef457600080fd5b50505060405180519050600160a060020a0316141515610f1357600080fd5b6000838152600160208190526040918290200183905583907f0424b6fe0d9c3bdbece0e7879dc241bb0c22e900be8b6c168b4ee08bd9bf83bc9084905190815260200160405180910390a2505050565b600090815260016020526040902060038101546004909101549091565b600080548391600160a060020a033381169216906302571be39084906040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515610fd957600080fd5b6102c65a03f11515610fea57600080fd5b50505060405180519050600160a060020a031614151561100957600080fd5b60008381526001602052604090819020805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03851617905583907f52d7d861f09ab3d26239d492e8968629f95e9e318cf0b73bfddc441522a15fd290849051600160a060020a03909116815260200160405180910390a2505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106110c457805160ff19168380011785556110f1565b828001600101855582156110f1579182015b828111156110f15782518255916020019190600101906110d6565b506110fd929150611113565b5090565b60206040519081016040526000815290565b61112d91905b808211156110fd5760008155600101611119565b905600a165627a7a723058206016a807d9d5f6060e9c0d1c808e52d4ca30a4cab0140adcc6587bfc13bedf100029" -resolver_bytecode_runtime = "606060405236156100a95763ffffffff60e060020a60003504166301ffc9a781146100ae57806310f13a8c146100e25780632203ab561461017c57806329cd62ea146102135780632dff69411461022f5780633b3b57de1461025757806359d1d43c14610289578063623195b014610356578063691f3431146103b257806377372213146103c8578063c3d014d61461041e578063c869023314610437578063d5fa2b0014610465575b600080fd5b34156100b957600080fd5b6100ce600160e060020a031960043516610487565b604051901515815260200160405180910390f35b34156100ed57600080fd5b61017a600480359060446024803590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405281815292919060208401838380828437509496506105f495505050505050565b005b341561018757600080fd5b610195600435602435610805565b60405182815260406020820181815290820183818151815260200191508051906020019080838360005b838110156101d75780820151838201526020016101bf565b50505050905090810190601f1680156102045780820380516001836020036101000a031916815260200191505b50935050505060405180910390f35b341561021e57600080fd5b61017a60043560243560443561092f565b341561023a57600080fd5b610245600435610a2e565b60405190815260200160405180910390f35b341561026257600080fd5b61026d600435610a44565b604051600160a060020a03909116815260200160405180910390f35b341561029457600080fd5b6102df600480359060446024803590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610a5f95505050505050565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561031b578082015183820152602001610303565b50505050905090810190601f1680156103485780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561036157600080fd5b61017a600480359060248035919060649060443590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610b7e95505050505050565b34156103bd57600080fd5b6102df600435610c7a565b34156103d357600080fd5b61017a600480359060446024803590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610d4095505050505050565b341561042957600080fd5b61017a600435602435610e8a565b341561044257600080fd5b61044d600435610f63565b60405191825260208201526040908101905180910390f35b341561047057600080fd5b61017a600435600160a060020a0360243516610f80565b6000600160e060020a031982167f3b3b57de0000000000000000000000000000000000000000000000000000000014806104ea5750600160e060020a031982167fd8389dc500000000000000000000000000000000000000000000000000000000145b8061051e5750600160e060020a031982167f691f343100000000000000000000000000000000000000000000000000000000145b806105525750600160e060020a031982167f2203ab5600000000000000000000000000000000000000000000000000000000145b806105865750600160e060020a031982167fc869023300000000000000000000000000000000000000000000000000000000145b806105ba5750600160e060020a031982167f59d1d43c00000000000000000000000000000000000000000000000000000000145b806105ee5750600160e060020a031982167f01ffc9a700000000000000000000000000000000000000000000000000000000145b92915050565b600080548491600160a060020a033381169216906302571be39084906040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561064d57600080fd5b6102c65a03f1151561065e57600080fd5b50505060405180519050600160a060020a031614151561067d57600080fd5b6000848152600160205260409081902083916005909101908590518082805190602001908083835b602083106106c45780518252601f1990920191602091820191016106a5565b6001836020036101000a0380198251168184511680821785525050505050509050019150509081526020016040518091039020908051610708929160200190611083565b50826040518082805190602001908083835b602083106107395780518252601f19909201916020918201910161071a565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051908190039020847fd8c9334b1a9c2f9da342a0a2b32629c1a229b6445dad78947f674b44444a75508560405160208082528190810183818151815260200191508051906020019080838360005b838110156107c55780820151838201526020016107ad565b50505050905090810190601f1680156107f25780820380516001836020036101000a031916815260200191505b509250505060405180910390a350505050565b600061080f611101565b60008481526001602081905260409091209092505b838311610922578284161580159061085d5750600083815260068201602052604081205460026000196101006001841615020190911604115b15610917578060060160008481526020019081526020016000208054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561090b5780601f106108e05761010080835404028352916020019161090b565b820191906000526020600020905b8154815290600101906020018083116108ee57829003601f168201915b50505050509150610927565b600290920291610824565b600092505b509250929050565b600080548491600160a060020a033381169216906302571be39084906040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561098857600080fd5b6102c65a03f1151561099957600080fd5b50505060405180519050600160a060020a03161415156109b857600080fd5b6040805190810160409081528482526020808301859052600087815260019091522060030181518155602082015160019091015550837f1d6f5e03d3f63eb58751986629a5439baee5079ff04f345becb66e23eb154e46848460405191825260208201526040908101905180910390a250505050565b6000908152600160208190526040909120015490565b600090815260016020526040902054600160a060020a031690565b610a67611101565b60008381526001602052604090819020600501908390518082805190602001908083835b60208310610aaa5780518252601f199092019160209182019101610a8b565b6001836020036101000a03801982511681845116808217855250505050505090500191505090815260200160405180910390208054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b715780601f10610b4657610100808354040283529160200191610b71565b820191906000526020600020905b815481529060010190602001808311610b5457829003601f168201915b5050505050905092915050565b600080548491600160a060020a033381169216906302571be39084906040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515610bd757600080fd5b6102c65a03f11515610be857600080fd5b50505060405180519050600160a060020a0316141515610c0757600080fd5b6000198301831615610c1857600080fd5b60008481526001602090815260408083208684526006019091529020828051610c45929160200190611083565b5082847faa121bbeef5f32f5961a2a28966e769023910fc9479059ee3495d4c1a696efe360405160405180910390a350505050565b610c82611101565b6001600083600019166000191681526020019081526020016000206002018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d345780601f10610d0957610100808354040283529160200191610d34565b820191906000526020600020905b815481529060010190602001808311610d1757829003601f168201915b50505050509050919050565b600080548391600160a060020a033381169216906302571be39084906040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515610d9957600080fd5b6102c65a03f11515610daa57600080fd5b50505060405180519050600160a060020a0316141515610dc957600080fd5b6000838152600160205260409020600201828051610deb929160200190611083565b50827fb7d29e911041e8d9b843369e890bcb72c9388692ba48b65ac54e7214c4c348f78360405160208082528190810183818151815260200191508051906020019080838360005b83811015610e4b578082015183820152602001610e33565b50505050905090810190601f168015610e785780820380516001836020036101000a031916815260200191505b509250505060405180910390a2505050565b600080548391600160a060020a033381169216906302571be39084906040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515610ee357600080fd5b6102c65a03f11515610ef457600080fd5b50505060405180519050600160a060020a0316141515610f1357600080fd5b6000838152600160208190526040918290200183905583907f0424b6fe0d9c3bdbece0e7879dc241bb0c22e900be8b6c168b4ee08bd9bf83bc9084905190815260200160405180910390a2505050565b600090815260016020526040902060038101546004909101549091565b600080548391600160a060020a033381169216906302571be39084906040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515610fd957600080fd5b6102c65a03f11515610fea57600080fd5b50505060405180519050600160a060020a031614151561100957600080fd5b60008381526001602052604090819020805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03851617905583907f52d7d861f09ab3d26239d492e8968629f95e9e318cf0b73bfddc441522a15fd290849051600160a060020a03909116815260200160405180910390a2505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106110c457805160ff19168380011785556110f1565b828001600101855582156110f1579182015b828111156110f15782518255916020019190600101906110d6565b506110fd929150611113565b5090565b60206040519081016040526000815290565b61112d91905b808211156110fd5760008155600101611119565b905600a165627a7a723058206016a807d9d5f6060e9c0d1c808e52d4ca30a4cab0140adcc6587bfc13bedf100029" - - -reverse_registrar_abi = json.loads('[{"constant":false,"inputs":[{"name":"owner","type":"address"},{"name":"resolver","type":"address"}],"name":"claimWithResolver","outputs":[{"name":"node","type":"bytes32"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"owner","type":"address"}],"name":"claim","outputs":[{"name":"node","type":"bytes32"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"ens","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"defaultResolver","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"addr","type":"address"}],"name":"node","outputs":[{"name":"ret","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"name","type":"string"}],"name":"setName","outputs":[{"name":"node","type":"bytes32"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"ensAddr","type":"address"},{"name":"resolverAddr","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"}]') -reverse_registrar_bytecode = "6060604052341561000f57600080fd5b604051604080610d96833981016040528080519060200190919080519060200190919050506000826000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166302571be37f91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e26001026000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b151561017a57600080fd5b6102c65a03f1151561018b57600080fd5b50505060405180519050905060008173ffffffffffffffffffffffffffffffffffffffff16141515610277578073ffffffffffffffffffffffffffffffffffffffff16631e83409a336000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561025a57600080fd5b6102c65a03f1151561026b57600080fd5b50505060405180519050505b505050610b0d806102896000396000f300606060405260043610610078576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630f5a54661461007d5780631e83409a146100f15780633f15457f14610146578063828eab0e1461019b578063bffbe61c146101f0578063c47f002714610245575b600080fd5b341561008857600080fd5b6100d3600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506102be565b60405180826000191660001916815260200191505060405180910390f35b34156100fc57600080fd5b610128600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061086e565b60405180826000191660001916815260200191505060405180910390f35b341561015157600080fd5b610159610882565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156101a657600080fd5b6101ae6108a7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156101fb57600080fd5b610227600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506108cd565b60405180826000191660001916815260200191505060405180910390f35b341561025057600080fd5b6102a0600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061092f565b60405180826000191660001916815260200191505060405180910390f35b60008060006102cc33610a80565b91507f91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e260010282604051808360001916600019168152602001826000191660001916815260200192505050604051809103902092506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166302571be3846000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b15156103c157600080fd5b6102c65a03f115156103d257600080fd5b50505060405180519050905060008473ffffffffffffffffffffffffffffffffffffffff16141580156104eb57506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630178b8bf846000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b15156104a057600080fd5b6102c65a03f115156104b157600080fd5b5050506040518051905073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561071b573073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151561063b576000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166306ab59237f91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e260010284306040518463ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180846000191660001916815260200183600019166000191681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019350505050600060405180830381600087803b151561062357600080fd5b6102c65a03f1151561063457600080fd5b5050503090505b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631896f70a84866040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083600019166000191681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050600060405180830381600087803b151561070657600080fd5b6102c65a03f1151561071757600080fd5b5050505b8473ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515610863576000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166306ab59237f91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e260010284886040518463ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180846000191660001916815260200183600019166000191681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019350505050600060405180830381600087803b151561084e57600080fd5b6102c65a03f1151561085f57600080fd5b5050505b829250505092915050565b600061087b8260006102be565b9050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60007f91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e26001026108fc83610a80565b60405180836000191660001916815260200182600019166000191681526020019250505060405180910390209050919050565b600061095d30600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166102be565b9050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637737221382846040518363ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180836000191660001916815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610a185780820151818401526020810190506109fd565b50505050905090810190601f168015610a455780820380516001836020036101000a031916815260200191505b509350505050600060405180830381600087803b1515610a6457600080fd5b6102c65a03f11515610a7557600080fd5b505050809050919050565b60007f303132333435363738396162636465660000000000000000000000000000000060285b60018103905081600f85161a815360108404935060018103905081600f85161a815360108404935080610aa6576028600020925050509190505600a165627a7a72305820a8513240f040cd9ded89ca4d0c5bda58536850e642e1d933ad64158ef4c820660029" -reverse_registrar_bytecode_runtime = "606060405260043610610078576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630f5a54661461007d5780631e83409a146100f15780633f15457f14610146578063828eab0e1461019b578063bffbe61c146101f0578063c47f002714610245575b600080fd5b341561008857600080fd5b6100d3600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506102be565b60405180826000191660001916815260200191505060405180910390f35b34156100fc57600080fd5b610128600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061086e565b60405180826000191660001916815260200191505060405180910390f35b341561015157600080fd5b610159610882565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156101a657600080fd5b6101ae6108a7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156101fb57600080fd5b610227600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506108cd565b60405180826000191660001916815260200191505060405180910390f35b341561025057600080fd5b6102a0600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061092f565b60405180826000191660001916815260200191505060405180910390f35b60008060006102cc33610a80565b91507f91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e260010282604051808360001916600019168152602001826000191660001916815260200192505050604051809103902092506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166302571be3846000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b15156103c157600080fd5b6102c65a03f115156103d257600080fd5b50505060405180519050905060008473ffffffffffffffffffffffffffffffffffffffff16141580156104eb57506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630178b8bf846000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b15156104a057600080fd5b6102c65a03f115156104b157600080fd5b5050506040518051905073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561071b573073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151561063b576000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166306ab59237f91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e260010284306040518463ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180846000191660001916815260200183600019166000191681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019350505050600060405180830381600087803b151561062357600080fd5b6102c65a03f1151561063457600080fd5b5050503090505b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631896f70a84866040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083600019166000191681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050600060405180830381600087803b151561070657600080fd5b6102c65a03f1151561071757600080fd5b5050505b8473ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515610863576000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166306ab59237f91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e260010284886040518463ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180846000191660001916815260200183600019166000191681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019350505050600060405180830381600087803b151561084e57600080fd5b6102c65a03f1151561085f57600080fd5b5050505b829250505092915050565b600061087b8260006102be565b9050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60007f91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e26001026108fc83610a80565b60405180836000191660001916815260200182600019166000191681526020019250505060405180910390209050919050565b600061095d30600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166102be565b9050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637737221382846040518363ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180836000191660001916815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610a185780820151818401526020810190506109fd565b50505050905090810190601f168015610a455780820380516001836020036101000a031916815260200191505b509350505050600060405180830381600087803b1515610a6457600080fd5b6102c65a03f11515610a7557600080fd5b505050809050919050565b60007f303132333435363738396162636465660000000000000000000000000000000060285b60018103905081600f85161a815360108404935060018103905081600f85161a815360108404935080610aa6576028600020925050509190505600a165627a7a72305820a8513240f040cd9ded89ca4d0c5bda58536850e642e1d933ad64158ef4c820660029" - -reverse_resolver_abi = json.loads('[{"constant":true,"inputs":[],"name":"ens","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"node","type":"bytes32"},{"name":"_name","type":"string"}],"name":"setName","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"ensAddr","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"}]') -reverse_resolver_bytecode = "6060604052341561000f57600080fd5b6040516020806106c9833981016040528080519060200190919050506000816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166302571be37f91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e26001026000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b151561013057600080fd5b6102c65a03f1151561014157600080fd5b50505060405180519050905060008173ffffffffffffffffffffffffffffffffffffffff1614151561022d578073ffffffffffffffffffffffffffffffffffffffff16631e83409a336000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561021057600080fd5b6102c65a03f1151561022157600080fd5b50505060405180519050505b505061048b8061023e6000396000f300606060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680633f15457f1461005c578063691f3431146100b15780637737221314610151575b600080fd5b341561006757600080fd5b61006f6101bb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156100bc57600080fd5b6100d66004808035600019169060200190919050506101e0565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101165780820151818401526020810190506100fb565b50505050905090810190601f1680156101435780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561015c57600080fd5b6101b960048080356000191690602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050610290565b005b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60016020528060005260406000206000915090508054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156102885780601f1061025d57610100808354040283529160200191610288565b820191906000526020600020905b81548152906001019060200180831161026b57829003601f168201915b505050505081565b816000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166302571be3826000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b151561033157600080fd5b6102c65a03f1151561034257600080fd5b5050506040518051905073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561038557600080fd5b8160016000856000191660001916815260200190815260200160002090805190602001906103b49291906103ba565b50505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106103fb57805160ff1916838001178555610429565b82800160010185558215610429579182015b8281111561042857825182559160200191906001019061040d565b5b509050610436919061043a565b5090565b61045c91905b80821115610458576000816000905550600101610440565b5090565b905600a165627a7a72305820f4c4cb4d191f31a62c4de12f7aecf9b258ba17f3a6ee294191171f7d30c04ab00029" -reverse_resolver_bytecode_runtime = "606060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680633f15457f1461005c578063691f3431146100b15780637737221314610151575b600080fd5b341561006757600080fd5b61006f6101bb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156100bc57600080fd5b6100d66004808035600019169060200190919050506101e0565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101165780820151818401526020810190506100fb565b50505050905090810190601f1680156101435780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561015c57600080fd5b6101b960048080356000191690602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050610290565b005b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60016020528060005260406000206000915090508054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156102885780601f1061025d57610100808354040283529160200191610288565b820191906000526020600020905b81548152906001019060200180831161026b57829003601f168201915b505050505081565b816000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166302571be3826000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b151561033157600080fd5b6102c65a03f1151561034257600080fd5b5050506040518051905073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561038557600080fd5b8160016000856000191660001916815260200190815260200160002090805190602001906103b49291906103ba565b50505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106103fb57805160ff1916838001178555610429565b82800160010185558215610429579182015b8281111561042857825182559160200191906001019061040d565b5b509050610436919061043a565b5090565b61045c91905b80821115610458576000816000905550600101610440565b5090565b905600a165627a7a72305820f4c4cb4d191f31a62c4de12f7aecf9b258ba17f3a6ee294191171f7d30c04ab00029" diff --git a/web3s/ens/exceptions.py b/web3s/ens/exceptions.py deleted file mode 100644 index 913c83f..0000000 --- a/web3s/ens/exceptions.py +++ /dev/null @@ -1,79 +0,0 @@ -import idna - - -class AddressMismatch(ValueError): - ''' - In order to set up reverse resolution correctly, the ENS name should first - point to the address. This exception is raised if the name does - not currently point to the address. - ''' - pass - - -class InvalidName(idna.IDNAError): - ''' - This exception is raised if the provided name does not meet - the syntax standards specified in `EIP 137 name syntax - `_. - - For example: names may not start with a dot, or include a space. - ''' - pass - - -class UnauthorizedError(Exception): - ''' - Raised if the sending account is not the owner of the name - you are trying to modify. Make sure to set ``from`` in the - ``transact`` keyword argument to the owner of the name. - ''' - pass - - -class UnownedName(Exception): - ''' - Raised if you are trying to modify a name that no one owns. - - If working on a subdomain, make sure the subdomain gets created - first with :meth:`~ens.main.ENS.setup_address`. - ''' - pass - - -class BidTooLow(ValueError): - ''' - Raised if you bid less than the minimum amount - ''' - pass - - -class InvalidBidHash(ValueError): - ''' - Raised if you supply incorrect data to generate the bid hash. - ''' - pass - - -class InvalidLabel(ValueError): - ''' - Raised if you supply an invalid label - ''' - pass - - -class OversizeTransaction(ValueError): - ''' - Raised if a transaction you are trying to create would cost so - much gas that it could not fit in a block. - - For example: when you try to start too many auctions at once. - ''' - pass - - -class UnderfundedBid(ValueError): - ''' - Raised if you send less wei with your bid than you declared - as your intent to bid. - ''' - pass diff --git a/web3s/ens/main.py b/web3s/ens/main.py deleted file mode 100644 index 6ce6ef3..0000000 --- a/web3s/ens/main.py +++ /dev/null @@ -1,317 +0,0 @@ - -from eth_utils import ( - is_binary_address, - is_checksum_address, - to_checksum_address, -) - -from web3s.ens import abis -from web3s.ens.constants import ( - EMPTY_ADDR_HEX, - REVERSE_REGISTRAR_DOMAIN, -) -from web3s.ens.exceptions import ( - AddressMismatch, - UnauthorizedError, - UnownedName, -) -from web3s.ens.utils import ( - address_in, - address_to_reverse_domain, - default, - dict_copy, - dot_eth_name, - dot_eth_namehash, - init_web3, - is_valid_name, - label_to_hash, - name_to_hash, - normalize_name, -) - -ENS_MAINNET_ADDR = '0x314159265dD8dbb310642f98f50C066173C1259b' - - -class ENS: - ''' - Quick access to common Ethereum Name Service functions, - like getting the address for a name. - - Unless otherwise specified, all addresses are assumed to be a `str` in - `checksum format `_, - like: ``"0x314159265dD8dbb310642f98f50C066173C1259b"`` - ''' - - labelhash = staticmethod(label_to_hash) - namehash = staticmethod(dot_eth_namehash) - nameprep = staticmethod(normalize_name) - is_valid_name = staticmethod(is_valid_name) - reverse_domain = staticmethod(address_to_reverse_domain) - - def __init__(self, providers=default, addr=None): - ''' - :param providers: a list or single provider used to connect to Ethereum - :type providers: instance of `web3.providers.base.BaseProvider` - :param hex-string addr: the address of the ENS registry on-chain. If not provided, - ENS.py will default to the mainnet ENS registry address. - ''' - self.web3s = init_web3(providers) - - ens_addr = addr if addr else ENS_MAINNET_ADDR - self.ens = self.web3s.eth.contract(abi=abis.ENS, address=ens_addr) - self._resolverContract = self.web3s.eth.contract(abi=abis.RESOLVER) - - @classmethod - def fromWeb3(cls, web3s, addr=None): - ''' - Generate an ENS instance with web3 - - :param `web3.Web3` web3: to infer connection information - :param hex-string addr: the address of the ENS registry on-chain. If not provided, - ENS.py will default to the mainnet ENS registry address. - ''' - return cls(web3s.manager.providers, addr=addr) - - def address(self, name, guess_tld=True): - ''' - Look up the Ethereum address that `name` currently points to. - - :param str name: an ENS name to look up - :param bool guess_tld: should `name` be appended with '.eth' if no common TLD found? - :raises InvalidName: if `name` has invalid syntax - ''' - if guess_tld: - expanded = dot_eth_name(name) - else: - expanded = name - return self.resolve(expanded, 'addr') - - def name(self, address): - ''' - Look up the name that the address points to, using a - reverse lookup. Reverse lookup is opt-in for name owners. - - :param address: - :type address: hex-string - ''' - reversed_domain = address_to_reverse_domain(address) - return self.resolve(reversed_domain, get='name') - reverse = name - - @dict_copy - def setup_address(self, name, address=default, transact={}): - ''' - Set up the name to point to the supplied address. - The sender of the transaction must own the name, or - its parent name. - - Example: If the caller owns ``parentname.eth`` with no subdomains - and calls this method with ``sub.parentname.eth``, - then ``sub`` will be created as part of this call. - - :param str name: ENS name to set up, in checksum format - :param str address: name will point to this address. If ``None``, erase the record. - If not specified, name will point to the owner's address. - :param dict transact: the transaction configuration, like in - :meth:`~web3.eth.Eth.sendTransaction` - :raises InvalidName: if ``name`` has invalid syntax - :raises UnauthorizedError: if ``'from'`` in `transact` does not own `name` - ''' - owner = self.setup_owner(name, transact=transact) - self._assert_control(owner, name) - if not address or address == EMPTY_ADDR_HEX: - address = None - elif address is default: - address = owner - elif is_binary_address(address): - address = to_checksum_address(address) - elif not is_checksum_address(address): - raise ValueError("You must supply the address in checksum format") - if self.address(name) == address: - return None - if address is None: - address = EMPTY_ADDR_HEX - transact['from'] = owner - resolver = self._set_resolver(name, transact=transact) - return resolver.setAddr(dot_eth_namehash(name), address, transact=transact) - - @dict_copy - def setup_name(self, name, address=None, transact={}): - ''' - Set up the address for reverse lookup, aka "caller ID". - After successful setup, the method :meth:`~ens.main.ENS.name` will return - `name` when supplied with `address`. - - :param str name: ENS name that address will point to - :param str address: to set up, in checksum format - :param dict transact: the transaction configuration, like in - :meth:`~web3.eth.sendTransaction` - :raises AddressMismatch: if the name does not already point to the address - :raises InvalidName: if `name` has invalid syntax - :raises UnauthorizedError: if ``'from'`` in `transact` does not own `name` - :raises UnownedName: if no one owns `name` - ''' - if not name: - self._assert_control(address, 'the reverse record') - return self._setup_reverse(None, address, transact=transact) - else: - resolved = self.address(name) - if not address: - address = resolved - elif resolved and address != resolved: - raise AddressMismatch( - "Could not set address %r to point to name, because the name resolves to %r. " - "To change the name for an existing address, call setup_address() first." % ( - address, resolved - ) - ) - if not address: - address = self.owner(name) - if not address: - raise UnownedName("claim subdomain using setup_address() first") - if is_binary_address(address): - address = to_checksum_address(address) - if not is_checksum_address(address): - raise ValueError("You must supply the address in checksum format") - self._assert_control(address, name) - if not resolved: - self.setup_address(name, address, transact=transact) - return self._setup_reverse(name, address, transact=transact) - - def resolve(self, name, get='addr'): - normal_name = normalize_name(name) - resolver = self.resolver(normal_name) - if resolver: - lookup_function = getattr(resolver, get) - namehash = name_to_hash(normal_name) - return lookup_function(namehash) - else: - return None - - def resolver(self, normal_name): - resolver_addr = self.ens.resolver(name_to_hash(normal_name)) - if not resolver_addr: - return None - return self._resolverContract(address=resolver_addr) - - def reverser(self, target_address): - reversed_domain = address_to_reverse_domain(target_address) - return self.resolver(reversed_domain) - - def owner(self, name): - ''' - Get the owner of a name. Note that this may be different from the - deed holder in the '.eth' registrar. Learn more about the difference - between deed and name ownership in the ENS `Managing Ownership docs - `_ - - :param str name: ENS name to look up - :return: owner address - :rtype: str - ''' - node = dot_eth_namehash(name) - return self.ens.owner(node) - - @dict_copy - def setup_owner(self, name, new_owner=default, transact={}): - ''' - Set the owner of the supplied name to `new_owner`. - - For typical scenarios, you'll never need to call this method directly, - simply call :meth:`setup_name` or :meth:`setup_address`. This method does *not* - set up the name to point to an address. - - If `new_owner` is not supplied, then this will assume you - want the same owner as the parent domain. - - If the caller owns ``parentname.eth`` with no subdomains - and calls this method with ``sub.parentname.eth``, - then ``sub`` will be created as part of this call. - - :param str name: ENS name to set up - :param new_owner: account that will own `name`. If ``None``, set owner to empty addr. - If not specified, name will point to the parent domain owner's address. - :param dict transact: the transaction configuration, like in - :meth:`~web3.eth.Eth.sendTransaction` - :raises InvalidName: if `name` has invalid syntax - :raises UnauthorizedError: if ``'from'`` in `transact` does not own `name` - :returns: the new owner's address - ''' - (super_owner, unowned, owned) = self._first_owner(name) - if new_owner is default: - new_owner = super_owner - elif not new_owner: - new_owner = EMPTY_ADDR_HEX - else: - new_owner = to_checksum_address(new_owner) - current_owner = self.owner(name) - if new_owner == EMPTY_ADDR_HEX and not current_owner: - return None - elif current_owner == new_owner: - return current_owner - else: - self._assert_control(super_owner, name, owned) - self._claim_ownership(new_owner, unowned, owned, super_owner, transact=transact) - return new_owner - - def _assert_control(self, account, name, parent_owned=None): - if not address_in(account, self.web3s.eth.accounts): - raise UnauthorizedError( - "in order to modify %r, you must control account %r, which owns %r" % ( - name, account, parent_owned or name - ) - ) - - def _first_owner(self, name): - ''' - Takes a name, and returns the owner of the deepest subdomain that has an owner - - :returns: (owner or None, list(unowned_subdomain_labels), first_owned_domain) - ''' - owner = None - unowned = [] - pieces = dot_eth_name(name).split('.') - while pieces and not owner: - name = '.'.join(pieces) - owner = self.owner(name) - if not owner: - unowned.append(pieces.pop(0)) - return (owner, unowned, name) - - @dict_copy - def _claim_ownership(self, owner, unowned, owned, old_owner=None, transact={}): - transact['from'] = old_owner or owner - for label in reversed(unowned): - self.ens.setSubnodeOwner( - dot_eth_namehash(owned), - label_to_hash(label), - owner, - transact=transact - ) - owned = "%s.%s" % (label, owned) - - @dict_copy - def _set_resolver(self, name, resolver_addr=None, transact={}): - if not resolver_addr: - resolver_addr = self.address('resolver.eth') - namehash = dot_eth_namehash(name) - if self.ens.resolver(namehash) != resolver_addr: - self.ens.setResolver( - namehash, - resolver_addr, - transact=transact - ) - return self._resolverContract(address=resolver_addr) - - @dict_copy - def _setup_reverse(self, name, address, transact={}): - if name: - name = dot_eth_name(name) - else: - name = '' - transact['from'] = address - return self._reverse_registrar().setName(name, transact=transact) - - def _reverse_registrar(self): - addr = self.ens.owner(name_to_hash(REVERSE_REGISTRAR_DOMAIN)) - return self.web3s.eth.contract(address=addr, abi=abis.REVERSE_REGISTRAR) diff --git a/web3s/ens/registrar.py b/web3s/ens/registrar.py deleted file mode 100644 index 77d0221..0000000 --- a/web3s/ens/registrar.py +++ /dev/null @@ -1,237 +0,0 @@ - -from collections import namedtuple -from datetime import datetime -from enum import IntEnum - -import pytz -from web3s import Web3s - -from web3s.ens import abis - -REGISTRAR_NAME = 'eth' - -GAS_DEFAULT = { - 'bid': 500000, - 'reveal': 150000, - 'finalize': 120000, - } - -START_GAS_CONSTANT = 25000 -START_GAS_MARGINAL = 39000 - -MIN_BID = Web3s.toWei('0.01', 'ether') -MIN_NAME_LENGTH = 7 - -AuctionEntries = namedtuple('AuctionEntries', 'status, deed, close_at, deposit, top_bid') - - -class Status(IntEnum): - ''' - Current status of the auction for a label. For more info: - http://docs.ens.domains/en/latest/userguide.html#starting-an-auction - - Names taken from Solidity contract, but modified so they are gramatically parallel - ''' - Open = 0 - Auctioning = 1 # original name was 'Auction' in HashRegistrarSimplified contract - Owned = 2 - Forbidden = 3 - Revealing = 4 # original name was 'Reveal' in HashRegistrarSimplified contract - NotYetAvailable = 5 - - -class Registrar: - """ - Terminology: - Name: a fully qualified ENS name, for example: 'tickets.eth' - Label: a label that the registrar auctions, for example: 'tickets' - - The registrar does not directly manage subdomains multiple layers down, like: 'fotc.tickets.eth' - """ - - def __init__(self, ens): - self.ens = ens - self.web3 = ens.web3 - self._coreContract = self.web3s.eth.contract(abi=abis.AUCTION_REGISTRAR) - # delay generating this contract so that this class can be created before web3 is online - self._core = None - self._deedContract = self.web3s.eth.contract(abi=abis.DEED) - self._short_invalid = True - - def entries(self, label): - label = self._to_label(label) - label_hash = self.ens.labelhash(label) - return self.entries_by_hash(label_hash) - - def start(self, labels, **modifier_dict): - if not labels: - return - if isinstance(labels, (str, bytes)): - labels = [labels] - if not modifier_dict: - modifier_dict = {'transact': {}} - if 'transact' in modifier_dict: - transact_dict = modifier_dict['transact'] - if 'gas' not in transact_dict: - transact_dict['gas'] = self._estimate_start_gas(labels) - if transact_dict['gas'] > self._last_gaslimit(): - raise ValueError('There are too many auctions to fit in a block -- start fewer.') - labels = [self._to_label(label) for label in labels] - label_hashes = [self.ens.labelhash(label) for label in labels] - return self.core.startAuctions(label_hashes, **modifier_dict) - - def bid(self, label, amount, secret, **modifier_dict): - """ - @param label to bid on - @param amount (in wei) to bid - @param secret - as bytes, str, or int. You MUST keep a copy - of this to avoid burning your entire deposit! - """ - if not modifier_dict: - modifier_dict = {'transact': {}} - if 'transact' in modifier_dict: - transact = modifier_dict['transact'] - self.__default_gas(transact, 'bid') - if 'value' not in transact: - transact['value'] = amount - elif transact['value'] < amount: - raise UnderfundedBid("Bid of %s ETH was only funded with %s ETH" % ( - Web3.fromWei(amount, 'ether'), - Web3.fromWei(transact['value'], 'ether'))) - label = self._to_label(label) - sender = self.__require_sender(modifier_dict) - if amount < MIN_BID: - raise BidTooLow("You must bid at least %s ether" % Web3.fromWei(MIN_BID, 'ether')) - bid_hash = self._bid_hash(label, sender, amount, secret) - return self.core.newBid(bid_hash, **modifier_dict) - - def reveal(self, label, amount, secret, **modifier_dict): - if not modifier_dict: - modifier_dict = {'transact': {}} - if 'transact' in modifier_dict: - self.__default_gas(modifier_dict['transact'], 'reveal') - sender = self.__require_sender(modifier_dict) - label = self._to_label(label) - bid_hash = self._bid_hash(label, sender, amount, secret) - if not self.core.sealedBids(sender, bid_hash): - raise InvalidBidHash - label_hash = self.ens.labelhash(label) - secret_hash = self._secret_hash(secret) - return self.core.unsealBid(label_hash, amount, secret_hash, **modifier_dict) - unseal = reveal - - def finalize(self, label, **modifier_dict): - if not modifier_dict: - modifier_dict = {'transact': {}} - if 'transact' in modifier_dict: - self.__default_gas(modifier_dict['transact'], 'finalize') - label = self._to_label(label) - label_hash = self.ens.labelhash(label) - return self.core.finalizeAuction(label_hash, **modifier_dict) - - def entries_by_hash(self, label_hash): - ''' - @returns a 5-item collection in this order: - # Status - # deed contract - # registration datetime (in UTC) - # value held on deposit - # value of largest bid - ''' - assert isinstance(label_hash, (bytes, bytearray)) - entries = self.core.entries(label_hash) - return AuctionEntries( - Status(entries[0]), - self._deedContract(entries[1]) if entries[1] else None, - datetime.fromtimestamp(entries[2], pytz.utc) if entries[2] else None, - entries[3], - entries[4], - ) - - @property - def core(self): - if not self._core: - self._core = self._coreContract(address=self.ens.owner(REGISTRAR_NAME)) - return self._core - - def __default_gas(self, transact_dict, action): - if 'gas' not in transact_dict: - transact_dict['gas'] = GAS_DEFAULT[action] - - def _estimate_start_gas(self, labels): - return START_GAS_CONSTANT + START_GAS_MARGINAL * len(labels) - - def __require_sender(self, modifier_dict): - modifier_vals = modifier_dict[list(modifier_dict).pop()] - if 'from' not in modifier_vals: - raise TypeError("You must specify the sending account") - return modifier_vals['from'] - - def _last_gaslimit(self): - last_block = self.web3.eth.getBlock('latest') - return last_block.gasLimit - - def _bid_hash(self, label, bidder, bid_amount, secret): - label_hash = self.ens.labelhash(label) - secret_hash = self._secret_hash(secret) - bid_hash = self.core.shaBid(label_hash, bidder, bid_amount, secret_hash) - # deal with web3.py returning a string instead of bytes: - if isinstance(bid_hash, str): - bid_hash = bytes(bid_hash, encoding='latin-1') - return bid_hash - - @staticmethod - def _secret_hash(secret): - if isinstance(secret, str): - secret = secret.encode() - secret_hash = Web3.sha3(secret) - return Web3.toBytes(hexstr=secret_hash) - - def _to_label(self, name): - ''' - Convert from a name, like 'ethfinex.eth', to a label, like 'ethfinex' - If name is already a label, this should be a noop, except for converting to a string - ''' - if isinstance(name, (bytes, bytearray)): - name = name.decode() - name = self.ens.nameprep(name) - if '.' not in name: - label = name - else: - pieces = name.split('.') - if len(pieces) != 2: - raise ValueError( - "You must specify a label, like 'tickets' " - "or a fully-qualified name, like 'tickets.eth'") - if pieces[-1] != REGISTRAR_NAME: - raise ValueError("This interface only manages names under .%s " % REGISTRAR_NAME) - label = pieces[-2] - if self._short_invalid and len(label) < MIN_NAME_LENGTH: - raise InvalidLabel('name %r is too shart' % label) - return label - - def __entry_lookup(self, label, entry_attr): - entries = self.entries(label) - return getattr(entries, entry_attr) - - def __getattr__(self, attr): - if attr in AuctionEntries._fields: - return lambda label: self.__entry_lookup(label, attr) - else: - raise AttributeError - - -class BidTooLow(ValueError): - pass - - -class InvalidBidHash(ValueError): - pass - - -class InvalidLabel(ValueError): - pass - - -class UnderfundedBid(ValueError): - pass diff --git a/web3s/ens/utils.py b/web3s/ens/utils.py deleted file mode 100644 index 41a8a63..0000000 --- a/web3s/ens/utils.py +++ /dev/null @@ -1,228 +0,0 @@ - -import copy -import datetime -import functools - -from eth_utils import ( - is_same_address, - remove_0x_prefix, - to_normalized_address, -) -import idna - -from web3s.ens.constants import ( - ACCEPTABLE_STALE_HOURS, - AUCTION_START_GAS_CONSTANT, - AUCTION_START_GAS_MARGINAL, - EMPTY_SHA3_BYTES, - MIN_ETH_LABEL_LENGTH, - RECOGNIZED_TLDS, - REVERSE_REGISTRAR_DOMAIN, -) -from web3s.ens.exceptions import ( - InvalidLabel, - InvalidName, -) - -default = object() - - -def Web3s(): - from web3s import Web3s - return Web3s - - -def dict_copy(func): - "copy dict keyword args, to avoid modifying caller's copy" - @functools.wraps(func) - def wrapper(*args, **kwargs): - copied_kwargs = copy.deepcopy(kwargs) - return func(*args, **copied_kwargs) - return wrapper - - -def ensure_hex(data): - if not isinstance(data, str): - return Web3s().toHex(data) - return data - - -def init_web3(providers=default): - from web3s import Web3s - - if providers is default: - w3 = Web3s(ens=None) - else: - w3 = Web3s(providers, ens=None) - - return customize_web3(w3) - - -def customize_web3(w3): - from web3s.contract import ConciseContract - from web3s.middleware import make_stalecheck_middleware - - w3.middleware_stack.remove('name_to_address') - w3.middleware_stack.add( - make_stalecheck_middleware(ACCEPTABLE_STALE_HOURS * 3600), - name='stalecheck', - ) - w3.eth.setContractFactory(ConciseContract) - return w3 - - -def normalize_name(name): - ''' - Clean the fully qualified name, as defined in ENS `EIP-137 - `_ - - This does *not* enforce whether ``name`` is a label or fully qualified domain. - - :param str name: the dot-separated ENS name - :raises InvalidName: if ``name`` has invalid syntax - ''' - if not name: - return name - elif isinstance(name, (bytes, bytearray)): - name = name.decode('utf-8') - try: - return idna.decode(name, uts46=True, std3_rules=True) - except idna.IDNAError as exc: - raise InvalidName("%s is an invalid name, because %s" % (name, exc)) from exc - - -def is_valid_name(name): - ''' - Validate whether the fully qualified name is valid, as defined in ENS `EIP-137 - `_ - - :param str name: the dot-separated ENS name - :returns: True if ``name`` is set, and :meth:`~ens.main.ENS.nameprep` will not raise InvalidName - ''' - if not name: - return False - try: - normalize_name(name) - return True - except InvalidName: - return False - - -def label_to_name(label, default_tld, recognized_tlds): - label = normalize_name(label) - pieces = label.split('.') - if pieces[-1] not in recognized_tlds: - pieces.append(default_tld) - return '.'.join(pieces) - - -def dot_eth_name(label): - return label_to_name(label, 'eth', RECOGNIZED_TLDS) - - -def name_to_label(name, registrar): - name = normalize_name(name) - if '.' not in name: - label = name - else: - name_pieces = name.split('.') - registrar_pieces = registrar.split('.') - if len(name_pieces) != len(registrar_pieces) + 1: - raise ValueError( - "You must specify a label, like 'tickets' " - "or a fully-qualified name, like 'tickets.%s'" % registrar - ) - label, *label_registrar = name_pieces - if label_registrar != registrar_pieces: - raise ValueError("This interface only manages names under .%s " % registrar) - return label - - -def dot_eth_label(name): - ''' - Convert from a name, like 'ethfinex.eth', to a label, like 'ethfinex' - If name is already a label, this should be a noop, except for converting to a string - and validating the name syntax. - ''' - label = name_to_label(name, registrar='eth') - if len(label) < MIN_ETH_LABEL_LENGTH: - raise InvalidLabel('name %r is too short' % label) - else: - return label - - -def to_utc_datetime(timestamp): - if timestamp: - return datetime.datetime.fromtimestamp(timestamp, datetime.timezone.utc) - else: - return None - - -def sha3_text(val): - if isinstance(val, str): - val = val.encode('utf-8') - return Web3().sha3(val) - - -def label_to_hash(label): - label = normalize_name(label) - if '.' in label: - raise ValueError("Cannot generate hash for label %r with a '.'" % label) - return Web3().sha3(text=label) - - -def name_to_hash(name): - node = EMPTY_SHA3_BYTES - if name: - labels = name.split(".") - for label in reversed(labels): - labelhash = label_to_hash(label) - assert isinstance(labelhash, bytes) - assert isinstance(node, bytes) - node = Web3().sha3(node + labelhash) - return node - - -def dot_eth_namehash(name): - ''' - Generate the namehash. This is also known as the ``node`` in ENS contracts. - - In normal operation, generating the namehash is handled - behind the scenes. For advanced usage, it is a helpful utility. - - This will add '.eth' to name if no TLD given. Also, it normalizes the name with - `nameprep - `_ - before hashing. - - :param str name: ENS name to hash - :return: the namehash - :rtype: bytes - :raises InvalidName: if ``name`` has invalid syntax - ''' - expanded_name = dot_eth_name(name) - return name_to_hash(expanded_name) - - -def address_in(address, addresses): - return any(is_same_address(address, item) for item in addresses) - - -def address_to_reverse_domain(address): - lower_unprefixed_address = remove_0x_prefix(to_normalized_address(address)) - return lower_unprefixed_address + '.' + REVERSE_REGISTRAR_DOMAIN - - -def estimate_auction_start_gas(labels): - return AUCTION_START_GAS_CONSTANT + AUCTION_START_GAS_MARGINAL * len(labels) - - -def assert_signer_in_modifier_kwargs(modifier_kwargs): - ERR_MSG = "You must specify the sending account" - assert len(modifier_kwargs) == 1, ERR_MSG - - _modifier_type, modifier_dict = dict(modifier_kwargs).popitem() - if 'from' not in modifier_dict: - raise TypeError(ERR_MSG) - - return modifier_dict['from'] diff --git a/web3s/gas_strategies/__pycache__/__init__.cpython-36.pyc b/web3s/gas_strategies/__pycache__/__init__.cpython-36.pyc deleted file mode 100644 index 2e6c595..0000000 Binary files a/web3s/gas_strategies/__pycache__/__init__.cpython-36.pyc and /dev/null differ diff --git a/web3s/gas_strategies/__pycache__/__init__.cpython-37.pyc b/web3s/gas_strategies/__pycache__/__init__.cpython-37.pyc deleted file mode 100644 index ec25cfd..0000000 Binary files a/web3s/gas_strategies/__pycache__/__init__.cpython-37.pyc and /dev/null differ diff --git a/web3s/gas_strategies/__pycache__/rpc.cpython-36.pyc b/web3s/gas_strategies/__pycache__/rpc.cpython-36.pyc deleted file mode 100644 index c4db60f..0000000 Binary files a/web3s/gas_strategies/__pycache__/rpc.cpython-36.pyc and /dev/null differ diff --git a/web3s/gas_strategies/__pycache__/rpc.cpython-37.pyc b/web3s/gas_strategies/__pycache__/rpc.cpython-37.pyc deleted file mode 100644 index a06afe4..0000000 Binary files a/web3s/gas_strategies/__pycache__/rpc.cpython-37.pyc and /dev/null differ diff --git a/web3s/gas_strategies/__pycache__/time_based.cpython-36.pyc b/web3s/gas_strategies/__pycache__/time_based.cpython-36.pyc deleted file mode 100644 index 51b348a..0000000 Binary files a/web3s/gas_strategies/__pycache__/time_based.cpython-36.pyc and /dev/null differ diff --git a/web3s/gas_strategies/__pycache__/time_based.cpython-37.pyc b/web3s/gas_strategies/__pycache__/time_based.cpython-37.pyc deleted file mode 100644 index a187398..0000000 Binary files a/web3s/gas_strategies/__pycache__/time_based.cpython-37.pyc and /dev/null differ diff --git a/web3s/main.py b/web3s/main.py index 005d3f6..51c2da7 100644 --- a/web3s/main.py +++ b/web3s/main.py @@ -10,7 +10,7 @@ to_wei, ) -from web3s.ens import ENS + from web3s.admin import Admin from web3s.eth import Eth @@ -55,9 +55,8 @@ to_hex, to_text, ) -from web3s.utils.normalizers import ( - abi_ens_resolver, -) + + from web3s.utils.decorators import async_apply_to_return_value @@ -106,7 +105,7 @@ class Web3s: toChecksumAddress = staticmethod(to_checksum_address) - def __init__(self, providers=empty, middlewares=None, modules=None, ens=empty): + def __init__(self, providers=empty, middlewares=None, modules=None): self.manager = RequestManager(self, providers, middlewares) if modules is None: @@ -115,7 +114,7 @@ def __init__(self, providers=empty, middlewares=None, modules=None, ens=empty): for module_name, module_class in modules.items(): module_class.attach(self, module_name) - self.ens = ens + self.contracts={} @property @@ -146,31 +145,6 @@ def sha3(primitive=None, text=None, hexstr=None): ) ) - @combomethod - def soliditySha3(cls, abi_types, values): - """ - Executes sha3 (keccak256) exactly as Solidity does. - Takes list of abi_types as inputs -- `[uint24, int8[], bool]` - and list of corresponding values -- `[20, [-1, 5, 0], True]` - """ - if len(abi_types) != len(values): - raise ValueError( - "Length mismatch between provided abi types and values. Got " - "{0} types and {1} values.".format(len(abi_types), len(values)) - ) - - if isinstance(cls, type): - w3 = None - else: - w3 = cls - normalized_values = map_abi_data([abi_ens_resolver(w3)], abi_types, values) - - hex_string = add_0x_prefix(''.join( - remove_0x_prefix(hex_encode_abi_type(abi_type, value)) - for abi_type, value - in zip(abi_types, normalized_values) - )) - return cls.sha3(hexstr=hex_string) async def isConnected(self): for provider in self.providers: @@ -179,13 +153,4 @@ async def isConnected(self): else: return False - @property - def ens(self): - if self._ens is empty: - return ENS.fromWeb3(self) - else: - return self._ens - @ens.setter - def ens(self, new_ens): - self._ens = new_ens diff --git a/web3s/manager.py b/web3s/manager.py index 4f31334..bf24196 100644 --- a/web3s/manager.py +++ b/web3s/manager.py @@ -16,7 +16,7 @@ abi_middleware, attrdict_middleware, gas_price_strategy_middleware, - name_to_address_middleware, + normalize_errors_middleware, pythonic_middleware, request_parameter_normalizer, @@ -64,12 +64,11 @@ def providers(self, value): def default_middlewares(web3): ''' List the default middlewares for the request manager. - Leaving ens unspecified will prevent the middleware from resolving names. ''' return [ (request_parameter_normalizer, 'request_param_normalizer'), (gas_price_strategy_middleware, 'gas_price_strategy'), - (name_to_address_middleware(web3), 'name_to_address'), + (attrdict_middleware, 'attrdict'), (pythonic_middleware, 'pythonic'), (normalize_errors_middleware, 'normalize_errors'), diff --git a/web3s/middleware/__init__.py b/web3s/middleware/__init__.py index e6b609a..41200f8 100644 --- a/web3s/middleware/__init__.py +++ b/web3s/middleware/__init__.py @@ -28,9 +28,8 @@ from .gas_price_strategy import ( # noqa: F401 gas_price_strategy_middleware, ) -from .names import ( # noqa: F401 - name_to_address_middleware, -) + + from .normalize_errors import ( # noqa: F401 normalize_errors_middleware, ) diff --git a/web3s/middleware/__pycache__/__init__.cpython-36.pyc b/web3s/middleware/__pycache__/__init__.cpython-36.pyc deleted file mode 100644 index 150f6b3..0000000 Binary files a/web3s/middleware/__pycache__/__init__.cpython-36.pyc and /dev/null differ diff --git a/web3s/middleware/__pycache__/__init__.cpython-37.pyc b/web3s/middleware/__pycache__/__init__.cpython-37.pyc deleted file mode 100644 index c866903..0000000 Binary files a/web3s/middleware/__pycache__/__init__.cpython-37.pyc and /dev/null differ diff --git a/web3s/middleware/__pycache__/abi.cpython-36.pyc b/web3s/middleware/__pycache__/abi.cpython-36.pyc deleted file mode 100644 index 61c1429..0000000 Binary files a/web3s/middleware/__pycache__/abi.cpython-36.pyc and /dev/null differ diff --git a/web3s/middleware/__pycache__/abi.cpython-37.pyc b/web3s/middleware/__pycache__/abi.cpython-37.pyc deleted file mode 100644 index 2fc18c7..0000000 Binary files a/web3s/middleware/__pycache__/abi.cpython-37.pyc and /dev/null differ diff --git a/web3s/middleware/__pycache__/attrdict.cpython-36.pyc b/web3s/middleware/__pycache__/attrdict.cpython-36.pyc deleted file mode 100644 index 4c9f019..0000000 Binary files a/web3s/middleware/__pycache__/attrdict.cpython-36.pyc and /dev/null differ diff --git a/web3s/middleware/__pycache__/attrdict.cpython-37.pyc b/web3s/middleware/__pycache__/attrdict.cpython-37.pyc deleted file mode 100644 index f68ea0d..0000000 Binary files a/web3s/middleware/__pycache__/attrdict.cpython-37.pyc and /dev/null differ diff --git a/web3s/middleware/__pycache__/cache.cpython-36.pyc b/web3s/middleware/__pycache__/cache.cpython-36.pyc deleted file mode 100644 index 1c0e432..0000000 Binary files a/web3s/middleware/__pycache__/cache.cpython-36.pyc and /dev/null differ diff --git a/web3s/middleware/__pycache__/cache.cpython-37.pyc b/web3s/middleware/__pycache__/cache.cpython-37.pyc deleted file mode 100644 index d1de0e7..0000000 Binary files a/web3s/middleware/__pycache__/cache.cpython-37.pyc and /dev/null differ diff --git a/web3s/middleware/__pycache__/exception_handling.cpython-36.pyc b/web3s/middleware/__pycache__/exception_handling.cpython-36.pyc deleted file mode 100644 index a8e9ddd..0000000 Binary files a/web3s/middleware/__pycache__/exception_handling.cpython-36.pyc and /dev/null differ diff --git a/web3s/middleware/__pycache__/exception_handling.cpython-37.pyc b/web3s/middleware/__pycache__/exception_handling.cpython-37.pyc deleted file mode 100644 index 3285fd7..0000000 Binary files a/web3s/middleware/__pycache__/exception_handling.cpython-37.pyc and /dev/null differ diff --git a/web3s/middleware/__pycache__/exception_retry_request.cpython-36.pyc b/web3s/middleware/__pycache__/exception_retry_request.cpython-36.pyc deleted file mode 100644 index 11ee7c9..0000000 Binary files a/web3s/middleware/__pycache__/exception_retry_request.cpython-36.pyc and /dev/null differ diff --git a/web3s/middleware/__pycache__/exception_retry_request.cpython-37.pyc b/web3s/middleware/__pycache__/exception_retry_request.cpython-37.pyc deleted file mode 100644 index b98d489..0000000 Binary files a/web3s/middleware/__pycache__/exception_retry_request.cpython-37.pyc and /dev/null differ diff --git a/web3s/middleware/__pycache__/fixture.cpython-36.pyc b/web3s/middleware/__pycache__/fixture.cpython-36.pyc deleted file mode 100644 index 3145234..0000000 Binary files a/web3s/middleware/__pycache__/fixture.cpython-36.pyc and /dev/null differ diff --git a/web3s/middleware/__pycache__/fixture.cpython-37.pyc b/web3s/middleware/__pycache__/fixture.cpython-37.pyc deleted file mode 100644 index f1e1fbd..0000000 Binary files a/web3s/middleware/__pycache__/fixture.cpython-37.pyc and /dev/null differ diff --git a/web3s/middleware/__pycache__/formatting.cpython-36.pyc b/web3s/middleware/__pycache__/formatting.cpython-36.pyc deleted file mode 100644 index 7e824f4..0000000 Binary files a/web3s/middleware/__pycache__/formatting.cpython-36.pyc and /dev/null differ diff --git a/web3s/middleware/__pycache__/formatting.cpython-37.pyc b/web3s/middleware/__pycache__/formatting.cpython-37.pyc deleted file mode 100644 index 92c7f71..0000000 Binary files a/web3s/middleware/__pycache__/formatting.cpython-37.pyc and /dev/null differ diff --git a/web3s/middleware/__pycache__/gas_price_strategy.cpython-36.pyc b/web3s/middleware/__pycache__/gas_price_strategy.cpython-36.pyc deleted file mode 100644 index 9e66f38..0000000 Binary files a/web3s/middleware/__pycache__/gas_price_strategy.cpython-36.pyc and /dev/null differ diff --git a/web3s/middleware/__pycache__/gas_price_strategy.cpython-37.pyc b/web3s/middleware/__pycache__/gas_price_strategy.cpython-37.pyc deleted file mode 100644 index 70374d7..0000000 Binary files a/web3s/middleware/__pycache__/gas_price_strategy.cpython-37.pyc and /dev/null differ diff --git a/web3s/middleware/__pycache__/geth_poa.cpython-36.pyc b/web3s/middleware/__pycache__/geth_poa.cpython-36.pyc deleted file mode 100644 index b0aad67..0000000 Binary files a/web3s/middleware/__pycache__/geth_poa.cpython-36.pyc and /dev/null differ diff --git a/web3s/middleware/__pycache__/geth_poa.cpython-37.pyc b/web3s/middleware/__pycache__/geth_poa.cpython-37.pyc deleted file mode 100644 index a30585e..0000000 Binary files a/web3s/middleware/__pycache__/geth_poa.cpython-37.pyc and /dev/null differ diff --git a/web3s/middleware/__pycache__/names.cpython-36.pyc b/web3s/middleware/__pycache__/names.cpython-36.pyc deleted file mode 100644 index a06aef0..0000000 Binary files a/web3s/middleware/__pycache__/names.cpython-36.pyc and /dev/null differ diff --git a/web3s/middleware/__pycache__/names.cpython-37.pyc b/web3s/middleware/__pycache__/names.cpython-37.pyc deleted file mode 100644 index eaa66c3..0000000 Binary files a/web3s/middleware/__pycache__/names.cpython-37.pyc and /dev/null differ diff --git a/web3s/middleware/__pycache__/normalize_errors.cpython-36.pyc b/web3s/middleware/__pycache__/normalize_errors.cpython-36.pyc deleted file mode 100644 index ee1789a..0000000 Binary files a/web3s/middleware/__pycache__/normalize_errors.cpython-36.pyc and /dev/null differ diff --git a/web3s/middleware/__pycache__/normalize_errors.cpython-37.pyc b/web3s/middleware/__pycache__/normalize_errors.cpython-37.pyc deleted file mode 100644 index 65bb9ed..0000000 Binary files a/web3s/middleware/__pycache__/normalize_errors.cpython-37.pyc and /dev/null differ diff --git a/web3s/middleware/__pycache__/normalize_request_parameters.cpython-36.pyc b/web3s/middleware/__pycache__/normalize_request_parameters.cpython-36.pyc deleted file mode 100644 index faf836d..0000000 Binary files a/web3s/middleware/__pycache__/normalize_request_parameters.cpython-36.pyc and /dev/null differ diff --git a/web3s/middleware/__pycache__/normalize_request_parameters.cpython-37.pyc b/web3s/middleware/__pycache__/normalize_request_parameters.cpython-37.pyc deleted file mode 100644 index 1bd7a39..0000000 Binary files a/web3s/middleware/__pycache__/normalize_request_parameters.cpython-37.pyc and /dev/null differ diff --git a/web3s/middleware/__pycache__/pythonic.cpython-36.pyc b/web3s/middleware/__pycache__/pythonic.cpython-36.pyc deleted file mode 100644 index 0ae1c59..0000000 Binary files a/web3s/middleware/__pycache__/pythonic.cpython-36.pyc and /dev/null differ diff --git a/web3s/middleware/__pycache__/pythonic.cpython-37.pyc b/web3s/middleware/__pycache__/pythonic.cpython-37.pyc deleted file mode 100644 index e818001..0000000 Binary files a/web3s/middleware/__pycache__/pythonic.cpython-37.pyc and /dev/null differ diff --git a/web3s/middleware/__pycache__/signing.cpython-36.pyc b/web3s/middleware/__pycache__/signing.cpython-36.pyc deleted file mode 100644 index e473d19..0000000 Binary files a/web3s/middleware/__pycache__/signing.cpython-36.pyc and /dev/null differ diff --git a/web3s/middleware/__pycache__/signing.cpython-37.pyc b/web3s/middleware/__pycache__/signing.cpython-37.pyc deleted file mode 100644 index 7106453..0000000 Binary files a/web3s/middleware/__pycache__/signing.cpython-37.pyc and /dev/null differ diff --git a/web3s/middleware/__pycache__/simulate_unmined_transaction.cpython-36.pyc b/web3s/middleware/__pycache__/simulate_unmined_transaction.cpython-36.pyc deleted file mode 100644 index 33ddd8b..0000000 Binary files a/web3s/middleware/__pycache__/simulate_unmined_transaction.cpython-36.pyc and /dev/null differ diff --git a/web3s/middleware/__pycache__/simulate_unmined_transaction.cpython-37.pyc b/web3s/middleware/__pycache__/simulate_unmined_transaction.cpython-37.pyc deleted file mode 100644 index 1a9fb85..0000000 Binary files a/web3s/middleware/__pycache__/simulate_unmined_transaction.cpython-37.pyc and /dev/null differ diff --git a/web3s/middleware/__pycache__/stalecheck.cpython-36.pyc b/web3s/middleware/__pycache__/stalecheck.cpython-36.pyc deleted file mode 100644 index 83077c3..0000000 Binary files a/web3s/middleware/__pycache__/stalecheck.cpython-36.pyc and /dev/null differ diff --git a/web3s/middleware/__pycache__/stalecheck.cpython-37.pyc b/web3s/middleware/__pycache__/stalecheck.cpython-37.pyc deleted file mode 100644 index d1206d3..0000000 Binary files a/web3s/middleware/__pycache__/stalecheck.cpython-37.pyc and /dev/null differ diff --git a/web3s/middleware/__pycache__/validation.cpython-36.pyc b/web3s/middleware/__pycache__/validation.cpython-36.pyc deleted file mode 100644 index 2e4ee4b..0000000 Binary files a/web3s/middleware/__pycache__/validation.cpython-36.pyc and /dev/null differ diff --git a/web3s/middleware/__pycache__/validation.cpython-37.pyc b/web3s/middleware/__pycache__/validation.cpython-37.pyc deleted file mode 100644 index d1bdc47..0000000 Binary files a/web3s/middleware/__pycache__/validation.cpython-37.pyc and /dev/null differ diff --git a/web3s/middleware/names.py b/web3s/middleware/names.py index 04aebf8..818d57b 100644 --- a/web3s/middleware/names.py +++ b/web3s/middleware/names.py @@ -1,6 +1,4 @@ -from web3s.utils.normalizers import ( - abi_ens_resolver, -) + from web3s.utils.rpc_abi import ( RPC_ABIS, abi_request_formatters, @@ -11,10 +9,4 @@ ) -def name_to_address_middleware(w3): - normalizers = [ - abi_ens_resolver(w3), - ] - return construct_formatting_middleware( - request_formatters=abi_request_formatters(normalizers, RPC_ABIS) - ) + diff --git a/web3s/providers/__pycache__/__init__.cpython-36.pyc b/web3s/providers/__pycache__/__init__.cpython-36.pyc deleted file mode 100644 index 5c8c993..0000000 Binary files a/web3s/providers/__pycache__/__init__.cpython-36.pyc and /dev/null differ diff --git a/web3s/providers/__pycache__/__init__.cpython-37.pyc b/web3s/providers/__pycache__/__init__.cpython-37.pyc deleted file mode 100644 index f493af3..0000000 Binary files a/web3s/providers/__pycache__/__init__.cpython-37.pyc and /dev/null differ diff --git a/web3s/providers/__pycache__/base.cpython-36.pyc b/web3s/providers/__pycache__/base.cpython-36.pyc deleted file mode 100644 index 982cd12..0000000 Binary files a/web3s/providers/__pycache__/base.cpython-36.pyc and /dev/null differ diff --git a/web3s/providers/__pycache__/base.cpython-37.pyc b/web3s/providers/__pycache__/base.cpython-37.pyc deleted file mode 100644 index 850f3f6..0000000 Binary files a/web3s/providers/__pycache__/base.cpython-37.pyc and /dev/null differ diff --git a/web3s/providers/__pycache__/rpc.cpython-36.pyc b/web3s/providers/__pycache__/rpc.cpython-36.pyc deleted file mode 100644 index 2aa711b..0000000 Binary files a/web3s/providers/__pycache__/rpc.cpython-36.pyc and /dev/null differ diff --git a/web3s/providers/__pycache__/rpc.cpython-37.pyc b/web3s/providers/__pycache__/rpc.cpython-37.pyc deleted file mode 100644 index a1eb343..0000000 Binary files a/web3s/providers/__pycache__/rpc.cpython-37.pyc and /dev/null differ diff --git a/web3s/providers/__pycache__/tester.cpython-36.pyc b/web3s/providers/__pycache__/tester.cpython-36.pyc deleted file mode 100644 index 1265887..0000000 Binary files a/web3s/providers/__pycache__/tester.cpython-36.pyc and /dev/null differ diff --git a/web3s/providers/__pycache__/tester.cpython-37.pyc b/web3s/providers/__pycache__/tester.cpython-37.pyc deleted file mode 100644 index 3cf36b1..0000000 Binary files a/web3s/providers/__pycache__/tester.cpython-37.pyc and /dev/null differ diff --git a/web3s/providers/eth_tester/__pycache__/__init__.cpython-36.pyc b/web3s/providers/eth_tester/__pycache__/__init__.cpython-36.pyc deleted file mode 100644 index 897269b..0000000 Binary files a/web3s/providers/eth_tester/__pycache__/__init__.cpython-36.pyc and /dev/null differ diff --git a/web3s/providers/eth_tester/__pycache__/__init__.cpython-37.pyc b/web3s/providers/eth_tester/__pycache__/__init__.cpython-37.pyc deleted file mode 100644 index 9f50fd2..0000000 Binary files a/web3s/providers/eth_tester/__pycache__/__init__.cpython-37.pyc and /dev/null differ diff --git a/web3s/providers/eth_tester/__pycache__/defaults.cpython-36.pyc b/web3s/providers/eth_tester/__pycache__/defaults.cpython-36.pyc deleted file mode 100644 index fec602e..0000000 Binary files a/web3s/providers/eth_tester/__pycache__/defaults.cpython-36.pyc and /dev/null differ diff --git a/web3s/providers/eth_tester/__pycache__/defaults.cpython-37.pyc b/web3s/providers/eth_tester/__pycache__/defaults.cpython-37.pyc deleted file mode 100644 index f784cee..0000000 Binary files a/web3s/providers/eth_tester/__pycache__/defaults.cpython-37.pyc and /dev/null differ diff --git a/web3s/providers/eth_tester/__pycache__/main.cpython-36.pyc b/web3s/providers/eth_tester/__pycache__/main.cpython-36.pyc deleted file mode 100644 index d585c9a..0000000 Binary files a/web3s/providers/eth_tester/__pycache__/main.cpython-36.pyc and /dev/null differ diff --git a/web3s/providers/eth_tester/__pycache__/main.cpython-37.pyc b/web3s/providers/eth_tester/__pycache__/main.cpython-37.pyc deleted file mode 100644 index c151414..0000000 Binary files a/web3s/providers/eth_tester/__pycache__/main.cpython-37.pyc and /dev/null differ diff --git a/web3s/providers/eth_tester/__pycache__/middleware.cpython-36.pyc b/web3s/providers/eth_tester/__pycache__/middleware.cpython-36.pyc deleted file mode 100644 index 756bab8..0000000 Binary files a/web3s/providers/eth_tester/__pycache__/middleware.cpython-36.pyc and /dev/null differ diff --git a/web3s/providers/eth_tester/__pycache__/middleware.cpython-37.pyc b/web3s/providers/eth_tester/__pycache__/middleware.cpython-37.pyc deleted file mode 100644 index 60fdf7f..0000000 Binary files a/web3s/providers/eth_tester/__pycache__/middleware.cpython-37.pyc and /dev/null differ diff --git a/web3s/utils/.DS_Store b/web3s/utils/.DS_Store new file mode 100644 index 0000000..9c72a20 Binary files /dev/null and b/web3s/utils/.DS_Store differ diff --git a/web3s/utils/__pycache__/__init__.cpython-36.pyc b/web3s/utils/__pycache__/__init__.cpython-36.pyc deleted file mode 100644 index 5115d93..0000000 Binary files a/web3s/utils/__pycache__/__init__.cpython-36.pyc and /dev/null differ diff --git a/web3s/utils/__pycache__/__init__.cpython-37.pyc b/web3s/utils/__pycache__/__init__.cpython-37.pyc deleted file mode 100644 index 452a1de..0000000 Binary files a/web3s/utils/__pycache__/__init__.cpython-37.pyc and /dev/null differ diff --git a/web3s/utils/__pycache__/abi.cpython-36.pyc b/web3s/utils/__pycache__/abi.cpython-36.pyc deleted file mode 100644 index 8c42640..0000000 Binary files a/web3s/utils/__pycache__/abi.cpython-36.pyc and /dev/null differ diff --git a/web3s/utils/__pycache__/abi.cpython-37.pyc b/web3s/utils/__pycache__/abi.cpython-37.pyc deleted file mode 100644 index 4f8a6ab..0000000 Binary files a/web3s/utils/__pycache__/abi.cpython-37.pyc and /dev/null differ diff --git a/web3s/utils/__pycache__/blocks.cpython-36.pyc b/web3s/utils/__pycache__/blocks.cpython-36.pyc deleted file mode 100644 index 6a6ae60..0000000 Binary files a/web3s/utils/__pycache__/blocks.cpython-36.pyc and /dev/null differ diff --git a/web3s/utils/__pycache__/blocks.cpython-37.pyc b/web3s/utils/__pycache__/blocks.cpython-37.pyc deleted file mode 100644 index eee0418..0000000 Binary files a/web3s/utils/__pycache__/blocks.cpython-37.pyc and /dev/null differ diff --git a/web3s/utils/__pycache__/caching.cpython-36.pyc b/web3s/utils/__pycache__/caching.cpython-36.pyc deleted file mode 100644 index 7ce6b00..0000000 Binary files a/web3s/utils/__pycache__/caching.cpython-36.pyc and /dev/null differ diff --git a/web3s/utils/__pycache__/caching.cpython-37.pyc b/web3s/utils/__pycache__/caching.cpython-37.pyc deleted file mode 100644 index 305cd98..0000000 Binary files a/web3s/utils/__pycache__/caching.cpython-37.pyc and /dev/null differ diff --git a/web3s/utils/__pycache__/contracts.cpython-36.pyc b/web3s/utils/__pycache__/contracts.cpython-36.pyc deleted file mode 100644 index 2085611..0000000 Binary files a/web3s/utils/__pycache__/contracts.cpython-36.pyc and /dev/null differ diff --git a/web3s/utils/__pycache__/contracts.cpython-37.pyc b/web3s/utils/__pycache__/contracts.cpython-37.pyc deleted file mode 100644 index 286b3cf..0000000 Binary files a/web3s/utils/__pycache__/contracts.cpython-37.pyc and /dev/null differ diff --git a/web3s/utils/__pycache__/datatypes.cpython-36.pyc b/web3s/utils/__pycache__/datatypes.cpython-36.pyc deleted file mode 100644 index 2341342..0000000 Binary files a/web3s/utils/__pycache__/datatypes.cpython-36.pyc and /dev/null differ diff --git a/web3s/utils/__pycache__/datatypes.cpython-37.pyc b/web3s/utils/__pycache__/datatypes.cpython-37.pyc deleted file mode 100644 index 00d842e..0000000 Binary files a/web3s/utils/__pycache__/datatypes.cpython-37.pyc and /dev/null differ diff --git a/web3s/utils/__pycache__/decorators.cpython-36.pyc b/web3s/utils/__pycache__/decorators.cpython-36.pyc deleted file mode 100644 index fdc0425..0000000 Binary files a/web3s/utils/__pycache__/decorators.cpython-36.pyc and /dev/null differ diff --git a/web3s/utils/__pycache__/decorators.cpython-37.pyc b/web3s/utils/__pycache__/decorators.cpython-37.pyc deleted file mode 100644 index 0a1c698..0000000 Binary files a/web3s/utils/__pycache__/decorators.cpython-37.pyc and /dev/null differ diff --git a/web3s/utils/__pycache__/empty.cpython-36.pyc b/web3s/utils/__pycache__/empty.cpython-36.pyc deleted file mode 100644 index 3268383..0000000 Binary files a/web3s/utils/__pycache__/empty.cpython-36.pyc and /dev/null differ diff --git a/web3s/utils/__pycache__/empty.cpython-37.pyc b/web3s/utils/__pycache__/empty.cpython-37.pyc deleted file mode 100644 index e97e4a2..0000000 Binary files a/web3s/utils/__pycache__/empty.cpython-37.pyc and /dev/null differ diff --git a/web3s/utils/__pycache__/encoding.cpython-36.pyc b/web3s/utils/__pycache__/encoding.cpython-36.pyc deleted file mode 100644 index 4bd8c14..0000000 Binary files a/web3s/utils/__pycache__/encoding.cpython-36.pyc and /dev/null differ diff --git a/web3s/utils/__pycache__/encoding.cpython-37.pyc b/web3s/utils/__pycache__/encoding.cpython-37.pyc deleted file mode 100644 index b524943..0000000 Binary files a/web3s/utils/__pycache__/encoding.cpython-37.pyc and /dev/null differ diff --git a/web3s/utils/__pycache__/ens.cpython-36.pyc b/web3s/utils/__pycache__/ens.cpython-36.pyc deleted file mode 100644 index 5a072a9..0000000 Binary files a/web3s/utils/__pycache__/ens.cpython-36.pyc and /dev/null differ diff --git a/web3s/utils/__pycache__/ens.cpython-37.pyc b/web3s/utils/__pycache__/ens.cpython-37.pyc deleted file mode 100644 index d061359..0000000 Binary files a/web3s/utils/__pycache__/ens.cpython-37.pyc and /dev/null differ diff --git a/web3s/utils/__pycache__/events.cpython-36.pyc b/web3s/utils/__pycache__/events.cpython-36.pyc deleted file mode 100644 index cfdec49..0000000 Binary files a/web3s/utils/__pycache__/events.cpython-36.pyc and /dev/null differ diff --git a/web3s/utils/__pycache__/events.cpython-37.pyc b/web3s/utils/__pycache__/events.cpython-37.pyc deleted file mode 100644 index b9f3242..0000000 Binary files a/web3s/utils/__pycache__/events.cpython-37.pyc and /dev/null differ diff --git a/web3s/utils/__pycache__/filters.cpython-36.pyc b/web3s/utils/__pycache__/filters.cpython-36.pyc deleted file mode 100644 index 44328f3..0000000 Binary files a/web3s/utils/__pycache__/filters.cpython-36.pyc and /dev/null differ diff --git a/web3s/utils/__pycache__/filters.cpython-37.pyc b/web3s/utils/__pycache__/filters.cpython-37.pyc deleted file mode 100644 index c49f79a..0000000 Binary files a/web3s/utils/__pycache__/filters.cpython-37.pyc and /dev/null differ diff --git a/web3s/utils/__pycache__/formatters.cpython-36.pyc b/web3s/utils/__pycache__/formatters.cpython-36.pyc deleted file mode 100644 index a7374b9..0000000 Binary files a/web3s/utils/__pycache__/formatters.cpython-36.pyc and /dev/null differ diff --git a/web3s/utils/__pycache__/formatters.cpython-37.pyc b/web3s/utils/__pycache__/formatters.cpython-37.pyc deleted file mode 100644 index c4c2960..0000000 Binary files a/web3s/utils/__pycache__/formatters.cpython-37.pyc and /dev/null differ diff --git a/web3s/utils/__pycache__/function_identifiers.cpython-36.pyc b/web3s/utils/__pycache__/function_identifiers.cpython-36.pyc deleted file mode 100644 index d6eedf6..0000000 Binary files a/web3s/utils/__pycache__/function_identifiers.cpython-36.pyc and /dev/null differ diff --git a/web3s/utils/__pycache__/function_identifiers.cpython-37.pyc b/web3s/utils/__pycache__/function_identifiers.cpython-37.pyc deleted file mode 100644 index 1d47908..0000000 Binary files a/web3s/utils/__pycache__/function_identifiers.cpython-37.pyc and /dev/null differ diff --git a/web3s/utils/__pycache__/http.cpython-36.pyc b/web3s/utils/__pycache__/http.cpython-36.pyc deleted file mode 100644 index 7b4676a..0000000 Binary files a/web3s/utils/__pycache__/http.cpython-36.pyc and /dev/null differ diff --git a/web3s/utils/__pycache__/http.cpython-37.pyc b/web3s/utils/__pycache__/http.cpython-37.pyc deleted file mode 100644 index 3f6a2cc..0000000 Binary files a/web3s/utils/__pycache__/http.cpython-37.pyc and /dev/null differ diff --git a/web3s/utils/__pycache__/hypothesis.cpython-36.pyc b/web3s/utils/__pycache__/hypothesis.cpython-36.pyc deleted file mode 100644 index 7e42b0d..0000000 Binary files a/web3s/utils/__pycache__/hypothesis.cpython-36.pyc and /dev/null differ diff --git a/web3s/utils/__pycache__/hypothesis.cpython-37.pyc b/web3s/utils/__pycache__/hypothesis.cpython-37.pyc deleted file mode 100644 index 270149d..0000000 Binary files a/web3s/utils/__pycache__/hypothesis.cpython-37.pyc and /dev/null differ diff --git a/web3s/utils/__pycache__/math.cpython-36.pyc b/web3s/utils/__pycache__/math.cpython-36.pyc deleted file mode 100644 index 9f2173f..0000000 Binary files a/web3s/utils/__pycache__/math.cpython-36.pyc and /dev/null differ diff --git a/web3s/utils/__pycache__/math.cpython-37.pyc b/web3s/utils/__pycache__/math.cpython-37.pyc deleted file mode 100644 index fc2e877..0000000 Binary files a/web3s/utils/__pycache__/math.cpython-37.pyc and /dev/null differ diff --git a/web3s/utils/__pycache__/normalizers.cpython-36.pyc b/web3s/utils/__pycache__/normalizers.cpython-36.pyc deleted file mode 100644 index 4666d20..0000000 Binary files a/web3s/utils/__pycache__/normalizers.cpython-36.pyc and /dev/null differ diff --git a/web3s/utils/__pycache__/normalizers.cpython-37.pyc b/web3s/utils/__pycache__/normalizers.cpython-37.pyc deleted file mode 100644 index 061aa5d..0000000 Binary files a/web3s/utils/__pycache__/normalizers.cpython-37.pyc and /dev/null differ diff --git a/web3s/utils/__pycache__/request.cpython-36.pyc b/web3s/utils/__pycache__/request.cpython-36.pyc deleted file mode 100644 index 65fa392..0000000 Binary files a/web3s/utils/__pycache__/request.cpython-36.pyc and /dev/null differ diff --git a/web3s/utils/__pycache__/request.cpython-37.pyc b/web3s/utils/__pycache__/request.cpython-37.pyc deleted file mode 100644 index d4384d8..0000000 Binary files a/web3s/utils/__pycache__/request.cpython-37.pyc and /dev/null differ diff --git a/web3s/utils/__pycache__/rpc_abi.cpython-36.pyc b/web3s/utils/__pycache__/rpc_abi.cpython-36.pyc deleted file mode 100644 index 65ad887..0000000 Binary files a/web3s/utils/__pycache__/rpc_abi.cpython-36.pyc and /dev/null differ diff --git a/web3s/utils/__pycache__/rpc_abi.cpython-37.pyc b/web3s/utils/__pycache__/rpc_abi.cpython-37.pyc deleted file mode 100644 index 63b2b50..0000000 Binary files a/web3s/utils/__pycache__/rpc_abi.cpython-37.pyc and /dev/null differ diff --git a/web3s/utils/__pycache__/threads.cpython-36.pyc b/web3s/utils/__pycache__/threads.cpython-36.pyc deleted file mode 100644 index 6ac38b8..0000000 Binary files a/web3s/utils/__pycache__/threads.cpython-36.pyc and /dev/null differ diff --git a/web3s/utils/__pycache__/threads.cpython-37.pyc b/web3s/utils/__pycache__/threads.cpython-37.pyc deleted file mode 100644 index c8c2fa3..0000000 Binary files a/web3s/utils/__pycache__/threads.cpython-37.pyc and /dev/null differ diff --git a/web3s/utils/__pycache__/transactions.cpython-36.pyc b/web3s/utils/__pycache__/transactions.cpython-36.pyc deleted file mode 100644 index d86fad0..0000000 Binary files a/web3s/utils/__pycache__/transactions.cpython-36.pyc and /dev/null differ diff --git a/web3s/utils/__pycache__/transactions.cpython-37.pyc b/web3s/utils/__pycache__/transactions.cpython-37.pyc deleted file mode 100644 index 18b6cef..0000000 Binary files a/web3s/utils/__pycache__/transactions.cpython-37.pyc and /dev/null differ diff --git a/web3s/utils/__pycache__/validation.cpython-36.pyc b/web3s/utils/__pycache__/validation.cpython-36.pyc deleted file mode 100644 index 4c06e28..0000000 Binary files a/web3s/utils/__pycache__/validation.cpython-36.pyc and /dev/null differ diff --git a/web3s/utils/__pycache__/validation.cpython-37.pyc b/web3s/utils/__pycache__/validation.cpython-37.pyc deleted file mode 100644 index 1d98d7c..0000000 Binary files a/web3s/utils/__pycache__/validation.cpython-37.pyc and /dev/null differ diff --git a/web3s/utils/__pycache__/windows.cpython-36.pyc b/web3s/utils/__pycache__/windows.cpython-36.pyc deleted file mode 100644 index 7c44aef..0000000 Binary files a/web3s/utils/__pycache__/windows.cpython-36.pyc and /dev/null differ diff --git a/web3s/utils/__pycache__/windows.cpython-37.pyc b/web3s/utils/__pycache__/windows.cpython-37.pyc deleted file mode 100644 index 7b3fe51..0000000 Binary files a/web3s/utils/__pycache__/windows.cpython-37.pyc and /dev/null differ diff --git a/web3s/utils/abi.py b/web3s/utils/abi.py index a8cc918..2623861 100644 --- a/web3s/utils/abi.py +++ b/web3s/utils/abi.py @@ -22,9 +22,8 @@ from web3s.exceptions import ( FallbackNotFound, ) -from web3s.utils.ens import ( - is_ens_name, -) + + from web3s.utils.formatters import ( recursive_map, ) @@ -124,10 +123,7 @@ def is_encodable(_type, value): return False sub_type = (base, sub, arrlist[:-1]) return all(is_encodable(sub_type, sub_value) for sub_value in value) - elif base == 'address' and is_ens_name(value): - # ENS names can be used anywhere an address is needed - # Web3.py will resolve the name to an address before encoding it - return True + elif base == 'bytes' and isinstance(value, str): # Hex-encoded bytes values can be used anywhere a bytes value is needed if is_hex(value) and len(value) % 2 == 0: diff --git a/web3s/utils/contracts.py b/web3s/utils/contracts.py index 832365c..9745643 100644 --- a/web3s/utils/contracts.py +++ b/web3s/utils/contracts.py @@ -41,7 +41,7 @@ from web3s.utils.normalizers import ( abi_address_to_hex, abi_bytes_to_bytes, - abi_ens_resolver, + abi_string_to_text, ) from web3s.utils.toolz import ( @@ -141,7 +141,7 @@ def encode_abi(web3, abi, arguments, data=None): try: normalizers = [ - abi_ens_resolver(web3), + abi_address_to_hex, abi_bytes_to_bytes, abi_string_to_text, diff --git a/web3s/utils/ens.py b/web3s/utils/ens.py deleted file mode 100644 index 4fc3b3a..0000000 --- a/web3s/utils/ens.py +++ /dev/null @@ -1,64 +0,0 @@ -from contextlib import ( - contextmanager, -) - -from eth_utils import ( - is_0x_prefixed, - is_hex, - is_hex_address, -) - -from web3s.ens import ENS -from web3s.exceptions import ( - NameNotFound, -) - - -def is_ens_name(value): - if not isinstance(value, str): - return False - elif is_hex_address(value): - return False - elif is_0x_prefixed(value) and is_hex(value): - return False - else: - return ENS.is_valid_name(value) - - -def validate_name_has_address(ens, name): - addr = ens.address(name, guess_tld=False) - if addr: - return addr - else: - raise NameNotFound("Could not find address for name %r" % name) - - -class StaticENS: - def __init__(self, name_addr_pairs): - self.registry = dict(name_addr_pairs) - - def address(self, name, guess_tld=True): - # no automated web3s usages should be guessing the TLD - assert not guess_tld - return self.registry.get(name, None) - - -@contextmanager -def ens_addresses(w3, name_addr_pairs): - original_ens = w3.ens - w3.ens = StaticENS(name_addr_pairs) - yield - w3.ens = original_ens - - -@contextmanager -def contract_ens_addresses(contract, name_addr_pairs): - ''' - Use this context manager to temporarily resolve name/address pairs - supplied as the argument. For example: - - with contract_ens_addresses(mycontract, [('resolve-as-1s.eth', '0x111...111')]): - # any contract call or transaction in here would only resolve the above ENS pair - ''' - with ens_addresses(contract.web3, name_addr_pairs): - yield diff --git a/web3s/utils/module_testing/__init__.py b/web3s/utils/module_testing/__init__.py deleted file mode 100644 index 285847a..0000000 --- a/web3s/utils/module_testing/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -from .web3_module import ( # noqa: F401 - Web3ModuleTest, -) -from .eth_module import ( # noqa: F401 - EthModuleTest, -) -from .net_module import ( # noqa: F401 - NetModuleTest, -) -from .personal_module import ( # noqa: F401 - PersonalModuleTest, -) -from .version_module import ( # noqa: F401 - VersionModuleTest, -) - -from .parity_module import ( # noqa: F401 - ParityModuleTest, -) diff --git a/web3s/utils/module_testing/__pycache__/__init__.cpython-36.pyc b/web3s/utils/module_testing/__pycache__/__init__.cpython-36.pyc deleted file mode 100644 index 05425f5..0000000 Binary files a/web3s/utils/module_testing/__pycache__/__init__.cpython-36.pyc and /dev/null differ diff --git a/web3s/utils/module_testing/__pycache__/__init__.cpython-37.pyc b/web3s/utils/module_testing/__pycache__/__init__.cpython-37.pyc deleted file mode 100644 index 4d6e512..0000000 Binary files a/web3s/utils/module_testing/__pycache__/__init__.cpython-37.pyc and /dev/null differ diff --git a/web3s/utils/module_testing/__pycache__/emitter_contract.cpython-36.pyc b/web3s/utils/module_testing/__pycache__/emitter_contract.cpython-36.pyc deleted file mode 100644 index a19c6e9..0000000 Binary files a/web3s/utils/module_testing/__pycache__/emitter_contract.cpython-36.pyc and /dev/null differ diff --git a/web3s/utils/module_testing/__pycache__/emitter_contract.cpython-37.pyc b/web3s/utils/module_testing/__pycache__/emitter_contract.cpython-37.pyc deleted file mode 100644 index c4c3a2c..0000000 Binary files a/web3s/utils/module_testing/__pycache__/emitter_contract.cpython-37.pyc and /dev/null differ diff --git a/web3s/utils/module_testing/__pycache__/eth_module.cpython-36.pyc b/web3s/utils/module_testing/__pycache__/eth_module.cpython-36.pyc deleted file mode 100644 index ad85795..0000000 Binary files a/web3s/utils/module_testing/__pycache__/eth_module.cpython-36.pyc and /dev/null differ diff --git a/web3s/utils/module_testing/__pycache__/eth_module.cpython-37.pyc b/web3s/utils/module_testing/__pycache__/eth_module.cpython-37.pyc deleted file mode 100644 index b4d24ac..0000000 Binary files a/web3s/utils/module_testing/__pycache__/eth_module.cpython-37.pyc and /dev/null differ diff --git a/web3s/utils/module_testing/__pycache__/math_contract.cpython-36.pyc b/web3s/utils/module_testing/__pycache__/math_contract.cpython-36.pyc deleted file mode 100644 index 5a845ea..0000000 Binary files a/web3s/utils/module_testing/__pycache__/math_contract.cpython-36.pyc and /dev/null differ diff --git a/web3s/utils/module_testing/__pycache__/math_contract.cpython-37.pyc b/web3s/utils/module_testing/__pycache__/math_contract.cpython-37.pyc deleted file mode 100644 index a36f880..0000000 Binary files a/web3s/utils/module_testing/__pycache__/math_contract.cpython-37.pyc and /dev/null differ diff --git a/web3s/utils/module_testing/__pycache__/net_module.cpython-36.pyc b/web3s/utils/module_testing/__pycache__/net_module.cpython-36.pyc deleted file mode 100644 index 53a7d32..0000000 Binary files a/web3s/utils/module_testing/__pycache__/net_module.cpython-36.pyc and /dev/null differ diff --git a/web3s/utils/module_testing/__pycache__/net_module.cpython-37.pyc b/web3s/utils/module_testing/__pycache__/net_module.cpython-37.pyc deleted file mode 100644 index 810aa08..0000000 Binary files a/web3s/utils/module_testing/__pycache__/net_module.cpython-37.pyc and /dev/null differ diff --git a/web3s/utils/module_testing/__pycache__/parity_module.cpython-36.pyc b/web3s/utils/module_testing/__pycache__/parity_module.cpython-36.pyc deleted file mode 100644 index 352ece0..0000000 Binary files a/web3s/utils/module_testing/__pycache__/parity_module.cpython-36.pyc and /dev/null differ diff --git a/web3s/utils/module_testing/__pycache__/parity_module.cpython-37.pyc b/web3s/utils/module_testing/__pycache__/parity_module.cpython-37.pyc deleted file mode 100644 index de1cdcb..0000000 Binary files a/web3s/utils/module_testing/__pycache__/parity_module.cpython-37.pyc and /dev/null differ diff --git a/web3s/utils/module_testing/__pycache__/personal_module.cpython-36.pyc b/web3s/utils/module_testing/__pycache__/personal_module.cpython-36.pyc deleted file mode 100644 index 08b6cd7..0000000 Binary files a/web3s/utils/module_testing/__pycache__/personal_module.cpython-36.pyc and /dev/null differ diff --git a/web3s/utils/module_testing/__pycache__/personal_module.cpython-37.pyc b/web3s/utils/module_testing/__pycache__/personal_module.cpython-37.pyc deleted file mode 100644 index c9feac8..0000000 Binary files a/web3s/utils/module_testing/__pycache__/personal_module.cpython-37.pyc and /dev/null differ diff --git a/web3s/utils/module_testing/__pycache__/version_module.cpython-36.pyc b/web3s/utils/module_testing/__pycache__/version_module.cpython-36.pyc deleted file mode 100644 index 3c03b22..0000000 Binary files a/web3s/utils/module_testing/__pycache__/version_module.cpython-36.pyc and /dev/null differ diff --git a/web3s/utils/module_testing/__pycache__/version_module.cpython-37.pyc b/web3s/utils/module_testing/__pycache__/version_module.cpython-37.pyc deleted file mode 100644 index 887438d..0000000 Binary files a/web3s/utils/module_testing/__pycache__/version_module.cpython-37.pyc and /dev/null differ diff --git a/web3s/utils/module_testing/__pycache__/web3_module.cpython-36.pyc b/web3s/utils/module_testing/__pycache__/web3_module.cpython-36.pyc deleted file mode 100644 index a75e630..0000000 Binary files a/web3s/utils/module_testing/__pycache__/web3_module.cpython-36.pyc and /dev/null differ diff --git a/web3s/utils/module_testing/__pycache__/web3_module.cpython-37.pyc b/web3s/utils/module_testing/__pycache__/web3_module.cpython-37.pyc deleted file mode 100644 index 9dc31d8..0000000 Binary files a/web3s/utils/module_testing/__pycache__/web3_module.cpython-37.pyc and /dev/null differ diff --git a/web3s/utils/module_testing/emitter_contract.py b/web3s/utils/module_testing/emitter_contract.py deleted file mode 100644 index ccccbc3..0000000 --- a/web3s/utils/module_testing/emitter_contract.py +++ /dev/null @@ -1,232 +0,0 @@ - -EMITTER_BYTECODE = ( - "60606040526104ae806100126000396000f3606060405236156100615760e060020a60003504630b" - "b563d6811461006357806317c0c1801461013657806320f0256e1461017057806390b41d8b146101" - "ca5780639c37705314610215578063aa6fd82214610267578063e17bf956146102a9575b005b6020" - "6004803580820135601f810184900490930260809081016040526060848152610061946024939192" - "918401918190838280828437509496505050505050507fa95e6e2a182411e7a6f9ed114a85c3761d" - "87f9b8f453d842c71235aa64fff99f81604051808060200182810382528381815181526020019150" - "80519060200190808383829060006004602084601f0104600f02600301f150905090810190601f16" - "80156101255780820380516001836020036101000a031916815260200191505b5092505050604051" - "80910390a15b50565b610061600435600181141561037a577f1e86022f78f8d04f8e3dfd13a2bdb2" - "80403e6632877c0dbee5e4eeb259908a5c60006060a1610133565b61006160043560243560443560" - "64356084356005851415610392576060848152608084815260a084905260c08390527ff039d147f2" - "3fe975a4254bdf6b1502b8c79132ae1833986b7ccef2638e73fdf991a15b5050505050565b610061" - "60043560243560443560038314156103d457606082815260808290527fdf0cb1dea99afceb3ea698" - "d62e705b736f1345a7eee9eb07e63d1f8f556c1bc590604090a15b505050565b6100616004356024" - "356044356064356004841415610428576060838152608083905260a08290527f4a25b279c7c585f2" - "5eda9788ac9420ebadae78ca6b206a0e6ab488fd81f550629080a15b50505050565b610061600435" - "60243560028214156104655760608181527f56d2ef3c5228bf5d88573621e325a4672ab50e033749" - "a601e4f4a5e1dce905d490602090a15b5050565b60206004803580820135601f8101849004909302" - "60809081016040526060848152610061946024939192918401918190838280828437509496505050" - "505050507f532fd6ea96cfb78bb46e09279a26828b8b493de1a2b8b1ee1face527978a15a5816040" - "51808060200182810382528381815181526020019150805190602001908083838290600060046020" - "84601f0104600f02600301f150905090810190601f16801561012557808203805160018360200361" - "01000a03191681526020019150509250505060405180910390a150565b600081141561038d576000" - "6060a0610133565b610002565b600b85141561038d5760608481526080849052819083907fa30ece" - "802b64cd2b7e57dabf4010aabf5df26d1556977affb07b98a77ad955b590604090a36101c3565b60" - "0983141561040f57606082815281907f057bc32826fbe161da1c110afcdcae7c109a8b69149f727f" - "c37a603c60ef94ca90602090a2610210565b600883141561038d5760608281528190602090a16102" - "10565b600a84141561038d576060838152819083907ff16c999b533366ca5138d78e85da51611089" - "cd05749f098d6c225d4cd42ee6ec90602090a3610261565b600782141561049a57807ff70fe689e2" - "90d8ce2b2a388ac28db36fbb0e16a6d89c6804c461f65a1b40bb1560006060a26102a5565b600682" - "141561038d578060006060a16102a556" -) - - -EMITTER_ABI = [ - { - "constant": False, - "inputs": [{"name": "v", "type": "string"}], - "name": "logString", - "outputs": [], - "type": "function", - }, - { - "constant": False, - "inputs": [{"name": "which", "type": "uint8"}], - "name": "logNoArgs", - "outputs": [], - "type": "function", - }, - { - "constant": False, - "inputs": [ - {"name": "which", "type": "uint8"}, - {"name": "arg0", "type": "uint256"}, - {"name": "arg1", "type": "uint256"}, - {"name": "arg2", "type": "uint256"}, - {"name": "arg3", "type": "uint256"}, - ], - "name": "logQuadruple", - "outputs": [], - "type": "function", - }, - { - "constant": False, - "inputs": [ - {"name": "which", "type": "uint8"}, - {"name": "arg0", "type": "uint256"}, - {"name": "arg1", "type": "uint256"}, - ], - "name": "logDouble", - "outputs": [], - "type": "function", - }, - { - "constant": False, - "inputs": [ - {"name": "which", "type": "uint8"}, - {"name": "arg0", "type": "uint256"}, - {"name": "arg1", "type": "uint256"}, - {"name": "arg2", "type": "uint256"}, - ], - "name": "logTriple", - "outputs": [], - "type": "function", - }, - { - "constant": False, - "inputs": [ - {"name": "which", "type": "uint8"}, - {"name": "arg0", "type": "uint256"}, - ], - "name": "logSingle", - "outputs": [], - "type": "function", - }, - { - "constant": False, - "inputs": [{"name": "v", "type": "bytes"}], - "name": "logBytes", - "outputs": [], - "type": "function", - }, - { - "anonymous": True, - "inputs": [], - "name": "LogAnonymous", - "type": "event", - }, - { - "anonymous": False, - "inputs": [], - "name": "LogNoArguments", - "type": "event", - }, - { - "anonymous": False, - "inputs": [{"indexed": False, "name": "arg0", "type": "uint256"}], - "name": "LogSingleArg", - "type": "event", - }, - { - "anonymous": False, - "inputs": [ - {"indexed": False, "name": "arg0", "type": "uint256"}, - {"indexed": False, "name": "arg1", "type": "uint256"}, - ], - "name": "LogDoubleArg", - "type": "event", - }, - { - "anonymous": False, - "inputs": [ - {"indexed": False, "name": "arg0", "type": "uint256"}, - {"indexed": False, "name": "arg1", "type": "uint256"}, - {"indexed": False, "name": "arg2", "type": "uint256"}, - ], - "name": "LogTripleArg", - "type": "event", - }, - { - "anonymous": False, - "inputs": [ - {"indexed": False, "name": "arg0", "type": "uint256"}, - {"indexed": False, "name": "arg1", "type": "uint256"}, - {"indexed": False, "name": "arg2", "type": "uint256"}, - {"indexed": False, "name": "arg3", "type": "uint256"}, - ], - "name": "LogQuadrupleArg", - "type": "event", - }, - { - "anonymous": True, - "inputs": [{"indexed": True, "name": "arg0", "type": "uint256"}], - "name": "LogSingleAnonymous", - "type": "event", - }, - { - "anonymous": False, - "inputs": [{"indexed": True, "name": "arg0", "type": "uint256"}], - "name": "LogSingleWithIndex", - "type": "event", - }, - { - "anonymous": True, - "inputs": [ - {"indexed": False, "name": "arg0", "type": "uint256"}, - {"indexed": True, "name": "arg1", "type": "uint256"}, - ], - "name": "LogDoubleAnonymous", - "type": "event", - }, - { - "anonymous": False, - "inputs": [ - {"indexed": False, "name": "arg0", "type": "uint256"}, - {"indexed": True, "name": "arg1", "type": "uint256"}, - ], - "name": "LogDoubleWithIndex", - "type": "event", - }, - { - "anonymous": False, - "inputs": [ - {"indexed": False, "name": "arg0", "type": "uint256"}, - {"indexed": True, "name": "arg1", "type": "uint256"}, - {"indexed": True, "name": "arg2", "type": "uint256"}, - ], - "name": "LogTripleWithIndex", - "type": "event", - }, - { - "anonymous": False, - "inputs": [ - {"indexed": False, "name": "arg0", "type": "uint256"}, - {"indexed": False, "name": "arg1", "type": "uint256"}, - {"indexed": True, "name": "arg2", "type": "uint256"}, - {"indexed": True, "name": "arg3", "type": "uint256"}, - ], - "name": "LogQuadrupleWithIndex", - "type": "event", - }, - { - "anonymous": False, - "inputs": [{"indexed": False, "name": "v", "type": "bytes"}], - "name": "LogBytes", - "type": "event", - }, - { - "anonymous": False, - "inputs": [{"indexed": False, "name": "v", "type": "string"}], - "name": "LogString", - "type": "event", - }, -] - - -EMITTER_ENUM = { - 'LogAnonymous': 0, - 'LogNoArguments': 1, - 'LogSingleArg': 2, - 'LogDoubleArg': 3, - 'LogTripleArg': 4, - 'LogQuadrupleArg': 5, - 'LogSingleAnonymous': 6, - 'LogSingleWithIndex': 7, - 'LogDoubleAnonymous': 8, - 'LogDoubleWithIndex': 9, - 'LogTripleWithIndex': 10, - 'LogQuadrupleWithInde': 11, -} diff --git a/web3s/utils/module_testing/eth_module.py b/web3s/utils/module_testing/eth_module.py deleted file mode 100644 index 3a7915d..0000000 --- a/web3s/utils/module_testing/eth_module.py +++ /dev/null @@ -1,817 +0,0 @@ -# -*- coding: utf-8 -*- - -import pytest - -from eth_abi import ( - decode_single, -) -from eth_utils import ( - is_boolean, - is_bytes, - is_checksum_address, - is_dict, - is_integer, - is_list_like, - is_same_address, - is_string, -) -from hexbytes import ( - HexBytes, -) - -from web3s.exceptions import ( - InvalidAddress, -) - -UNKNOWN_ADDRESS = '0xdEADBEeF00000000000000000000000000000000' -UNKNOWN_HASH = '0xdeadbeef00000000000000000000000000000000000000000000000000000000' - - -class EthModuleTest: - def test_eth_protocolVersion(self, web3): - protocol_version = web3.version.ethereum - - assert is_string(protocol_version) - assert protocol_version.isdigit() - - def test_eth_syncing(self, web3): - syncing = web3.eth.syncing - - assert is_boolean(syncing) or is_dict(syncing) - - if is_boolean(syncing): - assert syncing is False - elif is_dict(syncing): - assert 'startingBlock' in syncing - assert 'currentBlock' in syncing - assert 'highestBlock' in syncing - - assert is_integer(syncing['startingBlock']) - assert is_integer(syncing['currentBlock']) - assert is_integer(syncing['highestBlock']) - - def test_eth_coinbase(self, web3): - coinbase = web3.eth.coinbase - assert is_checksum_address(coinbase) - - def test_eth_mining(self, web3): - mining = web3.eth.mining - assert is_boolean(mining) - - def test_eth_hashrate(self, web3): - hashrate = web3.eth.hashrate - assert is_integer(hashrate) - assert hashrate >= 0 - - def test_eth_gasPrice(self, web3): - gas_price = web3.eth.gasPrice - assert is_integer(gas_price) - assert gas_price > 0 - - def test_eth_accounts(self, web3): - accounts = web3.eth.accounts - assert is_list_like(accounts) - assert len(accounts) != 0 - assert all(( - is_checksum_address(account) - for account - in accounts - )) - assert web3.eth.coinbase in accounts - - def test_eth_blockNumber(self, web3): - block_number = web3.eth.blockNumber - assert is_integer(block_number) - assert block_number >= 0 - - def test_eth_getBalance(self, web3): - coinbase = web3.eth.coinbase - - with pytest.raises(InvalidAddress): - web3.eth.getBalance(coinbase.lower()) - - balance = web3.eth.getBalance(coinbase) - - assert is_integer(balance) - assert balance >= 0 - - def test_eth_getStorageAt(self, web3, emitter_contract_address): - storage = web3.eth.getStorageAt(emitter_contract_address, 0) - assert isinstance(storage, HexBytes) - - def test_eth_getStorageAt_invalid_address(self, web3): - coinbase = web3.eth.coinbase - with pytest.raises(InvalidAddress): - web3.eth.getStorageAt(coinbase.lower(), 0) - - def test_eth_getTransactionCount(self, web3, unlocked_account_dual_type): - transaction_count = web3.eth.getTransactionCount(unlocked_account_dual_type) - assert is_integer(transaction_count) - assert transaction_count >= 0 - - def test_eth_getTransactionCount_invalid_address(self, web3): - coinbase = web3.eth.coinbase - with pytest.raises(InvalidAddress): - web3.eth.getTransactionCount(coinbase.lower()) - - def test_eth_getBlockTransactionCountByHash_empty_block(self, web3, empty_block): - transaction_count = web3.eth.getBlockTransactionCount(empty_block['hash']) - - assert is_integer(transaction_count) - assert transaction_count == 0 - - def test_eth_getBlockTransactionCountByNumber_empty_block(self, web3, empty_block): - transaction_count = web3.eth.getBlockTransactionCount(empty_block['number']) - - assert is_integer(transaction_count) - assert transaction_count == 0 - - def test_eth_getBlockTransactionCountByHash_block_with_txn(self, web3, block_with_txn): - transaction_count = web3.eth.getBlockTransactionCount(block_with_txn['hash']) - - assert is_integer(transaction_count) - assert transaction_count >= 1 - - def test_eth_getBlockTransactionCountByNumber_block_with_txn(self, web3, block_with_txn): - transaction_count = web3.eth.getBlockTransactionCount(block_with_txn['number']) - - assert is_integer(transaction_count) - assert transaction_count >= 1 - - def test_eth_getUncleCountByBlockHash(self, web3, empty_block): - uncle_count = web3.eth.getUncleCount(empty_block['hash']) - - assert is_integer(uncle_count) - assert uncle_count == 0 - - def test_eth_getUncleCountByBlockNumber(self, web3, empty_block): - uncle_count = web3.eth.getUncleCount(empty_block['number']) - - assert is_integer(uncle_count) - assert uncle_count == 0 - - def test_eth_getCode(self, web3, math_contract_address): - code = web3.eth.getCode(math_contract_address) - assert isinstance(code, HexBytes) - assert len(code) > 0 - - def test_eth_getCode_invalid_address(self, web3, math_contract): - with pytest.raises(InvalidAddress): - web3.eth.getCode(math_contract.address.lower()) - - def test_eth_getCode_with_block_identifier(self, web3, emitter_contract): - code = web3.eth.getCode(emitter_contract.address, block_identifier=web3.eth.blockNumber) - assert isinstance(code, HexBytes) - assert len(code) > 0 - - def test_eth_sign(self, web3, unlocked_account_dual_type): - signature = web3.eth.sign( - unlocked_account_dual_type, text='Message tö sign. Longer than hash!' - ) - assert is_bytes(signature) - assert len(signature) == 32 + 32 + 1 - - # test other formats - hexsign = web3.eth.sign( - unlocked_account_dual_type, - hexstr='0x4d6573736167652074c3b6207369676e2e204c6f6e676572207468616e206861736821' - ) - assert hexsign == signature - - intsign = web3.eth.sign( - unlocked_account_dual_type, - 0x4d6573736167652074c3b6207369676e2e204c6f6e676572207468616e206861736821 - ) - assert intsign == signature - - bytessign = web3.eth.sign( - unlocked_account_dual_type, b'Message t\xc3\xb6 sign. Longer than hash!' - ) - assert bytessign == signature - - new_signature = web3.eth.sign( - unlocked_account_dual_type, text='different message is different' - ) - assert new_signature != signature - - def test_eth_sendTransaction_addr_checksum_required(self, web3, unlocked_account): - non_checksum_addr = unlocked_account.lower() - txn_params = { - 'from': unlocked_account, - 'to': unlocked_account, - 'value': 1, - 'gas': 21000, - 'gasPrice': web3.eth.gasPrice, - } - - with pytest.raises(InvalidAddress): - invalid_params = dict(txn_params, **{'from': non_checksum_addr}) - web3.eth.sendTransaction(invalid_params) - - with pytest.raises(InvalidAddress): - invalid_params = dict(txn_params, **{'to': non_checksum_addr}) - web3.eth.sendTransaction(invalid_params) - - def test_eth_sendTransaction(self, web3, unlocked_account_dual_type): - txn_params = { - 'from': unlocked_account_dual_type, - 'to': unlocked_account_dual_type, - 'value': 1, - 'gas': 21000, - 'gasPrice': web3.eth.gasPrice, - } - txn_hash = web3.eth.sendTransaction(txn_params) - txn = web3.eth.getTransaction(txn_hash) - - assert is_same_address(txn['from'], txn_params['from']) - assert is_same_address(txn['to'], txn_params['to']) - assert txn['value'] == 1 - assert txn['gas'] == 21000 - assert txn['gasPrice'] == txn_params['gasPrice'] - - def test_eth_sendTransaction_with_nonce(self, web3, unlocked_account): - txn_params = { - 'from': unlocked_account, - 'to': unlocked_account, - 'value': 1, - 'gas': 21000, - # Increased gas price to ensure transaction hash different from other tests - 'gasPrice': web3.eth.gasPrice * 2, - 'nonce': web3.eth.getTransactionCount(unlocked_account), - } - txn_hash = web3.eth.sendTransaction(txn_params) - txn = web3.eth.getTransaction(txn_hash) - - assert is_same_address(txn['from'], txn_params['from']) - assert is_same_address(txn['to'], txn_params['to']) - assert txn['value'] == 1 - assert txn['gas'] == 21000 - assert txn['gasPrice'] == txn_params['gasPrice'] - assert txn['nonce'] == txn_params['nonce'] - - def test_eth_replaceTransaction(self, web3, unlocked_account_dual_type): - txn_params = { - 'from': unlocked_account_dual_type, - 'to': unlocked_account_dual_type, - 'value': 1, - 'gas': 21000, - 'gasPrice': web3.eth.gasPrice, - } - txn_hash = web3.eth.sendTransaction(txn_params) - - txn_params['gasPrice'] = web3.eth.gasPrice * 2 - replace_txn_hash = web3.eth.replaceTransaction(txn_hash, txn_params) - replace_txn = web3.eth.getTransaction(replace_txn_hash) - - assert is_same_address(replace_txn['from'], txn_params['from']) - assert is_same_address(replace_txn['to'], txn_params['to']) - assert replace_txn['value'] == 1 - assert replace_txn['gas'] == 21000 - assert replace_txn['gasPrice'] == txn_params['gasPrice'] - - def test_eth_replaceTransaction_non_existing_transaction( - self, web3, unlocked_account_dual_type): - txn_params = { - 'from': unlocked_account_dual_type, - 'to': unlocked_account_dual_type, - 'value': 1, - 'gas': 21000, - 'gasPrice': web3.eth.gasPrice, - } - with pytest.raises(ValueError): - web3.eth.replaceTransaction( - '0x98e8cc09b311583c5079fa600f6c2a3bea8611af168c52e4b60b5b243a441997', - txn_params - ) - - # auto mine is enabled for this test - def test_eth_replaceTransaction_already_mined(self, web3, unlocked_account_dual_type): - txn_params = { - 'from': unlocked_account_dual_type, - 'to': unlocked_account_dual_type, - 'value': 1, - 'gas': 21000, - 'gasPrice': web3.eth.gasPrice, - } - txn_hash = web3.eth.sendTransaction(txn_params) - - txn_params['gasPrice'] = web3.eth.gasPrice * 2 - with pytest.raises(ValueError): - web3.eth.replaceTransaction(txn_hash, txn_params) - - def test_eth_replaceTransaction_incorrect_nonce(self, web3, unlocked_account): - txn_params = { - 'from': unlocked_account, - 'to': unlocked_account, - 'value': 1, - 'gas': 21000, - 'gasPrice': web3.eth.gasPrice, - } - txn_hash = web3.eth.sendTransaction(txn_params) - txn = web3.eth.getTransaction(txn_hash) - - txn_params['gasPrice'] = web3.eth.gasPrice * 2 - txn_params['nonce'] = txn['nonce'] + 1 - with pytest.raises(ValueError): - web3.eth.replaceTransaction(txn_hash, txn_params) - - def test_eth_replaceTransaction_gas_price_too_low(self, web3, unlocked_account_dual_type): - txn_params = { - 'from': unlocked_account_dual_type, - 'to': unlocked_account_dual_type, - 'value': 1, - 'gas': 21000, - 'gasPrice': 10, - } - txn_hash = web3.eth.sendTransaction(txn_params) - - txn_params['gasPrice'] = 9 - with pytest.raises(ValueError): - web3.eth.replaceTransaction(txn_hash, txn_params) - - def test_eth_replaceTransaction_gas_price_defaulting_minimum(self, web3, unlocked_account): - txn_params = { - 'from': unlocked_account, - 'to': unlocked_account, - 'value': 1, - 'gas': 21000, - 'gasPrice': 10, - } - txn_hash = web3.eth.sendTransaction(txn_params) - - txn_params.pop('gasPrice') - replace_txn_hash = web3.eth.replaceTransaction(txn_hash, txn_params) - replace_txn = web3.eth.getTransaction(replace_txn_hash) - - assert replace_txn['gasPrice'] == 11 # minimum gas price - - def test_eth_replaceTransaction_gas_price_defaulting_strategy_higher(self, - web3, - unlocked_account): - txn_params = { - 'from': unlocked_account, - 'to': unlocked_account, - 'value': 1, - 'gas': 21000, - 'gasPrice': 10, - } - txn_hash = web3.eth.sendTransaction(txn_params) - - def higher_gas_price_strategy(web3, txn): - return 20 - - web3.eth.setGasPriceStrategy(higher_gas_price_strategy) - - txn_params.pop('gasPrice') - replace_txn_hash = web3.eth.replaceTransaction(txn_hash, txn_params) - replace_txn = web3.eth.getTransaction(replace_txn_hash) - assert replace_txn['gasPrice'] == 20 # Strategy provides higher gas price - - def test_eth_replaceTransaction_gas_price_defaulting_strategy_lower(self, - web3, - unlocked_account): - txn_params = { - 'from': unlocked_account, - 'to': unlocked_account, - 'value': 1, - 'gas': 21000, - 'gasPrice': 10, - } - txn_hash = web3.eth.sendTransaction(txn_params) - - def lower_gas_price_strategy(web3, txn): - return 5 - - web3.eth.setGasPriceStrategy(lower_gas_price_strategy) - - txn_params.pop('gasPrice') - replace_txn_hash = web3.eth.replaceTransaction(txn_hash, txn_params) - replace_txn = web3.eth.getTransaction(replace_txn_hash) - # Strategy provices lower gas price - minimum preferred - assert replace_txn['gasPrice'] == 11 - - def test_eth_modifyTransaction(self, web3, unlocked_account): - txn_params = { - 'from': unlocked_account, - 'to': unlocked_account, - 'value': 1, - 'gas': 21000, - 'gasPrice': web3.eth.gasPrice, - } - txn_hash = web3.eth.sendTransaction(txn_params) - - modified_txn_hash = web3.eth.modifyTransaction( - txn_hash, gasPrice=(txn_params['gasPrice'] * 2), value=2 - ) - modified_txn = web3.eth.getTransaction(modified_txn_hash) - - assert is_same_address(modified_txn['from'], txn_params['from']) - assert is_same_address(modified_txn['to'], txn_params['to']) - assert modified_txn['value'] == 2 - assert modified_txn['gas'] == 21000 - assert modified_txn['gasPrice'] == txn_params['gasPrice'] * 2 - - @pytest.mark.parametrize( - 'raw_transaction, expected_hash', - [ - ( - # address 0x39EEed73fb1D3855E90Cbd42f348b3D7b340aAA6 - '0xf8648085174876e8008252089439eeed73fb1d3855e90cbd42f348b3d7b340aaa601801ba0ec1295f00936acd0c2cb90ab2cdaacb8bf5e11b3d9957833595aca9ceedb7aada05dfc8937baec0e26029057abd3a1ef8c505dca2cdc07ffacb046d090d2bea06a', # noqa: E501 - '0x1f80f8ab5f12a45be218f76404bda64d37270a6f4f86ededd0eb599f80548c13', - ), - ( - # private key 0x3c2ab4e8f17a7dea191b8c991522660126d681039509dc3bb31af7c9bdb63518 - # This is an unfunded account, but the transaction has a 0 gas price, so is valid. - # It never needs to be mined, we just want the transaction hash back to confirm. - HexBytes('0xf85f808082c35094d898d5e829717c72e7438bad593076686d7d164a80801ba005c2e99ecee98a12fbf28ab9577423f42e9e88f2291b3acc8228de743884c874a077d6bc77a47ad41ec85c96aac2ad27f05a039c4787fca8a1e5ee2d8c7ec1bb6a'), # noqa: E501 - '0x98eeadb99454427f6aad7b558bac13e9d225512a6f5e5c11cf48e8d4067e51b5', - ), - ] - ) - def test_eth_sendRawTransaction(self, - web3, - raw_transaction, - funded_account_for_raw_txn, - expected_hash): - txn_hash = web3.eth.sendRawTransaction(raw_transaction) - assert txn_hash == web3.toBytes(hexstr=expected_hash) - - def test_eth_call(self, web3, math_contract): - coinbase = web3.eth.coinbase - txn_params = math_contract._prepare_transaction( - fn_name='add', - fn_args=(7, 11), - transaction={'from': coinbase, 'to': math_contract.address}, - ) - call_result = web3.eth.call(txn_params) - assert is_string(call_result) - result = decode_single('uint256', call_result) - assert result == 18 - - def test_eth_call_with_0_result(self, web3, math_contract): - coinbase = web3.eth.coinbase - txn_params = math_contract._prepare_transaction( - fn_name='add', - fn_args=(0, 0), - transaction={'from': coinbase, 'to': math_contract.address}, - ) - call_result = web3.eth.call(txn_params) - assert is_string(call_result) - result = decode_single('uint256', call_result) - assert result == 0 - - def test_eth_estimateGas(self, web3, unlocked_account_dual_type): - gas_estimate = web3.eth.estimateGas({ - 'from': unlocked_account_dual_type, - 'to': unlocked_account_dual_type, - 'value': 1, - }) - assert is_integer(gas_estimate) - assert gas_estimate > 0 - - def test_eth_getBlockByHash(self, web3, empty_block): - block = web3.eth.getBlock(empty_block['hash']) - assert block['hash'] == empty_block['hash'] - - def test_eth_getBlockByHash_not_found(self, web3, empty_block): - block = web3.eth.getBlock(UNKNOWN_HASH) - assert block is None - - def test_eth_getBlockByNumber_with_integer(self, web3, empty_block): - block = web3.eth.getBlock(empty_block['number']) - assert block['number'] == empty_block['number'] - - def test_eth_getBlockByNumber_latest(self, web3, empty_block): - current_block_number = web3.eth.blockNumber - block = web3.eth.getBlock('latest') - assert block['number'] == current_block_number - - def test_eth_getBlockByNumber_not_found(self, web3, empty_block): - block = web3.eth.getBlock(12345) - assert block is None - - def test_eth_getBlockByNumber_pending(self, web3, empty_block): - current_block_number = web3.eth.blockNumber - block = web3.eth.getBlock('pending') - assert block['number'] == current_block_number + 1 - - def test_eth_getBlockByNumber_earliest(self, web3, empty_block): - genesis_block = web3.eth.getBlock(0) - block = web3.eth.getBlock('earliest') - assert block['number'] == 0 - assert block['hash'] == genesis_block['hash'] - - def test_eth_getBlockByNumber_full_transactions(self, web3, block_with_txn): - block = web3.eth.getBlock(block_with_txn['number'], True) - transaction = block['transactions'][0] - assert transaction['hash'] == block_with_txn['transactions'][0] - - def test_eth_getTransactionByHash(self, web3, mined_txn_hash): - transaction = web3.eth.getTransaction(mined_txn_hash) - assert is_dict(transaction) - assert transaction['hash'] == HexBytes(mined_txn_hash) - - def test_eth_getTransactionByHash_contract_creation(self, - web3, - math_contract_deploy_txn_hash): - transaction = web3.eth.getTransaction(math_contract_deploy_txn_hash) - assert is_dict(transaction) - assert transaction['to'] is None, "to field is %r" % transaction['to'] - - def test_eth_getTransactionFromBlockHashAndIndex(self, web3, block_with_txn, mined_txn_hash): - transaction = web3.eth.getTransactionFromBlock(block_with_txn['hash'], 0) - assert is_dict(transaction) - assert transaction['hash'] == HexBytes(mined_txn_hash) - - def test_eth_getTransactionFromBlockNumberAndIndex(self, web3, block_with_txn, mined_txn_hash): - transaction = web3.eth.getTransactionFromBlock(block_with_txn['number'], 0) - assert is_dict(transaction) - assert transaction['hash'] == HexBytes(mined_txn_hash) - - def test_eth_getTransactionByBlockHashAndIndex(self, web3, block_with_txn, mined_txn_hash): - transaction = web3.eth.getTransactionByBlock(block_with_txn['hash'], 0) - assert is_dict(transaction) - assert transaction['hash'] == HexBytes(mined_txn_hash) - - def test_eth_getTransactionByBlockNumberAndIndex(self, web3, block_with_txn, mined_txn_hash): - transaction = web3.eth.getTransactionByBlock(block_with_txn['number'], 0) - assert is_dict(transaction) - assert transaction['hash'] == HexBytes(mined_txn_hash) - - def test_eth_getTransactionReceipt_mined(self, web3, block_with_txn, mined_txn_hash): - receipt = web3.eth.getTransactionReceipt(mined_txn_hash) - assert is_dict(receipt) - assert receipt['blockNumber'] == block_with_txn['number'] - assert receipt['blockHash'] == block_with_txn['hash'] - assert receipt['transactionIndex'] == 0 - assert receipt['transactionHash'] == HexBytes(mined_txn_hash) - - def test_eth_getTransactionReceipt_unmined(self, web3, unlocked_account_dual_type): - txn_hash = web3.eth.sendTransaction({ - 'from': unlocked_account_dual_type, - 'to': unlocked_account_dual_type, - 'value': 1, - 'gas': 21000, - 'gasPrice': web3.eth.gasPrice, - }) - receipt = web3.eth.getTransactionReceipt(txn_hash) - assert receipt is None - - def test_eth_getTransactionReceipt_with_log_entry(self, - web3, - block_with_txn_with_log, - emitter_contract, - txn_hash_with_log): - receipt = web3.eth.getTransactionReceipt(txn_hash_with_log) - assert is_dict(receipt) - assert receipt['blockNumber'] == block_with_txn_with_log['number'] - assert receipt['blockHash'] == block_with_txn_with_log['hash'] - assert receipt['transactionIndex'] == 0 - assert receipt['transactionHash'] == HexBytes(txn_hash_with_log) - - assert len(receipt['logs']) == 1 - log_entry = receipt['logs'][0] - - assert log_entry['blockNumber'] == block_with_txn_with_log['number'] - assert log_entry['blockHash'] == block_with_txn_with_log['hash'] - assert log_entry['logIndex'] == 0 - assert is_same_address(log_entry['address'], emitter_contract.address) - assert log_entry['transactionIndex'] == 0 - assert log_entry['transactionHash'] == HexBytes(txn_hash_with_log) - - def test_eth_getUncleByBlockHashAndIndex(self, web3): - # TODO: how do we make uncles.... - pass - - def test_eth_getUncleByBlockNumberAndIndex(self, web3): - # TODO: how do we make uncles.... - pass - - def test_eth_getCompilers(self, web3): - # TODO: do we want to test this? - pass - - def test_eth_compileSolidity(self, web3): - # TODO: do we want to test this? - pass - - def test_eth_compileLLL(self, web3): - # TODO: do we want to test this? - pass - - def test_eth_compileSerpent(self, web3): - # TODO: do we want to test this? - pass - - def test_eth_newFilter(self, web3): - filter = web3.eth.filter({}) - - changes = web3.eth.getFilterChanges(filter.filter_id) - assert is_list_like(changes) - assert not changes - - logs = web3.eth.getFilterLogs(filter.filter_id) - assert is_list_like(logs) - assert not logs - - result = web3.eth.uninstallFilter(filter.filter_id) - assert result is True - - def test_eth_newBlockFilter(self, web3): - filter = web3.eth.filter('latest') - assert is_string(filter.filter_id) - - changes = web3.eth.getFilterChanges(filter.filter_id) - assert is_list_like(changes) - assert not changes - - # TODO: figure out why this fails in go-ethereum - # logs = web3s.eth.getFilterLogs(filter.filter_id) - # assert is_list_like(logs) - # assert not logs - - result = web3.eth.uninstallFilter(filter.filter_id) - assert result is True - - def test_eth_newPendingTransactionFilter(self, web3): - filter = web3.eth.filter('pending') - assert is_string(filter.filter_id) - - changes = web3.eth.getFilterChanges(filter.filter_id) - assert is_list_like(changes) - assert not changes - - # TODO: figure out why this fails in go-ethereum - # logs = web3s.eth.getFilterLogs(filter.filter_id) - # assert is_list_like(logs) - # assert not logs - - result = web3.eth.uninstallFilter(filter.filter_id) - assert result is True - - def test_eth_getLogs_without_logs(self, web3, block_with_txn_with_log): - # Test with block range - - filter_params = { - "fromBlock": 0, - "toBlock": block_with_txn_with_log['number'] - 1, - } - result = web3.eth.getLogs(filter_params) - assert len(result) == 0 - - # the range is wrong - filter_params = { - "fromBlock": block_with_txn_with_log['number'], - "toBlock": block_with_txn_with_log['number'] - 1, - } - result = web3.eth.getLogs(filter_params) - assert len(result) == 0 - - # Test with `address` - - # filter with other address - filter_params = { - "fromBlock": 0, - "address": UNKNOWN_ADDRESS, - } - result = web3.eth.getLogs(filter_params) - assert len(result) == 0 - - # Test with multiple `address` - - # filter with other address - filter_params = { - "fromBlock": 0, - "address": [UNKNOWN_ADDRESS, UNKNOWN_ADDRESS], - } - result = web3.eth.getLogs(filter_params) - assert len(result) == 0 - - def test_eth_getLogs_with_logs( - self, - web3, - block_with_txn_with_log, - emitter_contract_address, - txn_hash_with_log): - - def assert_contains_log(result): - assert len(result) == 1 - log_entry = result[0] - assert log_entry['blockNumber'] == block_with_txn_with_log['number'] - assert log_entry['blockHash'] == block_with_txn_with_log['hash'] - assert log_entry['logIndex'] == 0 - assert is_same_address(log_entry['address'], emitter_contract_address) - assert log_entry['transactionIndex'] == 0 - assert log_entry['transactionHash'] == HexBytes(txn_hash_with_log) - - # Test with block range - - # the range includes the block where the log resides in - filter_params = { - "fromBlock": block_with_txn_with_log['number'], - "toBlock": block_with_txn_with_log['number'], - } - result = web3.eth.getLogs(filter_params) - assert_contains_log(result) - - # specify only `from_block`. by default `to_block` should be 'latest' - filter_params = { - "fromBlock": 0, - } - result = web3.eth.getLogs(filter_params) - assert_contains_log(result) - - # Test with `address` - - # filter with emitter_contract.address - filter_params = { - "fromBlock": 0, - "address": emitter_contract_address, - } - - def test_eth_getLogs_with_logs_topic_args( - self, - web3, - block_with_txn_with_log, - emitter_contract_address, - txn_hash_with_log): - def assert_contains_log(result): - assert len(result) == 1 - log_entry = result[0] - assert log_entry['blockNumber'] == block_with_txn_with_log['number'] - assert log_entry['blockHash'] == block_with_txn_with_log['hash'] - assert log_entry['logIndex'] == 0 - assert is_same_address(log_entry['address'], emitter_contract_address) - assert log_entry['transactionIndex'] == 0 - assert log_entry['transactionHash'] == HexBytes(txn_hash_with_log) - - # Test with None event sig - - filter_params = { - "fromBlock": 0, - "topics": [ - None, - '0x000000000000000000000000000000000000000000000000000000000000d431'], - } - - result = web3.eth.getLogs(filter_params) - assert_contains_log(result) - - # Test with None indexed arg - filter_params = { - "fromBlock": 0, - "topics": [ - '0x057bc32826fbe161da1c110afcdcae7c109a8b69149f727fc37a603c60ef94ca', - None], - } - result = web3.eth.getLogs(filter_params) - assert_contains_log(result) - - def test_eth_getLogs_with_logs_none_topic_args( - self, - web3): - # Test with None overflowing - filter_params = { - "fromBlock": 0, - "topics": [None, None, None], - } - - result = web3.eth.getLogs(filter_params) - assert len(result) == 0 - - def test_eth_call_old_contract_state(self, web3, math_contract, unlocked_account): - start_block = web3.eth.getBlock('latest') - block_num = start_block.number - block_hash = start_block.hash - - math_contract.functions.increment().transact({'from': unlocked_account}) - - # This isn't an incredibly convincing test since we can't mine, and - # the default resolved block is latest, So if block_identifier was ignored - # we would get the same result. For now, we mostly depend on core tests. - # Ideas to improve this test: - # - Enable on-demand mining in more clients - # - Increment the math contract in all of the fixtures, and check the value in an old block - block_hash_call_result = math_contract.functions.counter().call(block_identifier=block_hash) - block_num_call_result = math_contract.functions.counter().call(block_identifier=block_num) - latest_call_result = math_contract.functions.counter().call(block_identifier='latest') - default_call_result = math_contract.functions.counter().call() - pending_call_result = math_contract.functions.counter().call(block_identifier='pending') - - assert block_hash_call_result == 0 - assert block_num_call_result == 0 - assert latest_call_result == 0 - assert default_call_result == 0 - - if pending_call_result != 1: - raise AssertionError("pending call result was %d instead of 1" % pending_call_result) - - def test_eth_uninstallFilter(self, web3): - filter = web3.eth.filter({}) - assert is_string(filter.filter_id) - - success = web3.eth.uninstallFilter(filter.filter_id) - assert success is True - - failure = web3.eth.uninstallFilter(filter.filter_id) - assert failure is False diff --git a/web3s/utils/module_testing/math_contract.py b/web3s/utils/module_testing/math_contract.py deleted file mode 100644 index 7f8173a..0000000 --- a/web3s/utils/module_testing/math_contract.py +++ /dev/null @@ -1,91 +0,0 @@ - -MATH_BYTECODE = ( - "606060405261022e806100126000396000f360606040523615610074576000357c01000000000000" - "000000000000000000000000000000000000000000009004806316216f391461007657806361bc22" - "1a146100995780637cf5dab0146100bc578063a5f3c23b146100e8578063d09de08a1461011d5780" - "63dcf537b11461014057610074565b005b610083600480505061016c565b60405180828152602001" - "91505060405180910390f35b6100a6600480505061017f565b604051808281526020019150506040" - "5180910390f35b6100d26004808035906020019091905050610188565b6040518082815260200191" - "505060405180910390f35b61010760048080359060200190919080359060200190919050506101ea" - "565b6040518082815260200191505060405180910390f35b61012a6004805050610201565b604051" - "8082815260200191505060405180910390f35b610156600480803590602001909190505061021756" - "5b6040518082815260200191505060405180910390f35b6000600d9050805080905061017c565b90" - "565b60006000505481565b6000816000600082828250540192505081905550600060005054905080" - "507f3496c3ede4ec3ab3686712aa1c238593ea6a42df83f98a5ec7df9834cfa577c5816040518082" - "815260200191505060405180910390a18090506101e5565b919050565b6000818301905080508090" - "506101fb565b92915050565b600061020d6001610188565b9050610214565b90565b600060078202" - "90508050809050610229565b91905056" -) - - -MATH_ABI = [ - { - "constant": False, - "inputs": [], - "name": "return13", - "outputs": [ - {"name": "result", "type": "int256"}, - ], - "type": "function", - }, - { - "constant": True, - "inputs": [], - "name": "counter", - "outputs": [ - {"name": "", "type": "uint256"}, - ], - "type": "function", - }, - { - "constant": False, - "inputs": [ - {"name": "amt", "type": "uint256"}, - ], - "name": "increment", - "outputs": [ - {"name": "result", "type": "uint256"}, - ], - "type": "function", - }, - { - "constant": False, - "inputs": [ - {"name": "a", "type": "int256"}, - {"name": "b", "type": "int256"}, - ], - "name": "add", - "outputs": [ - {"name": "result", "type": "int256"}, - ], - "type": "function", - }, - { - "constant": False, - "inputs": [], - "name": "increment", - "outputs": [ - {"name": "", "type": "uint256"}, - ], - "type": "function" - }, - { - "constant": False, - "inputs": [ - {"name": "a", "type": "int256"}, - ], - "name": "multiply7", - "outputs": [ - {"name": "result", "type": "int256"}, - ], - "type": "function", - }, - { - "anonymous": False, - "inputs": [ - {"indexed": False, "name": "value", "type": "uint256"}, - ], - "name": "Increased", - "type": "event", - }, -] diff --git a/web3s/utils/module_testing/net_module.py b/web3s/utils/module_testing/net_module.py deleted file mode 100644 index 3ce095a..0000000 --- a/web3s/utils/module_testing/net_module.py +++ /dev/null @@ -1,23 +0,0 @@ -from eth_utils import ( - is_boolean, - is_integer, - is_string, -) - - -class NetModuleTest: - def test_net_version(self, web3): - version = web3.net.version - - assert is_string(version) - assert version.isdigit() - - def test_net_listening(self, web3): - listening = web3.net.listening - - assert is_boolean(listening) - - def test_net_peerCount(self, web3): - peer_count = web3.net.peerCount - - assert is_integer(peer_count) diff --git a/web3s/utils/module_testing/parity_module.py b/web3s/utils/module_testing/parity_module.py deleted file mode 100644 index d1bc9c3..0000000 --- a/web3s/utils/module_testing/parity_module.py +++ /dev/null @@ -1,89 +0,0 @@ -import pytest - -from eth_utils import ( - add_0x_prefix, -) - -from web3s.utils.formatters import ( - hex_to_integer, -) - - -class ParityModuleTest: - - def test_trace_replay_transaction(self, web3, parity_fixture_data): - trace = web3.parity.traceReplayTransaction(parity_fixture_data['mined_txn_hash']) - - assert trace['stateDiff'] is None - assert trace['vmTrace'] is None - assert trace['trace'][0]['action']['from'] == add_0x_prefix(parity_fixture_data['coinbase']) - - def test_trace_replay_block_with_transactions(self, - web3, - block_with_txn, - parity_fixture_data): - trace = web3.parity.traceReplayBlockTransactions(block_with_txn['number']) - assert len(trace) > 0 - trace_0_action = trace[0]['trace'][0]['action'] - assert trace_0_action['from'] == add_0x_prefix(parity_fixture_data['coinbase']) - - def test_trace_replay_block_without_transactions(self, web3, empty_block): - trace = web3.parity.traceReplayBlockTransactions(empty_block['number']) - assert len(trace) == 0 - - def test_trace_block(self, web3, block_with_txn): - trace = web3.parity.traceBlock(block_with_txn['number']) - assert trace[0]['blockNumber'] == block_with_txn['number'] - - def test_trace_transaction(self, web3, parity_fixture_data): - trace = web3.parity.traceTransaction(parity_fixture_data['mined_txn_hash']) - assert trace[0]['action']['from'] == add_0x_prefix(parity_fixture_data['coinbase']) - - def test_trace_call(self, web3, math_contract, math_contract_address): - coinbase = web3.eth.coinbase - txn_params = math_contract._prepare_transaction( - fn_name='add', - fn_args=(7, 11), - transaction={'from': coinbase, 'to': math_contract_address}, - ) - trace = web3.parity.traceCall(txn_params) - assert trace['stateDiff'] is None - assert trace['vmTrace'] is None - result = hex_to_integer(trace['output']) - assert result == 18 - - def test_eth_call_with_0_result(self, web3, math_contract, math_contract_address): - coinbase = web3.eth.coinbase - txn_params = math_contract._prepare_transaction( - fn_name='add', - fn_args=(0, 0), - transaction={'from': coinbase, 'to': math_contract_address}, - ) - trace = web3.parity.traceCall(txn_params) - assert trace['stateDiff'] is None - assert trace['vmTrace'] is None - result = hex_to_integer(trace['output']) - assert result == 0 - - @pytest.mark.parametrize( - 'raw_transaction', - [ - ( - # address 0x39EEed73fb1D3855E90Cbd42f348b3D7b340aAA6 - '0xf8648085174876e8008252089439eeed73fb1d3855e90cbd42f348b3d7b340aaa601801ba0ec1295f00936acd0c2cb90ab2cdaacb8bf5e11b3d9957833595aca9ceedb7aada05dfc8937baec0e26029057abd3a1ef8c505dca2cdc07ffacb046d090d2bea06a' # noqa: E501 - ), - ] - ) - def test_trace_raw_transaction(self, - web3, - raw_transaction, - funded_account_for_raw_txn): - trace = web3.parity.traceRawTransaction(raw_transaction) - assert trace['stateDiff'] is None - assert trace['vmTrace'] is None - assert trace['trace'][0]['action']['from'] == funded_account_for_raw_txn.lower() - - def test_trace_filter(self, web3, txn_filter_params, parity_fixture_data): - trace = web3.parity.traceFilter(txn_filter_params) - assert isinstance(trace, list) - assert trace[0]['action']['from'] == add_0x_prefix(parity_fixture_data['coinbase']) diff --git a/web3s/utils/module_testing/personal_module.py b/web3s/utils/module_testing/personal_module.py deleted file mode 100644 index 632f809..0000000 --- a/web3s/utils/module_testing/personal_module.py +++ /dev/null @@ -1,81 +0,0 @@ -from eth_utils import ( - is_checksum_address, - is_list_like, - is_same_address, -) - -PRIVATE_KEY_HEX = '0x56ebb41875ceedd42e395f730e03b5c44989393c9f0484ee6bc05f933673458f' -PASSWORD = 'web3s-testing' -ADDRESS = '0x844B417c0C58B02c2224306047B9fb0D3264fE8c' - - -PRIVATE_KEY_FOR_UNLOCK = '0x392f63a79b1ff8774845f3fa69de4a13800a59e7083f5187f1558f0797ad0f01' -ACCOUNT_FOR_UNLOCK = '0x12efDc31B1a8FA1A1e756DFD8A1601055C971E13' - - -class PersonalModuleTest: - def test_personal_importRawKey(self, web3): - actual = web3.personal.importRawKey(PRIVATE_KEY_HEX, PASSWORD) - assert actual == ADDRESS - - def test_personal_listAccounts(self, web3): - accounts = web3.personal.listAccounts - assert is_list_like(accounts) - assert len(accounts) > 0 - assert all(( - is_checksum_address(item) - for item - in accounts - )) - - def test_personal_lockAccount(self, web3, unlockable_account_dual_type): - # TODO: how do we test this better? - web3.personal.lockAccount(unlockable_account_dual_type) - - def test_personal_unlockAccount_success(self, - web3, - unlockable_account_dual_type, - unlockable_account_pw): - result = web3.personal.unlockAccount(unlockable_account_dual_type, unlockable_account_pw) - assert result is True - - def test_personal_unlockAccount_failure(self, - web3, - unlockable_account_dual_type): - result = web3.personal.unlockAccount(unlockable_account_dual_type, 'bad-password') - assert result is False - - def test_personal_newAccount(self, web3): - new_account = web3.personal.newAccount(PASSWORD) - assert is_checksum_address(new_account) - - def test_personal_sendTransaction(self, - web3, - unlockable_account_dual_type, - unlockable_account_pw): - assert web3.eth.getBalance(unlockable_account_dual_type) > web3.toWei(1, 'ether') - txn_params = { - 'from': unlockable_account_dual_type, - 'to': unlockable_account_dual_type, - 'gas': 21000, - 'value': 1, - 'gasPrice': web3.toWei(1, 'gwei'), - } - txn_hash = web3.personal.sendTransaction(txn_params, unlockable_account_pw) - assert txn_hash - transaction = web3.eth.getTransaction(txn_hash) - - assert is_same_address(transaction['from'], txn_params['from']) - assert is_same_address(transaction['to'], txn_params['to']) - assert transaction['gas'] == txn_params['gas'] - assert transaction['value'] == txn_params['value'] - assert transaction['gasPrice'] == txn_params['gasPrice'] - - def test_personal_sign_and_ecrecover(self, - web3, - unlockable_account_dual_type, - unlockable_account_pw): - message = 'test-web3s-personal-sign' - signature = web3.personal.sign(message, unlockable_account_dual_type, unlockable_account_pw) - signer = web3.personal.ecRecover(message, signature) - assert is_same_address(signer, unlockable_account_dual_type) diff --git a/web3s/utils/module_testing/version_module.py b/web3s/utils/module_testing/version_module.py deleted file mode 100644 index c8c786e..0000000 --- a/web3s/utils/module_testing/version_module.py +++ /dev/null @@ -1,17 +0,0 @@ -from eth_utils import ( - is_string, -) - - -class VersionModuleTest: - def test_net_version(self, web3): - version = web3.version.network - - assert is_string(version) - assert version.isdigit() - - def test_eth_protocolVersion(self, web3): - protocol_version = web3.version.ethereum - - assert is_string(protocol_version) - assert protocol_version.isdigit() diff --git a/web3s/utils/module_testing/web3_module.py b/web3s/utils/module_testing/web3_module.py deleted file mode 100644 index db2117e..0000000 --- a/web3s/utils/module_testing/web3_module.py +++ /dev/null @@ -1,217 +0,0 @@ -import pytest - -from hexbytes import ( - HexBytes, -) - -from web3s import Web3 -from web3s.exceptions import ( - InvalidAddress, -) -from web3s.utils.ens import ( - ens_addresses, -) - - -class Web3ModuleTest: - def test_web3_clientVersion(self, web3): - client_version = web3.version.node - self._check_web3_clientVersion(client_version) - - def _check_web3_clientVersion(self, client_version): - raise NotImplementedError("Must be implemented by subclasses") - - # Contract that calculated test values can be found at - # https://kovan.etherscan.io/address/0xb9be06f5b99372cf9afbccadbbb9954ccaf7f4bb#code - @pytest.mark.parametrize( - 'types,values,expected', - ( - ( - ['bool'], - [True], - HexBytes("0x5fe7f977e71dba2ea1a68e21057beebb9be2ac30c6410aa38d4f3fbe41dcffd2"), - ), - ( - ['uint8', 'uint8', 'uint8'], - [97, 98, 99], - HexBytes("0x4e03657aea45a94fc7d47ba826c8d667c0d1e6e33a64a036ec44f58fa12d6c45"), - ), - ( - ['uint248'], - [30], - HexBytes("0x30f95d210785601eb33ae4d53d405b26f920e765dff87cca8e9a4aec99f82671"), - ), - ( - ['bool', 'uint16'], - [True, 299], - HexBytes("0xed18599ccd80ee9fae9a28b0e34a5573c3233d7468f808fd659bc171cf0b43bd"), - ), - ( - ['int256'], - [-10], - HexBytes("0xd6fb717f7e270a360f5093ce6a7a3752183e89c9a9afe5c0cb54b458a304d3d5"), - ), - ( - ['int256'], - [10], - HexBytes("0xc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a8"), - ), - ( - ['int8', 'uint8'], - [-10, 18], - HexBytes("0x5c6ab1e634c08d9c0f4df4d789e8727943ef010dd7ca8e3c89de197a26d148be"), - ), - ( - ['address'], - ["0x49eddd3769c0712032808d86597b84ac5c2f5614"], - InvalidAddress, - ), - ( - ['address'], - ["0x49EdDD3769c0712032808D86597B84ac5c2F5614"], - HexBytes("0x2ff37b5607484cd4eecf6d13292e22bd6e5401eaffcc07e279583bc742c68882"), - ), - ( - ['bytes2'], - ['0x5402'], - HexBytes("0x4ed9171bda52fca71ab28e7f452bd6eacc3e5a568a47e0fa53b503159a9b8910"), - ), - ( - ['bytes3'], - ['0x5402'], - HexBytes("0x4ed9171bda52fca71ab28e7f452bd6eacc3e5a568a47e0fa53b503159a9b8910"), - ), - ( - ['bytes'], - [ - '0x636865636b6c6f6e6762797465737472696e676167' - '61696e7374736f6c6964697479736861336861736866756e6374696f6e' - ], - HexBytes("0xd78a84d65721b67e4011b10c99dafdedcdcd7cb30153064f773e210b4762e22f"), - ), - ( - ['string'], - ['testing a string!'], - HexBytes("0xe8c275c0b4070a5ec6cfcb83f0ba394b30ddd283de785d43f2eabfb04bd96747"), - ), - ( - ['string', 'bool', 'uint16', 'bytes2', 'address'], - [ - 'testing a string!', - False, - 299, - '0x5402', - "0x49eddd3769c0712032808d86597b84ac5c2f5614", - ], - InvalidAddress, - ), - ( - ['string', 'bool', 'uint16', 'bytes2', 'address'], - [ - 'testing a string!', - False, - 299, - '0x5402', - "0x49EdDD3769c0712032808D86597B84ac5c2F5614", - ], - HexBytes("0x8cc6eabb25b842715e8ca39e2524ed946759aa37bfb7d4b81829cf5a7e266103"), - ), - ( - ['bool[2][]'], - [[[True, False], [False, True]]], - HexBytes("0x1eef261f2eb51a8c736d52be3f91ff79e78a9ec5df2b7f50d0c6f98ed1e2bc06"), - ), - ( - ['bool[]'], - [[True, False, True]], - HexBytes("0x5c6090c0461491a2941743bda5c3658bf1ea53bbd3edcde54e16205e18b45792"), - ), - ( - ['uint24[]'], - [[1, 0, 1]], - HexBytes("0x5c6090c0461491a2941743bda5c3658bf1ea53bbd3edcde54e16205e18b45792"), - ), - ( - ['uint8[2]'], - [[8, 9]], - HexBytes("0xc7694af312c4f286114180fd0ba6a52461fcee8a381636770b19a343af92538a"), - ), - ( - ['uint256[2]'], - [[8, 9]], - HexBytes("0xc7694af312c4f286114180fd0ba6a52461fcee8a381636770b19a343af92538a"), - ), - ( - ['uint8[]'], - [[8]], - HexBytes("0xf3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee3"), - ), - ( - ['address[]'], - [[ - "0x49EdDD3769c0712032808D86597B84ac5c2F5614", - "0xA6b759bBbf4B59D24acf7E06e79f3a5D104fdCE5", - ]], - HexBytes("0xb98565c0c26a962fd54d93b0ed6fb9296e03e9da29d2281ed3e3473109ef7dde"), - ), - ( - ['address[]'], - [[ - "0x49EdDD3769c0712032808D86597B84ac5c2F5614", - "0xa6b759bbbf4b59d24acf7e06e79f3a5d104fdce5", - ]], - InvalidAddress, - ), - ), - ) - def test_soliditySha3(self, web3, types, values, expected): - if isinstance(expected, type) and issubclass(expected, Exception): - with pytest.raises(expected): - web3.soliditySha3(types, values) - return - - actual = web3.soliditySha3(types, values) - assert actual == expected - - @pytest.mark.parametrize( - 'types, values, expected', - ( - ( - ['address'], - ['one.eth'], - HexBytes("0x2ff37b5607484cd4eecf6d13292e22bd6e5401eaffcc07e279583bc742c68882"), - ), - ( - ['address[]'], - [['one.eth', 'two.eth']], - HexBytes("0xb98565c0c26a962fd54d93b0ed6fb9296e03e9da29d2281ed3e3473109ef7dde"), - ), - ), - ) - def test_soliditySha3_ens(self, web3, types, values, expected): - with ens_addresses(web3, { - 'one.eth': "0x49EdDD3769c0712032808D86597B84ac5c2F5614", - 'two.eth': "0xA6b759bBbf4B59D24acf7E06e79f3a5D104fdCE5", - }): - # when called as class method, any name lookup attempt will fail - with pytest.raises(InvalidAddress): - Web3.soliditySha3(types, values) - - # when called as instance method method, ens lookups can succeed - actual = web3.soliditySha3(types, values) - assert actual == expected - - @pytest.mark.parametrize( - 'types,values', - ( - (['address'], ['0xA6b759bBbf4B59D24acf7E06e79f3a5D104fdCE5', True]), - (['address', 'bool'], ['0xA6b759bBbf4B59D24acf7E06e79f3a5D104fdCE5']), - ([], ['0xA6b759bBbf4B59D24acf7E06e79f3a5D104fdCE5']), - ) - ) - def test_soliditySha3_same_number_of_types_and_values(self, web3, types, values): - with pytest.raises(ValueError): - web3.soliditySha3(types, values) - - def test_is_connected(self, web3): - assert web3.isConnected() diff --git a/web3s/utils/normalizers.py b/web3s/utils/normalizers.py index 8896a59..1fb920e 100644 --- a/web3s/utils/normalizers.py +++ b/web3s/utils/normalizers.py @@ -30,11 +30,10 @@ to_hex, to_text, ) -from web3s.utils.ens import ( - StaticENS, - is_ens_name, - validate_name_has_address, -) + + + + from web3s.utils.toolz import ( curry, ) @@ -131,28 +130,7 @@ def abi_address_to_hex(abi_type, data): return abi_type, to_checksum_address(data) -@curry -def abi_ens_resolver(w3, abi_type, val): - if abi_type == 'address' and is_ens_name(val): - if w3 is None: - raise InvalidAddress( - "Could not look up name %r because no web3s" - " connection available" % (val) - ) - elif w3.ens is None: - raise InvalidAddress( - "Could not look up name %r because ENS is" - " set to None" % (val) - ) - elif int(w3.net.version) is not 1 and not isinstance(w3.ens, StaticENS): - raise InvalidAddress( - "Could not look up name %r because web3s is" - " not connected to mainnet" % (val) - ) - else: - return (abi_type, validate_name_has_address(w3.ens, val)) - else: - return (abi_type, val) + BASE_RETURN_NORMALIZERS = [ @@ -176,12 +154,9 @@ def normalize_abi(abi): return abi -def normalize_address(ens, address): +def normalize_address( address): if address: - if is_ens_name(address): - validate_name_has_address(ens, address) - else: - validate_address(address) + validate_address(address) return address diff --git a/web3s/utils/six/__pycache__/__init__.cpython-36.pyc b/web3s/utils/six/__pycache__/__init__.cpython-36.pyc deleted file mode 100644 index ef4478e..0000000 Binary files a/web3s/utils/six/__pycache__/__init__.cpython-36.pyc and /dev/null differ diff --git a/web3s/utils/six/__pycache__/__init__.cpython-37.pyc b/web3s/utils/six/__pycache__/__init__.cpython-37.pyc deleted file mode 100644 index 99e6ef8..0000000 Binary files a/web3s/utils/six/__pycache__/__init__.cpython-37.pyc and /dev/null differ diff --git a/web3s/utils/six/__pycache__/six.cpython-36.pyc b/web3s/utils/six/__pycache__/six.cpython-36.pyc deleted file mode 100644 index 85d873e..0000000 Binary files a/web3s/utils/six/__pycache__/six.cpython-36.pyc and /dev/null differ diff --git a/web3s/utils/six/__pycache__/six.cpython-37.pyc b/web3s/utils/six/__pycache__/six.cpython-37.pyc deleted file mode 100644 index 4902825..0000000 Binary files a/web3s/utils/six/__pycache__/six.cpython-37.pyc and /dev/null differ diff --git a/web3s/utils/toolz/__pycache__/__init__.cpython-36.pyc b/web3s/utils/toolz/__pycache__/__init__.cpython-36.pyc deleted file mode 100644 index a09bfe1..0000000 Binary files a/web3s/utils/toolz/__pycache__/__init__.cpython-36.pyc and /dev/null differ diff --git a/web3s/utils/toolz/__pycache__/__init__.cpython-37.pyc b/web3s/utils/toolz/__pycache__/__init__.cpython-37.pyc deleted file mode 100644 index 5333ef5..0000000 Binary files a/web3s/utils/toolz/__pycache__/__init__.cpython-37.pyc and /dev/null differ diff --git a/web3s/utils/toolz/__pycache__/curried.cpython-36.pyc b/web3s/utils/toolz/__pycache__/curried.cpython-36.pyc deleted file mode 100644 index 4d71a23..0000000 Binary files a/web3s/utils/toolz/__pycache__/curried.cpython-36.pyc and /dev/null differ diff --git a/web3s/utils/toolz/__pycache__/curried.cpython-37.pyc b/web3s/utils/toolz/__pycache__/curried.cpython-37.pyc deleted file mode 100644 index e14c374..0000000 Binary files a/web3s/utils/toolz/__pycache__/curried.cpython-37.pyc and /dev/null differ