* Add `awaitRelayed()` method that returns a CF that completes when relaying is confirmed.
* Deprecate `future()` and reimplement it using `awaitRelayed()`.
* native constructors that were meant to be called by consumers now have static equivalents
* all native constructors are discouraged from being used by a JavaDoc comment
* one constructor that wasn't meant to be used by consumers is switched to private access
* tests and tools that resemble consumers are updated to use the new API
Note: although most native constructors are now deprecated, we're not using
annotations because we're still calling them.
We were using KeyParameter as a wrapper for a byte[] containing an
AES Key and passing it around our API. This introduced an unnecessary
API dependency on Bouncy Castle. This PR adds an AesKey class
for the same purpose to replace it.
This is a breaking change, but one that should be easy to accommodate.
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.