def test_events(secret_registry_contract, event_handler): secret = b'secretsecretsecretsecretsecretse' secrethash = Web3.sha3(secret) ev_handler = event_handler(secret_registry_contract) txn_hash = secret_registry_contract.functions.registerSecret(secret).transact() ev_handler.add(txn_hash, EVENT_SECRET_REVEALED, check_secret_revealed(secrethash, secret)) ev_handler.check()
def test_events(secret_registry, event_handler): secret = b'secretsecretsecretsecretsecretse' secrethash = Web3.sha3(secret) ev_handler = event_handler(secret_registry) txn_hash = secret_registry.transact().registerSecret(secret) ev_handler.add(txn_hash, E_SECRET_REVEALED, check_secret_revealed(secrethash)) ev_handler.check()
def test_events(secret_registry_contract: Contract, event_handler: Callable) -> None: """ A successful registerSecret() call causes an EVENT_SECRET_REVEALED event """ secret = b"secretsecretsecretsecretsecretse" secrethash = sha256(secret).digest() ev_handler = event_handler(secret_registry_contract) txn_hash = secret_registry_contract.functions.registerSecret(secret).call_and_transact() ev_handler.add(txn_hash, EVENT_SECRET_REVEALED, check_secret_revealed(secrethash, secret)) ev_handler.check()