bump clvm_rs version and add test for the optional 3rd hint parameter to CREATE_COIN (#8566)

This commit is contained in:
Arvid Norberg 2021-09-23 06:01:10 +02:00 committed by GitHub
parent 1742c4adbc
commit fceb39f783
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View File

@ -6,7 +6,7 @@ dependencies = [
"chiabip158==1.0", # bip158-style wallet filters
"chiapos==1.0.4", # proof of space
"clvm==0.9.7",
"clvm_rs==0.1.11",
"clvm_rs==0.1.12",
"clvm_tools==0.4.3",
"aiohttp==3.7.4", # HTTP server for full node rpc
"aiosqlite==0.17.0", # asyncio wrapper for sqlite, to store blocks

View File

@ -1857,6 +1857,18 @@ class TestGeneratorConditions:
in npc_result.npc_list[0].conditions[0][1]
)
def test_create_coin_with_hint(self):
# CREATE_COIN
puzzle_hash_1 = "abababababababababababababababab"
hint = "12341234123412341234213421341234"
npc_result = generator_condition_tester(f'(51 "{puzzle_hash_1}" 5 "{hint}")')
assert npc_result.error is None
assert len(npc_result.npc_list) == 1
opcode = ConditionOpcode.CREATE_COIN
assert npc_result.npc_list[0].conditions[0][1][0] == ConditionWithArgs(
opcode, [puzzle_hash_1.encode("ascii"), bytes([5]), hint.encode("ascii")]
)
def test_unknown_condition(self):
for sm in [True, False]:
for c in ['(1 100 "foo" "bar")', "(100)", "(1 1) (2 2) (3 3)", '("foobar")']: