Skip to content

Commit

Permalink
remove unnecessary use of .__members__ on ConditionOpcode iterati…
Browse files Browse the repository at this point in the history
…on (#18767)
  • Loading branch information
altendky authored Oct 25, 2024
1 parent 2df931b commit e2c63db
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions chia/_tests/clvm/test_condition_codes.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
def test_condition_codes_is_complete() -> None:
condition_codes_path = importlib_resources.files("chia.wallet.puzzles").joinpath("condition_codes.clib")
contents = condition_codes_path.read_text(encoding="utf-8")
for name, value in ConditionOpcode.__members__.items():
assert f"(defconstant {name} {int_from_bytes(value)})" in contents
for opcode in ConditionOpcode:
assert f"(defconstant {opcode.name} {int_from_bytes(opcode.value)})" in contents
2 changes: 1 addition & 1 deletion chia/wallet/util/debug_spend_bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from chia.util.hash import std_hash
from chia.wallet.uncurried_puzzle import UncurriedPuzzle

CONDITIONS = {k: bytes(v)[0] for k, v in ConditionOpcode.__members__.items()} # pylint: disable=E1101
CONDITIONS = {opcode.name: opcode.value[0] for opcode in ConditionOpcode}
KFA = {v: k for k, v in CONDITIONS.items()}


Expand Down

0 comments on commit e2c63db

Please sign in to comment.