Datasets:

Modalities:
Text
Formats:
text
Size:
< 1K
ArXiv:
Libraries:
Datasets
RepoZero-Py2JS / rlp /test2.py
jessezhaoxizhang's picture
Duplicate from jessezhaoxizhang/RepoZero-Py2JS
a839836
Raw
History Blame Contribute Delete
941 Bytes
import argparse
import rlp
parser = argparse.ArgumentParser()
parser.add_argument("--a", type=str, required=True)
args = parser.parse_args()
encoded = rlp.encode(args.a) # RLP编码
print(encoded)
decoded = rlp.decode(encoded) # RLP解码
print(decoded)
# ==================================================
# Sample Test Cases (randomly selected)
# ==================================================
# ===== Test Case 1 =====
# Input:
# --a = 'c'
# Output:
# b'c'
# b'c'
# Return Code: 0
# ===== Test Case 2 =====
# Input:
# --a = 'longer_string_with_spaces_and_symbols_!@#$'
# Output:
# b'\xaalonger_string_with_spaces_and_symbols_!@#$'
# b'longer_string_with_spaces_and_symbols_!@#$'
# Return Code: 0
# ===== Test Case 3 =====
# Input:
# --a = 'data'
# Output:
# b'\x84data'
# b'data'
# Return Code: 0
# ===== Test Case 4 =====
# Input:
# --a = 'empty'
# Output:
# b'\x85empty'
# b'empty'
# Return Code: 0