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

fixed missing b prefix before byte strings. #347

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ethereum/tests/test_abi.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def test_abi_encode_single_int():

def test_abi_encode_single_ureal():
assert abi.encode_single(['ureal', '128x128', []], 0) == (b'\x00'*32)
assert abi.encode_single(['ureal', '128x128', []], 1.125) == (b'\x00'*15 + b'\x01\x20' + '\x00'*15)
assert abi.encode_single(['ureal', '128x128', []], 1.125) == (b'\x00'*15 + b'\x01\x20' + b'\x00'*15)
assert abi.encode_single(['ureal', '128x128', []], 2**127-1) == (b'\x7f' + b'\xff'*15 + b'\x00'*16)

def test_abi_encode_single_real():
Expand All @@ -51,10 +51,10 @@ def test_abi_decode_single_hash():

def test_abi_decode_single_bytes():
typ = ['bytes', '8', []]
assert (b'\x01\x02' + b'\x00'*6) == abi.decode_single(typ, abi.encode_single(typ, '\x01\x02'))
assert (b'\x01\x02' + b'\x00'*6) == abi.decode_single(typ, abi.encode_single(typ, b'\x01\x02'))

typ = ['bytes', '', []]
assert b'\x01\x02' == abi.decode_single(typ, abi.encode_single(typ, '\x01\x02'))
assert b'\x01\x02' == abi.decode_single(typ, abi.encode_single(typ, b'\x01\x02'))

def test_abi_encode_single_prefixed_address():
prefixed_address = '0x' + '0'*40
Expand Down