From 66ffb88033c79502d9ceb17d5859a8e84b62c95e Mon Sep 17 00:00:00 2001 From: amela Date: Wed, 8 May 2024 09:41:12 +0200 Subject: [PATCH] fix(cmd/wallet): Support 0x when importing secp256k1 --- wallet/file/file.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wallet/file/file.go b/wallet/file/file.go index bcd96d18..950ac36c 100644 --- a/wallet/file/file.go +++ b/wallet/file/file.go @@ -279,9 +279,9 @@ func (af *fileAccountFactory) DataValidator(kind wallet.ImportKind, rawCfg map[s } case wallet.AlgorithmSecp256k1Raw: // Ensure the private key is hex encoded. - _, err := hex.DecodeString(ans.(string)) + _, err := Secp256k1FromHex(ans.(string)) if err != nil { - return fmt.Errorf("private key must be hex-encoded (without leading 0x): %w", err) + return fmt.Errorf("private key must be hex-encoded: %w", err) } case wallet.AlgorithmSr25519Raw: // Ensure the private key is base64 encoded.