Skip to content

Commit

Permalink
fix bloom filter test
Browse files Browse the repository at this point in the history
  • Loading branch information
yihuang committed Sep 22, 2021
1 parent e29249d commit 532b18a
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 11 deletions.
23 changes: 22 additions & 1 deletion integration_tests/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions integration_tests/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ pystarport = { git = "https://github.com/crypto-com/pystarport.git", branch = "m
web3 = "^5.20.1"
cprotobuf = "^0.1.10"
mnemonic = "^0.20"
eth-bloom = "^1.0.4"

[tool.poetry.dev-dependencies]

Expand Down
15 changes: 5 additions & 10 deletions integration_tests/test_basic.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from pathlib import Path

from eth_bloom import BloomFilter
from eth_utils import abi
from hexbytes import HexBytes

Expand Down Expand Up @@ -42,16 +43,10 @@ def test_events(cluster, suspend_capture):
assert expect_log.items() <= txreceipt.logs[0].items()

# check block bloom
assert w3.eth.get_block(txreceipt.blockNumber).logsBloom == HexBytes(
"0x0000080000000000000000000000000000000000000000000000000000000000"
"0000000000000000000000000000000000000000000000000000000000000000"
"0000000000000000000000080000020000000000000000000000000000000000"
"0000000000000000000000000000000000000000000000000000001000000000"
"0000000000000000000000400000000000000000000000000000000000000000"
"0000000000000000000000000400000000000000000000000000000020000000"
"0000000200000000000000000000000000000000000000000000100000000800"
"0000000000000000041000000000000000000000000000000000000000000000"
)
bloom = BloomFilter(w3.eth.get_block(txreceipt.blockNumber).logsBloom)
assert HexBytes(erc20.address) in bloom
for topic in expect_log['topics']:
assert topic in bloom


def test_native_call(cronos):
Expand Down

0 comments on commit 532b18a

Please sign in to comment.