Skip to content

Commit

Permalink
Merge pull request #231 from oasisprotocol/amela/fix/trim-0x-when-imp…
Browse files Browse the repository at this point in the history
…orting-secp256k1
  • Loading branch information
amela authored May 8, 2024
2 parents f4e49b2 + 66ffb88 commit 750f8d6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions wallet/file/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 750f8d6

Please sign in to comment.