diff --git a/integration_tests/contracts/contracts/TestERC20Utility.sol b/integration_tests/contracts/contracts/TestERC20Utility.sol index 29e9f436dc..e81fcca8ae 100644 --- a/integration_tests/contracts/contracts/TestERC20Utility.sol +++ b/integration_tests/contracts/contracts/TestERC20Utility.sol @@ -27,4 +27,9 @@ contract TestERC20Utility is ERC20 { _burn(msg.sender, total); emit __CronosSendToEthereum(recipient, amount, bridge_fee); } + + function test_log0() public { + bytes32 data = "hello world"; + log0(bytes32(data)); + } } diff --git a/integration_tests/test_basic.py b/integration_tests/test_basic.py index bf7edb0cbd..17655052a5 100644 --- a/integration_tests/test_basic.py +++ b/integration_tests/test_basic.py @@ -218,3 +218,23 @@ def test_statesync(cronos): ) print("succesfully syncing") + + +def test_log0(cluster): + """ + test compliance of empty topics behavior + """ + w3 = cluster.w3 + contract = deploy_contract( + w3, + Path(__file__).parent + / "contracts/artifacts/contracts/TestERC20Utility.sol/TestERC20Utility.json", + ) + tx = contract.functions.test_log0().buildTransaction({"from": ADDRS["validator"]}) + receipt = send_transaction(w3, tx, KEYS["validator"]) + assert len(receipt.logs) == 1 + log = receipt.logs[0] + assert log.topics == [] + assert ( + log.data == "0x68656c6c6f20776f726c64000000000000000000000000000000000000000000" + )