Commit graph

4204 commits

Author SHA1 Message Date
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
Sean Gilligan
8ba45dd812 CrytoUtils: new internal utils, move sha256hash160() from Utils 2023-02-27 11:25:00 +01:00
Sean Gilligan
03782a4697 InternalUtils: move to o.b.base.internal package 2023-02-24 11:47:59 +01:00
Sean Gilligan
484b7185d4 VarInt: move to o.b.base package 2023-02-24 11:24:58 +01:00
Sean Gilligan
0d3c9780b0 SignatureDecodeException: move to o.b.crypto package 2023-02-24 11:21:11 +01:00
Sean Gilligan
0b865408e6 DRMWorkaround: remove workaround for AES-256 in older Java
Android and OpenJDK don't need this and I'm pretty sure that
Oracle JDK 9 and even recent builds of Oracle JDK don't need it either.
2023-02-24 10:55:45 +01:00
Sean Gilligan
1b0ac02eed ECKey, DumpedPrivateKey, EncodedPrivateKey: move to o.b.crypto package
Also move associated tests and test resources.
2023-02-24 10:49:35 +01:00
Sean Gilligan
74821e3517 DefaultAddressParser: move from o.b.core to base 2023-02-24 09:45:59 +01:00
Sean Gilligan
aaf83be6f8 LegacyAddressTest, SegwitAddressTest: convert to Network from NetworkParameters
Finish conversion from NetworkParameters to Network in the tests. This cleans up
the code, too.

There are still some references to NetworkParameters in LegacyAddressTest:

1. Tests of deprecated methods that can be removed when those methods are removed
2. Tests that need getP2SHHeader() which hasn't moved to Network yet.
2023-02-24 09:33:10 +01:00
Sean Gilligan
10af4cdae9 NetworkParameters: migrate getSegwitAddressHrp() to Network.segwitAddressHrp()
Deprecate the old method.
2023-02-22 11:44:30 +01:00
Sean Gilligan
804e8cafec examples: always use BitcoinNetwork enum to specify network
* Replace all usages of *Net*Params.get() with BitcoinNetwork.* enum
* Where NetworkParameters is needed get it with NetworkParameters.of(network)

This change does the following:

* Makes it clear that BitcoinNetwork.* is the preferred method of specifying/declaring
  the active network.
* Prepares the way for examples to get the network string as a command-line arg
* Continues the general migration from NetworkParameters to Network
2023-02-21 18:54:37 +01:00
Sorn Županić Maksumić
b59cc7447d README.adoc: fix invalid option for value --net 2023-02-21 18:46:40 +01:00
Andreas Schildbach
e27baa1012 DefaultRiskAnalysisTest: fix context not initialized 2023-02-19 12:24:45 +01:00
Andreas Schildbach
bb3fb79f06 Message: deprecate method getHash()
It's not implemented anyways and only used as a generalization of some subclass implementations.
2023-02-19 10:56:23 +01:00
Sean Gilligan
a62ec7921e SegwitAddressTest: add two tests for P2WPKH REGTEST 2023-02-18 00:40:31 +01:00
Sean Gilligan
0acfcb10ec PeerGroup: migrate constructors argument from NetworkParameters to Network
* Add 3 new constructors which take Network
* Deprecate (2 of 3) constructors that take NetworkParameters
* Mark 3-arg NetworkParameters constructor as @VisibleForTesting
2023-02-17 20:21:48 +01:00
micheal swiggs-malmevik
81ddf4f27e Script: remove deprecated method executeScript() 2023-02-17 20:11:40 +01:00
micheal swiggs-malmevik
54c85b2574 Script: remove a couple of deprecated pattern matchers
They had been moved to ScriptPattern.
2023-02-17 20:05:31 +01:00
Sean Gilligan
d354bc13ce Address, LegacyAddress, SegwitAddress, AddressParser: move to o.b.base
* Move related tests too
* Update imports in referencing classes
2023-02-16 22:50:02 +01:00