【发布时间】:2018-09-05 19:35:21
【问题描述】:
所以我已经连接到一个合同,这似乎工作正常,我正在尝试使用这个类:来自https://web3py.readthedocs.io/en/stable/web3.personal.html 的 web3.personal.Personal 我似乎不明白我错了什么......当我 print(web3.personal.Personal) 给我一个类对象但我似乎无法使用与这个类相关的任何函数时,说我缺少“self”参数
contract_abi = my_abi
w3 = Web3(HTTPProvider(myurl))
myContract = w3.eth.contract(address ,abi)
ref = ref = web3.personal.Personal('web3')
print(ref) #this works
print(ref.newAccount(password='the-passphrase')) #This crashes
TypeError: newAccount() missing 1 required positional argument: 'self'
TypeError: 'property' object is not callable
【问题讨论】:
-
你可能需要构造一个
Personal,所以ref = web3.personal.Personal()。 -
实例由
self表示,类不是 -
所以当我执行 web3.personal.Personal 时,我没有收到错误,但是当我执行 web3.personal.Personal() 时,我收到错误...
标签: python django ethereum web3