Commit graph

36 commits

Author SHA1 Message Date
Andreas Schildbach
f6cb6c15d1 CoinSelection: add a new constructor that doesn't require valueGathered
We'll add the output values up ourselves.

This also deprecates the old constructor.
2022-07-19 09:37:27 +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
665574add5 WalletTool: use BitcoinNetwork::toString for chain fileName 2022-07-13 22:09:47 +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
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
44d0576ce4 org.bitcoinj.base: move Base58, Bech32, AddressFormatException to base 2022-06-23 11:48:01 +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
8f2757c0eb WalletTool: explicitly specify BIP32 in createWallet() 2022-05-03 20:04:16 +02:00
Sean Gilligan
e428cfbc04 wallet-tool: Add nativeCompile task for GraalVM
Also add graalvm.yml to do a nativeCompile build on Github Actions
2022-05-02 11:57:59 -07: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
bb8687f278 Wallet: add WalletFactory parameter to loadFromFile() 2022-04-15 14:56:27 +02:00
Sean Gilligan
e6dd75d823 wallettool: add some first basic JUnit 5 tests
Also update gradle.yml to upload test results to GitHub.
2022-04-15 14:42:58 +02:00
Sean Gilligan
05b0ee144b WalletTool: declare specific exceptions for call() 2022-04-14 15:33:22 +02:00
Sean Gilligan
eede925c96 Wallet: add loadFromFile method that supports WalletTool
* Add `Wallet.loadFromFile` that takes options needed by WalletTool
* Add `Wallet.loadFromFileStream` that supports the extra options
* Update `WalletTool` to use the new `loadFromFile` method
2022-04-12 17:38:19 +02:00
Sean Gilligan
1219e0d7b0 InternalUtils: replace Guava Joiner and Splitter with native JDK equivalent
Also deprecate the old Joiner and Splitter related members of Utils.
2022-04-10 16:20:00 +02:00
Sean Gilligan
56d89f37ac WalletTool: remove unnecessary null assignments 2022-04-09 10:54:52 +02:00
Sean Gilligan
3ea2dc40d9 WalletTool: remove superfluous throws Exception from main
main() currently throws no checked exceptions. This is a good thing and
means all checked exceptions are caught and (hopefully properly) handled by
outputting error messages and return a non-zero exit code.
2022-04-01 20:27:13 +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
25d4b8b8a0 WalletTool: improve sendPayment() exception handling
* Split the long `try` block into multiple `try/catch` blocks
* Consistently use System.err.println and System.exit on errors
* System.out.println an information message before falling back to `broadcastPayment`
2022-03-25 20:35:35 +01:00
Sean Gilligan
091fdd9791 PaymentSession: proper future-style error handling for sendPayment()
This is a breaking change, but the existing code is not using futures properly and
fixing this is worth the breakage.

* Instead of returning `null`, return a failed future
* Instead of throwing errors, return failed futures
2022-03-25 19:33:08 +01:00
Sean Gilligan
a20db6ed2c WalletTool: migrate from ListenableFuture to CompletableFuture 2022-03-07 23:24:18 +01:00
Sean Gilligan
55b87f497c build.gradle: fix hasAnnotationProcessor check 2022-03-05 00:07:12 +01:00
Sean Gilligan
4cde8940fc wallettool/build.gradle: generate man, html5 and adoc manpages
Adds the picocli-codegen annotation processor.

To build the documentation use `gradle bitcoinj-wallettool:asciidoctor`. The results are in:

 * wallettool/build/generated-picocli-docs/wallet-tool.adoc (asciidoc source)
 * wallettool/build/docs/html5/wallet-tool.html (HTML version)
 * wallettool/build/docs/manpage/wallet-tool.1 (man format)
2022-02-25 21:46:54 +01:00
Sean Gilligan
0a1e1ca8a0 WalletTool: extract common code from dumpWallet() into printWallet() 2022-02-23 16:11:18 +01:00
Andreas Schildbach
f3a314e2d9 global replace SegWit by segwit 2022-02-18 10:42:12 +01: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
435e39a841 Utils: add bytesToBigInteger() helper and use it
This is the antagonist to Utils.bigIntegerToBytes().
2022-02-11 16:17:24 +01:00
Andreas Schildbach
6ad636ccec SigNetParams: support signet 2022-02-11 10:52:49 +01:00
Kasim G
a31cbe0470 apply "Anonmyous type can be replaced with lambda" refactoring 2022-01-28 17:18:42 +01:00
Sean Gilligan
da6d6be288 WalletTool: Move to its own wallettool submodule 2022-01-05 00:24:42 +01:00