Aw 93 slip-0010#74
Conversation
802ce12 to
c5598c1
Compare
|
|
||
| private static final String KEYSTORE_RADIO_BUTTON_ID = "KEYSTORE_RB"; | ||
|
|
||
| private static final String MNEMONIC_RADIO_BUTTON_ID = "MNEMONIC_RB"; |
There was a problem hiding this comment.
there are some leftover unused imports in this class, please remove those as well
| } | ||
| } | ||
|
|
||
| private AccountDTO processMasterAccount(String mnemonic, String password) throws ValidationException { |
There was a problem hiding this comment.
final
in IDEA you can set auto-final for param/variable generation from Settings->CodeStyle->Java->CodeGenerarion
There was a problem hiding this comment.
Method is private so a final modifier would be pointless here.
| byte[] r = Arrays.copyOfRange(keyHash, 32, 64); | ||
|
|
||
| // ed25519 supports ONLY hardened keys | ||
| i = i | HARDENED_KEY_MULTIPLIER; |
| byte[] keyHash = ecKey.getPrivKeyBytes(); | ||
|
|
||
| // parent private key | ||
| byte[] l = Arrays.copyOfRange(keyHash, 0, 32); |
There was a problem hiding this comment.
we could name l and r as parentPrivateKey and chainCode respectively so we don't need comments
| Mac mac = Mac.getInstance(HmacSHA512_ALGORITHM); | ||
| SecretKey key = new SecretKeySpec(r, HmacSHA512_ALGORITHM); | ||
| mac.init(key); | ||
| return new ExtendedKey(new ECKeyEd25519().fromPrivate(mac.doFinal(parentPaddedKey))); |
There was a problem hiding this comment.
for less garbage, we can have the new ECKeyEd25519() as a a lcoal constant since we're using the fromPrivate method as a de facto static method
|
|
||
| private static final String MNEMONIC_ENCRYPTION_ALGORITHM = "Blowfish"; | ||
|
|
||
| private static final String MNEMONIC_STRING_CONVERSION_CHARSET_NAME = "ISO-8859-1"; |
|
|
||
| private static final String ACCOUNT_NAME_PROP = ".name"; | ||
|
|
||
| private static final String MASTER_DERIVATIONS_PROP = "accounts.master.derivations"; |
There was a problem hiding this comment.
I think for these 2 props there's no need to have the accounts. prefix
| try { | ||
| blockchainConnector.createAccount(); | ||
| } catch (ValidationException e) { | ||
| // todo: log |
There was a problem hiding this comment.
you can actually slap a quick logger in this class and log this exception
| } | ||
|
|
||
| private void showInvalidFieldsError(final String message) { | ||
| private void showInvalidFieldsError(String message) { |
| } | ||
|
|
||
| public void open(final MouseEvent mouseEvent) { | ||
| public void open(MouseEvent mouseEvent) { |
951490a to
01e923b
Compare
No description provided.