Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Problem: empty topics shouldn't be encoded as nil #839

Closed
yihuang opened this issue Dec 14, 2021 · 0 comments · Fixed by #840
Closed

Problem: empty topics shouldn't be encoded as nil #839

yihuang opened this issue Dec 14, 2021 · 0 comments · Fixed by #840

Comments

@yihuang
Copy link
Contributor

yihuang commented Dec 14, 2021

System info: ethermint main

Steps to reproduce:

    function test_log0() public {
        bytes memory data = "hello world";
        assembly {
            log0(data, 11)
        }
    }
  • use log0 to emit a log without topics
  • use web3.py to fetch tx receipt
  • it complains: "Could not format invalid type of None for field 'topics'", because rpc API return topics as None, rather than [].

Expected behavior: empty topics return as []

Actual behavior: empty topics return as null

Additional info:

yihuang added a commit to yihuang/ethermint that referenced this issue Dec 14, 2021
Closes: evmos#839

Solution:
- encode it as empty array
yihuang added a commit to crypto-org-chain/ethermint that referenced this issue Dec 14, 2021
Closes: evmos#839

Solution:
- encode it as empty array
fedekunze pushed a commit that referenced this issue Dec 14, 2021
* Problem: empty topics shouldn't be encoded as nil

Closes: #839

Solution:
- encode it as empty array

* fix unit tests

* changelog
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant