From b51fba365980525ffd7269f56b10908c53d929ee Mon Sep 17 00:00:00 2001 From: Xeophon <508704820@qq.com> Date: Wed, 13 May 2026 02:04:38 +0800 Subject: [PATCH] FIX(#4852): move hmac import to module level and fix NameError crash - Added hmac to module-level imports (was only in demo function) - Removed broken 'if hmac in dir()' fallback that never executed - Removed redundant import hmac in demo function - generate_mutation_seed() no longer crashes with NameError --- rips/rustchain-core/src/mutator_oracle/multi_arch_oracles.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rips/rustchain-core/src/mutator_oracle/multi_arch_oracles.py b/rips/rustchain-core/src/mutator_oracle/multi_arch_oracles.py index 5f51f3a15..0a4a50bc9 100644 --- a/rips/rustchain-core/src/mutator_oracle/multi_arch_oracles.py +++ b/rips/rustchain-core/src/mutator_oracle/multi_arch_oracles.py @@ -51,6 +51,7 @@ import hashlib import struct import secrets +import hmac import time from datetime import datetime @@ -289,7 +290,7 @@ def generate_mutation_seed(self, block_height: int) -> Optional[MultiArchMutatio final_seed, b''.join(a.encode() for a in sorted(contributions.keys())), hashlib.sha256 - ).digest() if 'hmac' in dir() else hashlib.sha256(final_seed).digest() + ).digest() seed = MultiArchMutationSeed( seed=final_seed,