diff --git a/core/src/main/java/org/bitcoinj/core/Wallet.java b/core/src/main/java/org/bitcoinj/core/Wallet.java index 2b3e9c68..c6486724 100644 --- a/core/src/main/java/org/bitcoinj/core/Wallet.java +++ b/core/src/main/java/org/bitcoinj/core/Wallet.java @@ -267,9 +267,7 @@ public class Wallet extends BaseTaggableObject this(Context.getOrCreate(params), keyChainGroup); } - // TODO: When this class moves to the Wallet package, along with the protobuf serializer, then hide this. - /** For internal use only. */ - public Wallet(Context context, KeyChainGroup keyChainGroup) { + private Wallet(Context context, KeyChainGroup keyChainGroup) { this.context = context; this.params = context.getParams(); this.keyChainGroup = checkNotNull(keyChainGroup); diff --git a/core/src/test/java/org/bitcoinj/core/BloomFilterTest.java b/core/src/test/java/org/bitcoinj/core/BloomFilterTest.java index 842d0096..db3ad0c7 100644 --- a/core/src/test/java/org/bitcoinj/core/BloomFilterTest.java +++ b/core/src/test/java/org/bitcoinj/core/BloomFilterTest.java @@ -68,17 +68,17 @@ public class BloomFilterTest { @Test public void walletTest() throws Exception { NetworkParameters params = MainNetParams.get(); - Context context = new Context(params); + Context.propagate(new Context(params)); DumpedPrivateKey privKey = DumpedPrivateKey.fromBase58(params, "5Kg1gnAjaLfKiwhhPpGS3QfRg2m6awQvaj98JCZBZQ5SuS2F15C"); - + Address addr = privKey.getKey().toAddress(params); assertTrue(addr.toString().equals("17Wx1GQfyPTNWpQMHrTwRSMTCAonSiZx9e")); KeyChainGroup group = new KeyChainGroup(params); // Add a random key which happens to have been used in a recent generation group.importKeys(ECKey.fromPublicOnly(privKey.getKey().getPubKeyPoint()), ECKey.fromPublicOnly(HEX.decode("03cb219f69f1b49468bd563239a86667e74a06fcba69ac50a08a5cbc42a5808e99"))); - Wallet wallet = new Wallet(context, group); + Wallet wallet = new Wallet(params, group); wallet.commitTx(new Transaction(params, HEX.decode("01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0d038754030114062f503253482fffffffff01c05e559500000000232103cb219f69f1b49468bd563239a86667e74a06fcba69ac50a08a5cbc42a5808e99ac00000000"))); // We should have 2 per pubkey, and one for the pay-2-pubkey output we have