def test_name_mixin_interpret_name_prefix(opcode, pattern): ops = [opcode] script = create_script(pattern, ADDRESS_SCRIPT) parsed_names, parsed_address_script = NameMixin.interpret_name_prefix( script, ops) assert len(parsed_names) == 0 assert parsed_address_script == ADDRESS_SCRIPT
def test_name_mixin_interpret_name_prefix_wrong_ops(opcode): ops = [opcode] script = create_script( [OP_NAME_NEW, OP_DROP, NAME, DAYS, OP_2DROP, VALUE, OP_DROP], ADDRESS_SCRIPT) parsed_names, parsed_address_script = NameMixin.interpret_name_prefix( script, ops) assert parsed_names is None assert parsed_address_script == script
def test_name_mixin_interpret_name_prefix_with_named_placeholders( opcode, pattern): ops = [opcode] script = create_script(pattern, ADDRESS_SCRIPT) parsed_names, parsed_address_script = NameMixin.interpret_name_prefix( script, ops) assert parsed_names["name"][1] == NAME assert parsed_names["days"][1] == DAYS assert parsed_address_script == ADDRESS_SCRIPT