Skip to content

Commit

Permalink
Problem: empty topics in rpc response is not tested
Browse files Browse the repository at this point in the history
Closes: #841

Solution:
- merge empty topics fix
- add integration tests to verify
  • Loading branch information
yihuang committed Dec 14, 2021
1 parent 8e4d676 commit f8b16b1
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 6 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,4 @@ replace github.com/cosmos/iavl => github.com/cosmos/iavl v0.17.3

// https://github.com/crypto-org-chain/ethermint/tree/v0.9.x-cronos
// FIXME make a tag or point to upstream when ready
replace github.com/tharsis/ethermint => github.com/crypto-org-chain/ethermint v0.6.1-0.20211207040748-254df3803d62
replace github.com/tharsis/ethermint => github.com/crypto-org-chain/ethermint v0.6.1-0.20211214070921-bfea18622b20
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/crypto-org-chain/ethermint v0.6.1-0.20211207040748-254df3803d62 h1:9/wTMiLSbgNPxpElwrVT6+Q4OzePFxb42Ws7+ur+nDg=
github.com/crypto-org-chain/ethermint v0.6.1-0.20211207040748-254df3803d62/go.mod h1:5Nukk6Aobxjnx7HAJTUHqyd7s7zSxbtZ4EWlwGb3pFc=
github.com/crypto-org-chain/ethermint v0.6.1-0.20211214070921-bfea18622b20 h1:uro0T9cAOryifTSsutKmin4sJFncEcZXgzyTUoSmryI=
github.com/crypto-org-chain/ethermint v0.6.1-0.20211214070921-bfea18622b20/go.mod h1:5Nukk6Aobxjnx7HAJTUHqyd7s7zSxbtZ4EWlwGb3pFc=
github.com/crypto-org-chain/ibc-go/v2 v2.0.1-hooks h1:XzF2wdfSPrf1J5FpyBpbRT+Imb/bqSvRoXV/nlaX28Y=
github.com/crypto-org-chain/ibc-go/v2 v2.0.1-hooks/go.mod h1:ZfePiHyAVzWvRafjDCI00huUnPjRgOn1FsOklO68AF0=
github.com/crypto-org-chain/keyring v1.1.6-fixes h1:AUFSu56NY6XobY6XfRoDx6v3loiOrHK5MNUm32GEjwA=
Expand Down
6 changes: 3 additions & 3 deletions gomod2nix.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3650,13 +3650,13 @@
sha256 = "1sgjf2vaq554ybc0cwkzn17cz2ibzph2rq0dgaw21c2hym09437x"

["github.com/tharsis/ethermint"]
sumVersion = "v0.6.1-0.20211207040748-254df3803d62"
sumVersion = "v0.6.1-0.20211214070921-bfea18622b20"
vendorPath = "github.com/crypto-org-chain/ethermint"
["github.com/tharsis/ethermint".fetch]
type = "git"
url = "https://github.com/crypto-org-chain/ethermint"
rev = "254df3803d62dc8602854d78e7fb094b2c8a5e60"
sha256 = "0gclwq2ljngjqpjv60nyyss2p9mfgqdazwjk616p7rlpig1kczs5"
rev = "bfea18622b201c2af557bf9f1e7f79289ffc570d"
sha256 = "08iyb90kzxvmyi4q09s69czxqdzlrsg6m5xnwfw7wvxirs74rpwr"

["github.com/tidwall/gjson"]
sumVersion = "v1.6.7"
Expand Down
5 changes: 5 additions & 0 deletions integration_tests/contracts/contracts/TestERC20Utility.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
20 changes: 20 additions & 0 deletions integration_tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,3 +217,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"
)

0 comments on commit f8b16b1

Please sign in to comment.