1. Returns Duration rather than long
2. Uses CompletableFuture rather than ListenableCompletableFuture
I've also changed the error-handling a little. Instead of throwing
a ProtocolException (RuntimeException) if PingPong isn't supported
the exception is set in the CompletableFuture. We don't have anything
catching this exception, so wrapping it in the CompletableFuture seems
like a safe move.
* Deprecate ByteUtils.HEX
* Migrate usages to new ByteUtils.formatHex() and ByteUtils.parseHex()
* Direct use of Guava BaseEncoding in tests that use some specific
features of BaseEncoding that aren't provided by new methods.
* Add 3 new constructors which take Network
* Deprecate (2 of 3) constructors that take NetworkParameters
* Mark 3-arg NetworkParameters constructor as @VisibleForTesting
All of them are unmaintained and their tests are in the way of refactorings.
MySQL and Postgres had been disabled for a while, and one seems to care.
H2 is tested, but pulls a driver dependency into the test classpath.
LegacyAddress, SegwitAddress: replace static factories that take NetworkParameters
* Add static factory methods that take `Network`
* Deprecate static factory methods that take `NetworkParameters`
* Add `Networks` support to `NetworkParameters.of(Network)`
* Update all usages to use the new methods
This change migrates from using `NetworkParameters` to `Network` for specifying the network and
also decouples from static methods in `Address` with an interface/implementation approach.
Note that there are 3 use cases for address parsing:
1. Any network is allowed - AddressParser.parseAddressAnyNetwork(String)
2. Parse for a specified network - AddressParser.parseAddress(String, Network)
3. Parse for a previously-specified (context dependent) network - AddressParser.Strict.parseAddress(String)
In most use cases, an AddressParser instance can be accessed through the Wallet,
which already knows the Network type and in this context validation for network makes
sense. This is why `Wallet` is implementing `AddressParser.Strict`
BitcoinURI allocates its own DefaultAddressParser for now, as do some other tests
and examples that don't have access to a Wallet
In the future DefaultAddressParser may be replaced by something loaded
via the ServiceLoader mechanism or other dynamically configured mechanism.
Perhaps in the future, we'll want a `network` private or protected member,
but for now that doesn't seem needed.
When we start using Network for address and transaction creation, this
will be used even more.
This change makes NetworkParameters use and depend upon Network instead
of the reverse. This will allow Network to be moved to `base`.
Define `UnitTestParams` as being on the `TEST` network. We must choose
a `Network` property for `UnitTestParams` and I have learned through trial-and-error
that `TEST` is the correct choice.
This also moves Coin, Fiat, its parent Monetary and the related MonetaryFormat into the new base package.
See the provided package-info.java for details.
* Add `Wallet.loadFromFile` that takes options needed by WalletTool
* Add `Wallet.loadFromFileStream` that supports the extra options
* Update `WalletTool` to use the new `loadFromFile` method
main() currently throws no checked exceptions. This is a good thing and
means all checked exceptions are caught and (hopefully properly) handled by
outputting error messages and return a non-zero exit code.
* Split the long `try` block into multiple `try/catch` blocks
* Consistently use System.err.println and System.exit on errors
* System.out.println an information message before falling back to `broadcastPayment`
This is a breaking change, but the existing code is not using futures properly and
fixing this is worth the breakage.
* Instead of returning `null`, return a failed future
* Instead of throwing errors, return failed futures
Adds the picocli-codegen annotation processor.
To build the documentation use `gradle bitcoinj-wallettool:asciidoctor`. The results are in:
* wallettool/build/generated-picocli-docs/wallet-tool.adoc (asciidoc source)
* wallettool/build/docs/html5/wallet-tool.html (HTML version)
* wallettool/build/docs/manpage/wallet-tool.1 (man format)