Commit Graph

336 Commits

Author SHA1 Message Date
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
Sean Gilligan
7626b27850 build.gradle: update picocli to 4.6.3 2022-02-18 09:02:24 +01:00
Sean Gilligan
ea208935ff build.gradle: Update SLF4J to 1.7.36
Starting with version 1.7.36, SLF4J releases are reproducible.
2022-02-18 08:54:36 +01:00
Andreas Schildbach
6ad636ccec SigNetParams: support signet 2022-02-11 10:52:49 +01:00
Andreas Schildbach
7d1d7ecd09 BuildCheckpoints: make sure the bitcoinj context is set on the thread 2022-01-28 01:16:49 +01:00
Sean Gilligan
da6d6be288 WalletTool: Move to its own wallettool submodule 2022-01-05 00:24:42 +01:00
Sean Gilligan
0d67977ca1 build.gradle: Update examples and tools submodules to JDK 11 2022-01-04 03:03:44 +01:00
Sean Gilligan
dda89aad57 Network: move class from tools subproject to core (o.b.utils) 2022-01-03 21:59:19 +01:00
Sean Gilligan
3c3279fa04 tools: Add id() and networkParameters() methods to Network (was NetworkEnum)
* Rename from `NetworkEnum` to `Network`
* Use new methods to simplify BuildCheckpoints and WalletTool
* Remove unused imports
2022-01-01 14:42:04 +01:00
Sean Gilligan
a2cf303655 build.gradle: require JDK 11 for the build
Uses javac -release option to validate API for older JDK.
2021-12-24 11:35:37 +01:00
Andreas Schildbach
05dfddc98c make sure to use position(int), flip() and rewind() only from Buffer rather than MappedByteBuffer
Without these casts, on some JDKs it links against overloaded methods in MappedByteBuffer and Andoid doesn't have them.
2021-10-06 18:49:36 +02:00
Andreas Schildbach
484275678d WalletTool: Implement two coin selection options for sending, --select-addr and --select-output. 2021-09-29 22:46:59 +02:00
Andreas Schildbach
d3505b8949 WalletTool: When specifying ALL as a value of an output, use the correct BalanceType suitable for the value of --allow-unconfirmed. 2021-09-29 22:46:59 +02:00
Andreas Schildbach
f859f571ca BasicKeyChain, DeterministicKeyChain, WalletTool: use only protobuf API that is available also on protobuf-lite
This is meant to aid migration to protobuf-lite.
2021-09-24 11:33:06 +02:00
Sean Gilligan
6da10f8641 build.gradle: Update SLF4J to 1.7.32. 2021-09-17 11:51:11 +02:00