Commit Graph

4222 Commits

Author SHA1 Message Date
Sean Gilligan
86733a9414 build.gradle: update JavaFX to 17.0.6 2023-03-06 18:28:36 +01:00
Andreas Schildbach
558f6df127 DownloadProgressTracker: migrate progress() method to java.time API 2023-03-06 09:58:48 +01:00
Andreas Schildbach
310b93be4e Peer, PeerGroup: migrate fastCatchupTime field to java.time API 2023-03-06 09:50:07 +01:00
Andreas Schildbach
838b12c046 CheckpointManager: migrate checkpoints map to java.time API 2023-03-06 09:39:02 +01:00
Sean Gilligan
b1ede764a7 Wallet: fix JavaDoc error that was breaking JDK 11 build 2023-03-06 09:35:42 +01:00
Sean Gilligan
1853a63f69 DeterministicHierarchy, MnemonicCode: migrate BIPXX_STANDARDISATION_TIME to java.time API
Deprecate BIPXX_STANDARDISATION_TIME_SECS int constants. Replace with
BIPXX_STANDARDISATION_TIME Instant constants.
2023-03-06 01:24:22 +01:00
Sean Gilligan
8bdc35a32e Wallet: migrate fromWatchingKeyB58() and fromSpendingKeyB58() methods to java.time API 2023-03-06 00:44:34 +01:00
Andreas Schildbach
99bc95a93d WalletFiles: migrate delay field to java.time API 2023-03-05 22:05:39 +01:00
Andreas Schildbach
d3162a4403 SendRequest: migrate two invocations of deprecated NetworkParameters.fromAddress() method 2023-03-05 17:50:11 +01:00
Sean Gilligan
f2a7229676 MessageVerifyUtils: move to o.b.crypto.utils from o.b.utils
This class belongs in the crypto module.
2023-03-05 01:06:12 +01:00
Sean Gilligan
848d2d88bb StreamUtils: move to o.b.base.internal from o.b.base.utils 2023-03-05 01:02:20 +01:00
Sean Gilligan
8e35390b8a SegwitAddress: minor simplification in toBech32()
Calculate encoding using ternary operator and replace if statement.
2023-03-05 00:49:45 +01:00
Sean Gilligan
b83710a242 SegwitAddress: store witnessProgram as 8-bits/byte
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().
2023-03-05 00:44:06 +01:00
Sean Gilligan
f8ac6b3405 SegwitAddress: store witnessVersion internally as a short
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.
2023-03-05 00:40:56 +01:00
Sean Gilligan
f9be0b2a3d Address: convert to interface
* Migrate protected members to subclasses
* Remove constructors
* Migrate hashCode and equals to subclasses
2023-03-05 00:38:55 +01:00
Sean Gilligan
6c84ffec85 ScriptBuilder: cast address to LegacyAddress before calling getHash()
In both of these cases we have already checked the ScriptType of the 
address and know that it is a LegacyAddress.
2023-03-04 10:08:44 +01:00
Sean Gilligan
4f66bfc462 MessageVerifyUtils: cast P2SH address to LegacyAddress
* Change the private compareP2SHScriptHashDerivedFromPubKey() method to
  take a LegacyAddress
* In caller cast address (after check for P2SH) to LegacyAddress
2023-03-04 09:58:50 +01:00
Sean Gilligan
9002edbe8f Base58: move tests to o.b.base
These should have been moved when the Base58 class was moved.
2023-03-03 22:45:48 +01:00
Sean Gilligan
d5aeaacc44 modular-architecture.md: improve diagrams, show 4 releases
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.
2023-03-03 20:24:00 +01:00
Andreas Schildbach
1c380de16d PeerAddress: migrate time field to java.time API 2023-03-03 20:06:34 +01:00
Andreas Schildbach
913f5ac8c6 PeerDiscovery: migrate getPeers() to java.time API 2023-03-03 00:10:35 +01:00
Andreas Schildbach
35c4fd9025 ExponentialBackoff: migrate to java.time API 2023-03-02 23:32:45 +01:00
Andreas Schildbach
b356f487e5 PeerGroup: migrate peerDiscoveryTimeout field to java.time API 2023-03-02 23:32:45 +01:00
Andreas Schildbach
d1aa4de677 Block: migrate time field to java.time API
The precision of Bitcoin time is only a second, so we need to
truncate any surplus precision to avoid rounding errors in the
PoW verification.
2023-03-02 23:32:45 +01:00
Sean Gilligan
50caafc8d5 ByteUtils: replace Guava comparator with arrayUnsignedComparator()
Replace Guava UnsignedBytes.lexicographicComparator() with
ByteUtils.arrayUnsignedComparator().
2023-03-02 23:00:07 +01:00
Sean Gilligan
17abffa04b Peer: deprecate ping() and replace with sendPing()
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.
2023-03-02 18:50:16 +01:00
Sean Gilligan
916989a7cd ByteUtils: replace HEX (Guava BaseEncoding) with with own implementation
* 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.
2023-03-02 15:16:06 +01:00
Sean Gilligan
7ee4f334be Sha256Hash: replace Ints.fromBytes with ByteUtils.readUint32BE 2023-03-02 12:35:38 +01:00
Sean Gilligan
f71b085cd2 VarInt: replace Guava Ints.checkedCast with Math.toIntExact 2023-03-02 12:31:31 +01:00
Sean Gilligan
855b50cd63 Coin: replace LongMath.pow() with hardcode
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.
2023-03-02 12:27:57 +01:00
Sean Gilligan
8325b0aee4 FutureUtils: add failedFuture method
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.
2023-03-02 12:22:33 +01:00
Sean Gilligan
9e59b0fc79 Sha256Hash: replace Guava io.ByteStreams with Files.readAllBytes 2023-03-02 11:36:53 +01:00
Andreas Schildbach
a40f206e45 Peer: measure ping-pong time using java.time API 2023-03-01 23:55:44 +01:00
Andreas Schildbach
e597a68106 README.md: update Android runtime requirement to Android 8.0
The Java runtime requirement is left unchanged at Java 8.
2023-03-01 23:42:02 +01:00
Andreas Schildbach
2eb7278d04 core, integration-test: migrate usage of Guava Stopwatch to java.time API 2023-03-01 13:21:30 +01:00
Sean Gilligan
64dbdd9fcd base, wallet: migrate Guava LongMath.checked{Add,Subtract,Multiply} to Math.{add,substract,multiply}Exact 2023-02-28 22:06:03 +01:00
Sean Gilligan
0e4bda3cd8 LegacyAddress: replace two core imports with paths in JavaDoc
This helps us keep better track of our progress
in migrating away from core.
2023-02-27 22:58:19 +01:00
Sean Gilligan
d86406ab2e TimeUtils: move (mock) time utils from o.b.core.Utils to new class 2023-02-27 19:32:50 +01:00
Sean Gilligan
6e77dcb433 PlatformUtils: move OS/runtime detection from o.b.core.Utils to new class 2023-02-27 18:34:20 +01:00
micheal swiggs-malmevik
0685bf70e4 BitcoinURI: remove redundant BitcoinNetwork cast 2023-02-27 16:56:13 +01:00
micheal swiggs-malmevik
cfc3b26a53 BitcoinURI: remove unused parameter addressToken from parseParameters() 2023-02-27 16:54:02 +01:00
micheal swiggs-malmevik
8e03aee87d DeterministicKey: remove unused parameter parent from ascertainParentFingerprint() 2023-02-27 16:38:06 +01:00
micheal swiggs-malmevik
6298651929 DeterministicKeyChain: remove unused parameter baseKey from initializeHierarchyUnencrypted() 2023-02-27 16:35:24 +01:00
micheal swiggs-malmevik
6e8435e129 Wallet: remove unused parameter originalInputs from calculateFee() 2023-02-27 16:21:46 +01:00
micheal swiggs-malmevik
135476f71b Wallet: remove unused parameter avail from checkBalanceFuturesLocked() 2023-02-27 16:21:08 +01:00
Sean Gilligan
a4e2583b4e FutureUtils: move to o.b.base.internal package 2023-02-27 12:52:36 +01:00
Sean Gilligan
ebe70e453a FutureUtils: migrate ListenableCompletableFuture to CompletableFuture 2023-02-27 12:43:02 +01:00
Sean Gilligan
1fa9bff490 ECKey, DeterministicKey: migrate API usages to Network from NetworkParameters 2023-02-27 11:45:05 +01:00
Andreas Schildbach
625adf55ea DeterministicKey: fix JavaDoc of deprecated serializePrivB58() 2023-02-27 11:40:33 +01:00
Sean Gilligan
232f194a36 DumpedPrivateKey: fix NPE in deprecated fromBase58() 2023-02-27 11:31:59 +01:00