Example #1
0
def test_events(endpoint_registry_contract, get_accounts, event_handler):
    (A, B) = get_accounts(2)
    ev_handler = event_handler(endpoint_registry_contract)

    PORT = '127.0.0.1:38647'
    txn_hash = endpoint_registry_contract.functions.registerEndpoint(PORT).transact({'from': A})

    ev_handler.add(txn_hash, EVENT_ADDRESS_REGISTERED, check_address_registered(A, PORT))
    ev_handler.check()
Example #2
0
def test_events(
    endpoint_registry_contract: Contract, get_accounts: Callable, event_handler: Callable
) -> None:
    """ An endpoint registration causes an EVENT_ADDRESS_REGISTERED event """
    A = get_accounts(1)[0]
    ev_handler = event_handler(endpoint_registry_contract)

    ENDPOINT = "127.0.0.1:38647"
    txn_hash = endpoint_registry_contract.functions.registerEndpoint(ENDPOINT).call_and_transact(
        {"from": A}
    )

    ev_handler.add(txn_hash, EVENT_ADDRESS_REGISTERED, check_address_registered(A, ENDPOINT))
    ev_handler.check()
Example #3
0
def test_events(endpoint_registry_contract, get_accounts, event_handler):
    """ An endpoint registration causes an EVENT_ADDRESS_REGISTERED event """
    (A, B) = get_accounts(2)
    ev_handler = event_handler(endpoint_registry_contract)

    ENDPOINT = '127.0.0.1:38647'
    txn_hash = endpoint_registry_contract.functions.registerEndpoint(
        ENDPOINT, ).transact({'from': A})

    ev_handler.add(txn_hash, EVENT_ADDRESS_REGISTERED,
                   check_address_registered(
                       A,
                       ENDPOINT,
                   ))
    ev_handler.check()