Skip to content

Commit

Permalink
Add condition opcodes for agg sigs to condition_codes.clib (#15889)
Browse files Browse the repository at this point in the history
* Add condition opcodes for agg sigs to condition_codes.clib

* Add comment about hard fork

* pylint
  • Loading branch information
Quexington committed Aug 3, 2023
1 parent f42394d commit fe9b4aa
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
10 changes: 10 additions & 0 deletions chia/wallet/puzzles/condition_codes.clib
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
; See chia/types/condition_opcodes.py

(

; Unavailable until after 2.0 hard fork
(defconstant AGG_SIG_PARENT 43)
(defconstant AGG_SIG_PUZZLE 44)
(defconstant AGG_SIG_AMOUNT 45)
(defconstant AGG_SIG_PUZZLE_AMOUNT 46)
(defconstant AGG_SIG_PARENT_AMOUNT 47)
(defconstant AGG_SIG_PARENT_PUZZLE 48)
;

(defconstant AGG_SIG_UNSAFE 49)
(defconstant AGG_SIG_ME 50)

Expand Down
13 changes: 13 additions & 0 deletions tests/clvm/test_condition_codes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from __future__ import annotations

import pkg_resources
from clvm.casts import int_from_bytes

from chia.types.condition_opcodes import ConditionOpcode


def test_condition_codes_is_complete() -> None:
with open(pkg_resources.resource_filename("chia.wallet.puzzles", "condition_codes.clib")) as f:
contents: str = f.read()
for name, value in ConditionOpcode.__members__.items():
assert f"(defconstant {name} {int_from_bytes(value)})" in contents

0 comments on commit fe9b4aa

Please sign in to comment.