From 90dc7c87232196795d65d4cce7277635429e76ce Mon Sep 17 00:00:00 2001 From: Krypto Kajun Date: Sat, 8 Nov 2025 13:22:28 -0600 Subject: [PATCH] fix: allow test/dev environments to skip production encryption key validation --- pkg/security/keymanager.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/security/keymanager.go b/pkg/security/keymanager.go index 9ab46ed..d084a9f 100644 --- a/pkg/security/keymanager.go +++ b/pkg/security/keymanager.go @@ -255,7 +255,9 @@ func NewKeyManager(config *KeyManagerConfig, logger *logger.Logger) (*KeyManager // NewKeyManagerWithChainID creates a key manager with specified chain ID for enhanced validation func NewKeyManagerWithChainID(config *KeyManagerConfig, logger *logger.Logger, chainID *big.Int) (*KeyManager, error) { - return newKeyManagerInternal(config, logger, chainID, true) + // Skip production validation in development/test environments + validateProduction := os.Getenv("GO_ENV") != "development" && os.Getenv("NODE_ENV") != "development" && os.Getenv("NODE_ENV") != "test" + return newKeyManagerInternal(config, logger, chainID, validateProduction) } // newKeyManagerForTesting creates a key manager without production validation (test only)