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
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
Andreas Schildbach
e12ad507ba
WalletAppKitTest: fix using wrong annotation for disabling tests
2022-07-28 20:01:02 +02:00
Sean Gilligan
6b131a7780
WalletAppKitTest: new integration-test for WalletAppKit
2022-07-28 19:34:35 +02:00
Andreas Schildbach
fb90c4458d
Context: remove network parameters
...
This is the first step in the goal of making Context optional again,
using it only for configuration of a test environment.
2022-07-14 01:59:49 +02:00
Andreas Schildbach
50ccb6b8fc
Network: rename MAIN to MAINNET and TEST to TESTNET
...
The old, shorter names can be used as an alternate name so they will still be accepted for user-facing input.
2022-07-13 22:04:31 +02:00
Sean Gilligan
b8729f2fbd
Network: rename to BitcoinNetwork
...
This is done in preparation for introducing a `Network` interface as a parent,
coming in a future commit.
2022-06-27 12:11:25 +02:00
Sean Gilligan
bfa6536942
org.bitcoinj.base: move Network to base
2022-06-26 20:05:09 +02:00
Andreas Schildbach
76c8d71e44
Context: fix implicit context propagation by constructor
...
We used to do this a long time ago, but switched the codebase to explicit propagation.
Generally, constructors should not have any side-effects.
2022-06-26 17:09:15 +02:00
Andreas Schildbach
05394641ce
TestWithNetworkConnections: remove unused context
field
2022-06-26 17:05:47 +02:00
Sean Gilligan
a0b0392093
NetworkParameters: depend on Network enum, rather the reverse
...
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.
2022-06-24 12:30:40 +02:00
Sean Gilligan
0645a835de
org.bitcoinj.base: move Script.ScriptType to a top level type in base
2022-06-22 18:13:34 +02:00
Sean Gilligan
93cc0ac9c5
org.bitcoinj.base: move Sha256Hash and byte/math Utils members to base
...
* move o.b.core.Sha256Hash to o.b.base.Sha256Hash
* move byte and math utility methods from o.b.core.Utils to a new
o.b.base.ByteUtils class
2022-06-22 17:40:50 +02:00
Sean Gilligan
84e737acdf
org.bitcoinj.base: introduce new package that provides fundamental types with minimal dependencies
...
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.
2022-06-21 19:25:47 +02:00
Sean Gilligan
6d70c60bca
PeerTest: static import of FakeTxBuilder methods
2022-05-31 14:01:42 +02:00
Sean Gilligan
8800840e7e
integration-test: move tests derived from TestWithNetworkConnections to integration-test submodule
2022-05-31 13:56:38 +02:00
Sean Gilligan
c5fd900346
WalletAccountPathTest: use Wallet.fromSeed() to simplify private createWallet()
2022-05-03 20:37:56 +02:00
Sean Gilligan
3a0060461f
KeyChainGroupStructure: Deprecate DEFAULT structure
...
Deprecates DEFAULT and uses BIP32 internally where DEFAULT
had been used before.
This makes the code more clear. I think it makes sense to be
explicit when specifying a KeyChainGroupStructure and not have
a DEFAULT symbol (which implies the default might change.)
2022-05-01 22:05:47 +02:00
Sean Gilligan
8ade47d97a
WalletAccountPathTest: create wallets in temp dir and verify account paths
2022-04-29 21:08:45 +02:00
Sean Gilligan
756e502580
WalletLoadTest: add an assert for accountPath
2022-04-29 00:14:18 +02:00
Sean Gilligan
b0a5662719
WalletLoadTest: add as a first integration test
2022-04-13 20:22:37 +02:00