0

here is my Solidity Contract:

# Solidity source code
contract_source_code = '''
pragma solidity ^0.4.1;

contract Identities {

event ExistProduction(bool);
address private owner;
mapping(address => bool) private production;

function Identities() public {
    owner = msg.sender;
}

function setProduction(address id, bool include) public {
    require(msg.sender == owner);
    production[id] = include;
}

function proofProduction(address id) public constant returns (bool) {
    ExistProduction(production[id]);
    return production[id];
}

This is my setting in python with web3.py

# web3.py instance
provider = HTTPProvider('http://127.0.0.1:8000')
w3 = Web3(provider)
w3.middleware_stack.inject(geth_poa_middleware, layer=0)
identitiescontract = w3.eth.contract(abi=contract_interface_identities['abi'],
                                     bytecode=contract_interface_identities['bin'])

tx_identitiescontract = identitiescontract.constructor().transact()

tx_receipt_identities = w3.eth.waitForTransactionReceipt(tx_identitiescontract)

identities_contract = w3.eth.contract(address=tx_receipt_identities.contractAddress,
                                   abi=contract_interface_identities['abi'])

tx_setProduction = identities_contract.functions.setProduction(account2, True).transact()

w3.eth.waitForTransactionReceipt(tx_setProduction)
print("Proof4:")
print(identities_contract.functions.proofProduction(account2).call())

existDesigner_filter = identities_contract.eventFilter('ExistProduction', {'fromBlock':0, 'toBlock': 'latest'})
print(existProduction_filter.get_all_entries())

The Problem is now, that my Event Filter must have some entries but i did not get any entries over there.

Do you know what is the problem and how to solve it ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.