Skip to content

Commit

Permalink
Merge pull request hyperledger-web3j#547 from hackty/master
Browse files Browse the repository at this point in the history
[hyperledger-web3j#545] add missing constructor of WalletUtils by using fullWalletFile default
  • Loading branch information
conor10 authored Jul 9, 2018
2 parents 2cb930a + faa7ce5 commit 973f237
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
6 changes: 6 additions & 0 deletions crypto/src/main/java/org/web3j/crypto/WalletUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ public static String generateLightNewWalletFile(String password, File destinatio
return generateNewWalletFile(password, destinationDirectory, false);
}

public static String generateNewWalletFile(String password, File destinationDirectory)
throws CipherException, InvalidAlgorithmParameterException,
NoSuchAlgorithmException, NoSuchProviderException, IOException {
return generateFullNewWalletFile(password, destinationDirectory);
}

public static String generateNewWalletFile(
String password, File destinationDirectory, boolean useFullScrypt)
throws CipherException, IOException, InvalidAlgorithmParameterException,
Expand Down
13 changes: 10 additions & 3 deletions crypto/src/test/java/org/web3j/crypto/WalletUtilsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,23 @@ public void testGenerateBip39Wallets() throws Exception {
@Test
public void testGenerateFullNewWalletFile() throws Exception {
String fileName = WalletUtils.generateFullNewWalletFile(PASSWORD, tempDir);
testGenerateNewWalletFile(fileName);
testGeneratedNewWalletFile(fileName);
}

@Test
public void testGenerateNewWalletFile() throws Exception {
String fileName = WalletUtils.generateNewWalletFile(PASSWORD, tempDir);
testGeneratedNewWalletFile(fileName);
}


@Test
public void testGenerateLightNewWalletFile() throws Exception {
String fileName = WalletUtils.generateLightNewWalletFile(PASSWORD, tempDir);
testGenerateNewWalletFile(fileName);
testGeneratedNewWalletFile(fileName);
}

private void testGenerateNewWalletFile(String fileName) throws Exception {
private void testGeneratedNewWalletFile(String fileName) throws Exception {
WalletUtils.loadCredentials(PASSWORD, new File(tempDir, fileName));
}

Expand Down

0 comments on commit 973f237

Please sign in to comment.