mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-23 12:50:22 +08:00
BUG: fix incompatibility with web3==4.0.0b11
This commit is contained in:
@@ -40,13 +40,6 @@ else:
|
||||
|
||||
log = logbook.Logger('Marketplace', level=LOG_LEVEL)
|
||||
|
||||
def first_line_from_url(url):
|
||||
request = urllib.urlopen(url)
|
||||
first_line = request.readline()
|
||||
if sys.version_info.major >= 3:
|
||||
charset = request.info().get_content_charset()
|
||||
first_line = first_line.decode(charset)
|
||||
return first_line.strip()
|
||||
|
||||
class Marketplace:
|
||||
def __init__(self):
|
||||
@@ -65,7 +58,8 @@ class Marketplace:
|
||||
self.web3 = Web3(HTTPProvider(ETH_REMOTE_NODE))
|
||||
|
||||
self.mkt_contract_address = Web3.toChecksumAddress(
|
||||
first_line_from_url(MARKETPLACE_CONTRACT))
|
||||
contract_url.readline().decode(
|
||||
contract_url.info().get_content_charset()).strip())
|
||||
|
||||
abi_url = urllib.urlopen(MARKETPLACE_CONTRACT_ABI)
|
||||
abi = json.load(abi_url)
|
||||
@@ -76,7 +70,8 @@ class Marketplace:
|
||||
)
|
||||
|
||||
self.eng_contract_address = Web3.toChecksumAddress(
|
||||
first_line_from_url(ENIGMA_CONTRACT))
|
||||
contract_url.readline().decode(
|
||||
contract_url.info().get_content_charset()).strip())
|
||||
|
||||
abi_url = urllib.urlopen(ENIGMA_CONTRACT_ABI)
|
||||
abi = json.load(abi_url)
|
||||
|
||||
Reference in New Issue
Block a user