I am using the following code:
provider = HTTPProvider('http://0.0.0.0:9945')
w3 = Web3(provider)
contract = w3.eth.contract(contract_interface['abi'], bytecode=contract_interface['bin'])
tx_hash = contract.deploy(transaction={'from': w3.eth.coinbase, 'gas': 250000})
print (tx_hash)
time.sleep(1)
tx_receipt = w3.eth.getTransactionReceipt(tx_hash)
print (tx_receipt)
contract_address = tx_receipt['contractAddress']
The tx_hash variable is getting a valid valid but tx_receipt is getting none.
The error I am getting is as follows:
contract_address = tx_receipt['contractAddress']
TypeError: 'NoneType' object is not subscriptable
w3.eth.getTransactionReceipt(tx_hash) function returns None
I dont understand why. Please help.