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 aa6f97922f..a361b7a6af 100644 --- a/integration_tests/test_basic.py +++ b/integration_tests/test_basic.py @@ -427,3 +427,23 @@ def test_message_call(cronos): assert 23828976 == receipt.cumulativeGasUsed assert receipt.status == 1, "shouldn't fail" assert len(receipt.logs) == iterations + + +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" + )