3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-02-12 10:15:52 +00:00

Fix failing WalletProtobufSerializerTest

This commit is contained in:
troggy 2014-06-11 23:50:30 +04:00 committed by Mike Hearn
parent 5840c8a66a
commit b40b3a5f9d

View File

@ -446,10 +446,12 @@ public class KeyChainGroup {
public static KeyChainGroup fromProtobufUnencrypted(List<Protos.Key> keys) throws UnreadableWalletException {
BasicKeyChain basicKeyChain = BasicKeyChain.fromProtobufUnencrypted(keys);
List<DeterministicKeyChain> chains = DeterministicKeyChain.fromProtobuf(keys, null);
EnumMap<KeyChain.KeyPurpose, DeterministicKey> currentKeys = createCurrentKeysMap(chains);
EnumMap<KeyChain.KeyPurpose, DeterministicKey> currentKeys = null;
if (chains.isEmpty()) {
// TODO: Old bag-of-keys style wallet only! Auto-upgrade time!
} else {
currentKeys = createCurrentKeysMap(chains);
}
return new KeyChainGroup(basicKeyChain, chains, currentKeys, null);
}
@ -458,10 +460,12 @@ public class KeyChainGroup {
checkNotNull(crypter);
BasicKeyChain basicKeyChain = BasicKeyChain.fromProtobufEncrypted(keys, crypter);
List<DeterministicKeyChain> chains = DeterministicKeyChain.fromProtobuf(keys, crypter);
EnumMap<KeyChain.KeyPurpose, DeterministicKey> currentKeys = createCurrentKeysMap(chains);
EnumMap<KeyChain.KeyPurpose, DeterministicKey> currentKeys = null;
if (chains.isEmpty()) {
// TODO: Old bag-of-keys style wallet only! Auto-upgrade time!
} else {
currentKeys = createCurrentKeysMap(chains);
}
return new KeyChainGroup(basicKeyChain, chains, currentKeys, crypter);
}