When converting from entropy to mnemonic with `toMnemonic()`, a `MnemonicLengthException`
was thrown for entropies with invalid length. This is bad for two reasons:
- it is a checked exception, and the method will not be called with user input
- misleading exception name, the error is about the entropy length not the mnemonic
We now throw a `RuntimeException` instead. The resulting simplification of
calling code can be witnessed in `DeterministicSeed`.
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.
* Migrate `setMockClock()` parameters to Instant
* Migrate `rollMockClock()` parameters to Duration
* Rename to `clearMockClock()` from `resetMocking()`
* Use `Clock` internally to provide the time
Change the internal storage format from 5-bits/byte (Bech32 intermediate format)
to standard 8-bits/byte.
Remove now unneeded conversions and add conversion in toBech32().
Separate witnessVersion from witnessProgram in private members.
Note that the witnessProgram is still stored in a 5-bit per byte encoding
as it was in the combined byte[]. A future PR will change it to 8-bit per
byte encoding.
* Change the private compareP2SHScriptHashDerivedFromPubKey() method to
take a LegacyAddress
* In caller cast address (after check for P2SH) to LegacyAddress
This updates the document to have 4 diagrams, one for each of the
following releases:
1. 0.16.x (current stable release)
2. 0.17 (according to current plans)
3. 0.18 (according to current plans)
4. 0.19 (this more of a proposal than a plan at this point)
The diagrams have also been enhanced to differentiate between packages
and modules (aka JARs) and to distinguish between "api" and "implementation"
dependencies.
Hopefully this makes things much more clear. We can make further changes
as our plans and implementations change.
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.
There's no convenient Java built-in for exponentiation
of `long`. And the COIN_VALUE constant is unlikely to ever change.
So we're just going to define it with a `long` literal.
Fortunately Java 7 added the ability to use `_` to group digits.
As we're migrating from ListenableCompletableFuture to standard
CompletableFuture, we need a failedFuture() method that returns the
standard CompletableFuture object.
TransactionBroadcast already needed this method as it was returning
a ListenableCompletableFuture in one case where a standard
CompletableFuture would be preferred.
This method can be deprecated when we require Java 9.