mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2026-08-24 10:05:29 -05:00
remove unnecessary use of .__members__ on ConditionOpcode iteration (#18767)
This commit is contained in:
@@ -9,5 +9,5 @@ from chia.types.condition_opcodes import ConditionOpcode
|
||||
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
|
||||
|
||||
@@ -12,7 +12,7 @@ from chia.util.condition_tools import conditions_dict_for_solution, pkm_pairs_fo
|
||||
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()}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user