Commit Graph

350 Commits

Author SHA1 Message Date
Sean Gilligan
19fcdcdd5b TestFeeLevel, WalletTest: use Wallet.waitForConfirmations() instead of Transaction.getConfidence().getDepthFuture() 2023-08-25 23:42:39 +02:00
Sean Gilligan
49f7ddbc0f BlockImporter: support signet and regtest too
* Update usage for `args[1]` to "(mainnet|testnet|signet|regtest)"
* Use `BitcoinNetwork.fromString()` to parse `args[1]`
2023-08-25 23:14:04 +02:00
Sean Gilligan
b792354f55 BlockImporter: init chain with ternary operator 2023-08-25 23:09:48 +02:00
Sean Gilligan
7f5fc6f2b7 BlockImporter: remove unsupported "Disk" option from usage 2023-08-25 23:07:01 +02:00
Andreas Schildbach
05c625113f TestFeeLevel: use messageSize() not serialize().length 2023-08-10 19:26:53 +02:00
Sean Gilligan
36dce3d9d5 wallet.proto, paymentrequest.proto: move generated files to dedicated packages
* Modify the `java_package` setting in our two `.proto` source files
 * Move 2 existing generated-but-checked-in Protos.java files to
   dedicated packages (i.e. packages without hand-coded "artisanal" files)

This is a step towards more compatibility with ProtoBuf tooling which
sometimes likes to delete the generated files and:

 > can't distinguish between "old generated code" and "your artisan source files."

and more importantly it is a step towards fixing Gradle 8 caching issues.
2023-07-28 21:55:26 +02:00
Sean Gilligan
7efab37c6c DnsDiscovery, MultiplexingDiscovery: use Network in constructors 2023-07-27 10:56:06 +02:00
Sean Gilligan
39c34186cc BlockChain: use Network in constructors
Constructors that take NetworkParameters are marked as @VisibleForTesting.
This is because of the special UNITTEST NetworkParameters that is required for
certain tests.
2023-07-18 23:10:36 +02:00
Andreas Schildbach
ada7fae5aa build.gradle: update picocli to 4.7.4 2023-07-16 13:01:25 +02:00
Andreas Schildbach
5db73f2d7a BitcoinURI: migrate to static from native constructors 2023-04-19 23:08:40 +02:00
Sean Gilligan
9291841f8d Wallet: use Network in static factory methods
* Adds new methods taking `Network` rather than `NetworkParameters`
* Deprecates all converted methods
* Updates tests, examples, and tools that use these calls
2023-04-18 12:47:09 +02:00
Sean Gilligan
5eb67285db Message: rename methods serialize() and messageSize()
Provide deprecated implementations of `bitcoinSerialize()`
and `getMessageSize()`.
2023-04-16 18:49:32 +02:00
Andreas Schildbach
838d14d027 PeerAddress: make immutable
* Static constructors `simple()` and `inet()` that replace the native constructors.
2023-04-13 00:21:36 +02:00
Andreas Schildbach
dedf478c66 Transaction: remove params from constructors 2023-04-03 16:23:13 +02:00
Sean Gilligan
772bccd5f8 MemoryBlockStore: construct with genesis block
It doesn't need an entire `NetworkParameters`.
2023-03-31 22:14:06 +02:00
Sean Gilligan
8576602180 BlockFileLoader: convert to Network, deprecate constructors with NetworkParameters 2023-03-30 18:59:19 +02:00
Andreas Schildbach
773a9aeb4e PeerAddress: remove params from constructor
To make this possible, a port has to be specified in all cases.
2023-03-30 18:03:18 +02:00
Sean Gilligan
b24964d056 TransactionBroadcast: add awaitRelayed(), deprecate future()
* Add `awaitRelayed()` method that returns a CF that completes when relaying is confirmed.
* Deprecate `future()` and reimplement it using `awaitRelayed()`.
2023-03-27 18:38:15 +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
7fba2d8c6b Message: fold unsafeBitcoinSerialize() into bitcoinSerialize() 2023-03-22 02:21:21 +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
2061555afa WatchMempool: migrate class to java.time API 2023-03-18 20:57:44 +01:00
Andreas Schildbach
7090c6a152 PaymentSession: rename time() method from getTime() 2023-03-18 11:06:17 +01:00
Andreas Schildbach
e6e4745e1a Block: rename time() method from getTimeInstant() 2023-03-18 10:22:26 +01:00
Andreas Schildbach
2cf4f17458 PaymentProtocolTool: use TimeUtils.dateTimeFormat() to dump expiry time 2023-03-14 10:00:49 +01:00
Andreas Schildbach
168ff75bd1 TimeUtils: migrate dateTimeFormat() method to java.time API 2023-03-14 01:32:59 +01:00
Andreas Schildbach
4ae610f9cd BuildCheckpoints: migrate to java.time API 2023-03-13 22:12:18 +01:00
Andreas Schildbach
be0b2b46b8 PaymentSession: migrate getters to java.time API 2023-03-10 16:43:09 +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
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
Sean Gilligan
0d6da641d8 BlockImporter: use switch statement for store argument 2023-02-16 12:01:26 +01:00
Andreas Schildbach
7b970e6001 build.gradle: update picocli to 4.7.1 2023-01-29 21:35:31 +01:00
Andreas Schildbach
8bd519624d build.gradle: update picocli to 4.7.0 2022-11-14 08:10:13 +01:00
Sean Gilligan
10e701f8d7 WalletAppKit, DefaultCoinSelector, BuildCheckpoints: simplify some network-related comparisons
Enums can use ==/!=.
2022-08-22 22:27:46 +02:00
Andreas Schildbach
410b127176 DatabaseFullPrunedBlockStore: remove all database backed block stores
All of them are unmaintained and their tests are in the way of refactorings.
MySQL and Postgres had been disabled for a while, and one seems to care.
H2 is tested, but pulls a driver dependency into the test classpath.
2022-08-11 17:36:27 +02:00
Sean Gilligan
02aa41e254 TestFeeLevel, DoubleSpend, SendRequest: construct WalletAppKit with BitcoinNetwork constant
This reduces usage of NetworkParameters in WalletAppKit-based examples and tools.
2022-08-01 10:00:06 +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
Sean Gilligan
9f02cd2af3 WalletAppKit: add constructor with BitcoinNetwork, deprecate others
* WalletAppKit: add a constructor that takes a BitcoinNetwork
* WalletAppKit: deprecate constructors taking netParams or Context
* WalletAppKit: add an accessor for network()
* Update examples, tools, and wallettemplate to use the new constructor
2022-07-13 22:59:17 +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
bd002594eb Context: remove useless Context instantiations from a few tests 2022-06-26 17:26:04 +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
c3896e6caf examples/tools: use explicit script type and wallet structure
* Explicitly use P2WPKH (this changes behavior to segwit)
* Explicitly use BIP32 (this is the same behavior as before)
2022-04-30 23:24:25 +02:00
Sean Gilligan
1283fe6f36 Network.java: remove PROD (alias for MAIN)
This affects the command-line UI of some tools, but since the `Network`
enum hasn't been released yet, we can remove it without deprecating
first.
2022-04-29 01:19:22 +02:00
Sean Gilligan
a6e5c88ce8 build.gradle: add detailed deprecation warnings to all modules 2022-04-19 10:07:55 +02:00
Sean Gilligan
1343776286 convert ImmutableList to unmodifiable list
This converts all remaining instances of ImmutableList (except those
in core tests) to JDK unmodifiable list.
2022-03-30 16:33:22 +02:00