|
@ -1,5 +1,6 @@ |
|
|
package com.sparrowwallet.sparrow.io; |
|
|
package com.sparrowwallet.sparrow.io; |
|
|
|
|
|
|
|
|
|
|
|
import com.sparrowwallet.drongo.crypto.ECIESKeyCrypter; |
|
|
import com.sparrowwallet.drongo.crypto.ECKey; |
|
|
import com.sparrowwallet.drongo.crypto.ECKey; |
|
|
import com.sparrowwallet.drongo.wallet.Wallet; |
|
|
import com.sparrowwallet.drongo.wallet.Wallet; |
|
|
import org.junit.Assert; |
|
|
import org.junit.Assert; |
|
@ -12,14 +13,14 @@ import java.io.IOException; |
|
|
public class StorageTest extends IoTest { |
|
|
public class StorageTest extends IoTest { |
|
|
@Test |
|
|
@Test |
|
|
public void loadWallet() throws IOException { |
|
|
public void loadWallet() throws IOException { |
|
|
ECKey decryptionKey = ECKey.createKeyPbkdf2HmacSha512("pass"); |
|
|
ECKey decryptionKey = ECIESKeyCrypter.deriveECKey("pass"); |
|
|
Wallet wallet = Storage.getStorage().loadWallet(getFile("sparrow-single-wallet"), decryptionKey); |
|
|
Wallet wallet = Storage.getStorage().loadWallet(getFile("sparrow-single-wallet"), decryptionKey); |
|
|
Assert.assertTrue(wallet.isValid()); |
|
|
Assert.assertTrue(wallet.isValid()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Test |
|
|
@Test |
|
|
public void saveWallet() throws IOException { |
|
|
public void saveWallet() throws IOException { |
|
|
ECKey decryptionKey = ECKey.createKeyPbkdf2HmacSha512("pass"); |
|
|
ECKey decryptionKey = ECIESKeyCrypter.deriveECKey("pass"); |
|
|
Wallet wallet = Storage.getStorage().loadWallet(getFile("sparrow-single-wallet"), decryptionKey); |
|
|
Wallet wallet = Storage.getStorage().loadWallet(getFile("sparrow-single-wallet"), decryptionKey); |
|
|
Assert.assertTrue(wallet.isValid()); |
|
|
Assert.assertTrue(wallet.isValid()); |
|
|
|
|
|
|
|
|