Skip to content
This repository was archived by the owner on May 23, 2023. It is now read-only.

Commit 6739d5e

Browse files
author
Jan Xie
committed
test for encoding hash in abi
1 parent 23ea125 commit 6739d5e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ethereum/tests/test_abi.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ def test_abi_encode_single_int():
2626
with pytest.raises(abi.ValueOutOfBounds):
2727
assert abi.encode_single(['int', '8', []], 128)
2828

29+
def test_abi_encode_single_hash():
30+
assert abi.encode_single(['hash', '8', []], b'\x00'*8) == b'\x00'*32
31+
assert abi.encode_single(['hash', '8', []], '00'*8) == b'\x00'*32
32+
2933
# SETUP TESTS IN GLOBAL NAME SPACE
3034
def gen_func(filename, testname, testdata):
3135
return lambda: do_test_state(filename, testname, testdata)

0 commit comments

Comments
 (0)