Skip to content

Commit

Permalink
Make KeyGenPanel ignore "0x" at start of private keys
Browse files Browse the repository at this point in the history
  • Loading branch information
mikera committed Mar 19, 2024
1 parent cec5336 commit f1748a2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion convex-cli/src/main/java/convex/cli/local/LocalStart.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ private List<AKeyPair> getPeerKeyPairs(int n) {
for (int i=0; i<left; i++) {
AKeyPair kp=AKeyPair.generate();
keyPairList.add(kp);
log.warn("Generated key: "+kp.getAccountKey()+" Priv: "+kp.getSeed());
log.warn("Generated key: "+kp.getAccountKey().toChecksumHex()+" Priv: "+kp.getSeed());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,9 @@ private void updatePrivateKey() {
}

private void generatePublicKey() {
String s = privateKeyArea.getText();
String s = privateKeyArea.getText().trim();
try {
if (s.startsWith("0x")) s=s.substring(2);
Blob b = Blob.fromHex(Utils.stripWhiteSpace(s));
AKeyPair kp = AKeyPair.create(b.getBytes());
// String pk=Utils.toHexString(kp.getPrivateKey(),64);
Expand Down

0 comments on commit f1748a2

Please sign in to comment.