Sean Gilligan
41ed5a984b
Wallet: deprecate public fields in SendResult
, replace with accessors
...
* Deprecate public fields in `SendResult`
* Make available equivalent accessors
* Update all usages
This prepares the way for replacing `SendResult` with `TransactionBroadcast`
in the future.
2023-03-27 20:22:35 +02:00
Andreas Schildbach
b528fb5180
build.gradle: update SLF4J to 2.0.7
...
Starting with SLF4J 2.0.0, we can use the fluent logger API.
2023-03-27 15:25:02 +02:00
Andreas Schildbach
150c911750
LegacyAddress: flip arguments of new static constructor fromBase58()
...
Otherwise the deprecation cycle won't be of much use for consumers who pass `null` for `params`.
2023-03-27 09:17:37 +02:00
Andreas Schildbach
47a5d73035
ByteUtils: rename all writeUInt*()
helpers to writeInt*()
...
This creates overloads in some cases.
2023-03-24 19:34:06 +01:00
Andreas Schildbach
7fba2d8c6b
Message: fold unsafeBitcoinSerialize()
into bitcoinSerialize()
2023-03-22 02:21:21 +01:00
Andreas Schildbach
0da35c6a0c
VarInt: migrate native constructors to static constructors
...
The old native constructors have been deprecated.
2023-03-21 23:02:41 +01:00
Andreas Schildbach
9d9cadd59c
Message: in constructors wrap payload bytes and offset into a ByteBuffer
...
This reduces arguments of constructors and does away with
a couple of constructor variants.
2023-03-21 17:55:32 +01:00
Andreas Schildbach
371025f604
ByteUtils: rename helpers that write to byte arrays or streams to write*()
...
Note the read helpers already follow the `read*()` pattern.
2023-03-21 17:10:17 +01:00
Andreas Schildbach
34d8948be9
Message: do away with retaining of original message payload
...
This removes all caching of original message payload and "retain mode" in message serializers.
There is some effect on tests. Asserts on the cache status have been removed, rendering some
tests almost pointless. Rather than removing them, comments have been added to explain the
history of these tests. An assert on a large binary blob of a block was dependent on retain mode, likely
due to non-optimal encoding. It had to be disabled.
Note: Some classes still cache individual values, like hashes.
2023-03-20 16:55:29 +01:00
Andreas Schildbach
04c72ce003
Peer: migrate pingIntervals
field to java.time
API
2023-03-19 20:15:00 +01:00
Andreas Schildbach
e37b2ad78c
Preconditions: replace Guava checkArgument()
and checkState()
for the entire codebase
...
This also fixes many precondition messages, and rewrites two cases
of `checkPositionIndex()` and `checkElementIndex()`.
2023-03-19 17:48:27 +01:00
Andreas Schildbach
b309308076
EncryptableItem: rename creationTime()
method from getCreationTime()
2023-03-18 11:23:05 +01:00
Andreas Schildbach
45f87d8339
PeerGroup: rename fastCatchupTime()
method from getFastCatchupTime()
2023-03-18 11:16:31 +01:00
Andreas Schildbach
c2cabead9a
TransactionConfidence: rename lastBroadcastTime()
method from getLastBroadcastTime()
2023-03-18 11:11:05 +01:00
Andreas Schildbach
9ec245c259
Objects: migrate entire codebase to requireNonNull()
from Guava Precondition.checkNotNull()
...
This has the added benefit of exception messages being evaluated on demand.
2023-03-16 20:12:28 +01:00
Andreas Schildbach
006c00ac35
TestWithNetworkConnections: pick random TCP bind ports for each test instance
...
This will hopefully reduce spurious test failures due to already bound ports.
2023-03-10 23:43:14 +01:00
Andreas Schildbach
7e70541658
PeerGroup: migrate vConnectTimeout
field to java.time
API
2023-03-10 22:32:47 +01:00
Andreas Schildbach
54754e14e9
EncryptableItem, ECKey, DeterministicKey, DeterministicSeed: migrate creationTime
field to java.time
API
2023-03-10 09:28:27 +01:00
Sean Gilligan
3023947df8
ByteUtils: move to o.b.base.internal
...
We don't consider ByteUtils to be part of our external API.
2023-03-10 01:28:23 +01:00
Andreas Schildbach
92ee36848c
DeterministicSeed: introduce static constructors meant for external consumers
...
* 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.
2023-03-10 00:53:35 +01:00
Andreas Schildbach
46dcfc6bda
TestWithNetworkConnections: ask Wallet for an Address right away
...
Previously, it was asking for a key and converted manually.
2023-03-08 17:29:51 +01:00
Andreas Schildbach
16c90d2891
TimeUtils: migrate mock clock to java.time
API
...
* Migrate `setMockClock()` parameters to Instant
* Migrate `rollMockClock()` parameters to Duration
* Rename to `clearMockClock()` from `resetMocking()`
* Use `Clock` internally to provide the time
2023-03-08 16:20:48 +01:00
Andreas Schildbach
6eed19d449
PeerTest, TransactionBroadcastTest: clear the mock clock after some tests that use it
2023-03-07 16:08:40 +01:00
Andreas Schildbach
d1e2e71bb5
TransactionConfidence: migrate lastBroadcastedAt
field to java.time
API
2023-03-07 00:41:55 +01:00
Andreas Schildbach
310b93be4e
Peer, PeerGroup: migrate fastCatchupTime
field to java.time
API
2023-03-06 09:50:07 +01:00
Andreas Schildbach
913f5ac8c6
PeerDiscovery: migrate getPeers() to java.time
API
2023-03-03 00:10:35 +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
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
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
d86406ab2e
TimeUtils: move (mock) time utils from o.b.core.Utils to new class
2023-02-27 19:32:50 +01:00
Sean Gilligan
484b7185d4
VarInt: move to o.b.base package
2023-02-24 11:24:58 +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
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
Andreas Schildbach
a480bc3281
TransactionBroadcastTest: always compare txId with a txId
2023-02-09 14:39:34 +01:00
Andreas Schildbach
27cc40a301
build.gradle: update EasyMock to 5.1.0
2023-01-29 21:52:41 +01:00
Andreas Schildbach
5a43d69775
build.gradle: update equalsverifier to 3.11
2022-11-14 08:24:23 +01:00
Andreas Schildbach
a9fcec648d
build.gradle: update EasyMock to 5.0.1
2022-11-14 08:24:23 +01:00
Sean Gilligan
9dcebb1975
ForwardingServiceTest: new test for starting up and shutting down ForwardingService
...
Because the tests can use the network, the tests are @Disabled by default.
2022-08-14 11:43:59 +02:00
Sean Gilligan
f59dc54ac8
Address: construct with and store Network, rather than NetworkParametesr
...
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
2022-08-11 02:40:33 +02:00
Andreas Schildbach
55d1919227
Address, LegacyAddress, SegwitAddress: migrate all usages of deprecated fromKey() to ECKey.toAddress()
2022-08-11 01:49:10 +02:00
Andreas Schildbach
d0420cbcd0
PeerTest: use TestNet3Params, rather than UnitTestParams
2022-08-02 15:46:25 +02:00
Andreas Schildbach
4d1e8d659e
TransactionBroadcastTest: use TestNet3Params, rather than UnitTestParams
2022-08-02 15:16:57 +02:00
Andreas Schildbach
1f10855462
FilteredBlockAndPartialMerkleTreeTest: use TestNet3Params, rather than UnitTestParams
2022-08-02 15:14:35 +02:00
Andreas Schildbach
c56fab863b
Context: introduce relaxProofOfWork
property
...
This allows unit-tests to disable enforcement of proof of work, so that fake blocks
can be created and solved in short time.
2022-08-01 19:07:07 +02:00
Andreas Schildbach
2e651c35b7
FilteredBlockAndPartialMerkleTreeTest: simplify test wallet creation
2022-08-01 14:24:17 +02:00
Andreas Schildbach
ae63dfb561
FilteredBlockAndPartialMerkleTreeTest: rewrite most assertTrue() as assertEquals()
2022-08-01 14:08:23 +02:00
Sean Gilligan
295ce50782
TransactionBroadcast: add broadcastOnly(), broadcastAndAwaitRelay() deprecate broadcast()
2022-07-31 12:28:18 +02:00
Sean Gilligan
900af2bde9
build.gradle: update JUnit 5 to 5.9.0
2022-07-28 20:50:06 +02:00
Andreas Schildbach
e12ad507ba
WalletAppKitTest: fix using wrong annotation for disabling tests
2022-07-28 20:01:02 +02:00