Commit Graph

183 Commits

Author SHA1 Message Date
Sean Gilligan
86733a9414 build.gradle: update JavaFX to 17.0.6 2023-03-06 18:28:36 +01:00
Andreas Schildbach
558f6df127 DownloadProgressTracker: migrate progress() method to java.time API 2023-03-06 09:58:48 +01:00
Sean Gilligan
6e77dcb433 PlatformUtils: move OS/runtime detection from o.b.core.Utils to new class 2023-02-27 18:34:20 +01:00
Sean Gilligan
03782a4697 InternalUtils: move to o.b.base.internal package 2023-02-24 11:47:59 +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
8348285b39 build.gradle: update ZXing to 3.5.1 2022-11-14 08:24:23 +01:00
Andreas Schildbach
55d1919227 Address, LegacyAddress, SegwitAddress: migrate all usages of deprecated fromKey() to ECKey.toAddress() 2022-08-11 01:49:10 +02:00
Sean Gilligan
51efbcb98c walletfx/WalletApplication: fix context not initialized 2022-08-10 11:26:34 +02:00
Sean Gilligan
51f1d69e87 Address: deprecate fromString, replace with AddressParser
This change migrates from using `NetworkParameters` to `Network` for specifying the network and
also decouples from static methods in `Address` with an interface/implementation approach.

Note that there are 3 use cases for address parsing:

1. Any network is allowed - AddressParser.parseAddressAnyNetwork(String)
2. Parse for a specified network - AddressParser.parseAddress(String, Network)
3. Parse for a previously-specified (context dependent) network - AddressParser.Strict.parseAddress(String)

In most use cases, an AddressParser instance can be accessed through the Wallet,
which already knows the Network type and in this context validation for network makes
sense. This is why `Wallet` is implementing `AddressParser.Strict`

BitcoinURI allocates its own DefaultAddressParser for now, as do some other tests
and examples that don't have access to a Wallet

In the future DefaultAddressParser may be replaced by something loaded
via the ServiceLoader mechanism or other dynamically configured mechanism.
2022-08-03 18:14:48 +02:00
Sean Gilligan
4098995a3c wallettemplate: migrate from NetworkParams to BitcoinNetwork in core classes
When base/core adds the ability to create an address from a `Network` we should
be able to use `Network`/`BitcoinNetwork` for everything.
2022-07-14 00:36:33 +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
Sean Gilligan
3732a61795 WalletApplication: don't use payment protocol ID for filename suffix 2022-06-25 18:16: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
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
b95d526a0e WalletApplication: support BIP-43/BIP-44/BIP-84
Create a new constructor in WalletApplication that defaults KeyChainGroupStructure
to BIP43.
2022-05-03 22:40:29 +02:00
Sean Gilligan
a6e5c88ce8 build.gradle: add detailed deprecation warnings to all modules 2022-04-19 10:07:55 +02:00
Sean Gilligan
6fc45aafe9 build.gradle: update javafxplugin to 0.0.12
Among other things, this version provides support for macOS on M1.
2022-04-12 17:27:50 +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
83cb847bcf build.gradle: update javafxplugin to 0.0.10
This might help with Issue #2300, but is worth updating anyway.
2022-03-05 01:18:00 +01:00
Sean Gilligan
cca322a01d build.gradle: update JavaFX to 17.0.2 2022-03-05 00:48:21 +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
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
Sean Gilligan
839139f8fb walletfx: Initialize scene earlier in MainController 2021-09-23 09:25:36 -07:00
Sean Gilligan
0f8cc09073 walletfx: Improve calculation of estimatedKeyDerivationTime
* Make the static field `estimatedKeyDerivationTime` private
* Refactor the calculation to a private, side-effect free function
* Replace `estimatedKeyDerivationTimeMsec()` with `initEstimatedKeyDerivationTime()`
** Don’t return a value that wasn’t unused anyway
** Make better use of CompletableFuture API
* Platform.runLater wasn’t needed because no JavaFX functions are called
2021-09-23 17:55:19 +02:00
Sean Gilligan
36243ca24e walletfx: factor out WalletApplication::startWalletAppKit 2021-09-23 07:30:15 -07:00
Sean Gilligan
188a0a7e45 walletfx: replace MainController.instance with app.mainWindowController() 2021-09-23 01:04:05 -07:00
Sean Gilligan
85725a18a6 walletfx: WalletApplication to improve encapsulation
* Make all public fields private and wrap with accessors
* Make `WalletAppKit` (was confusingly named `bitcoin`) field a member not a static
* Rename `bitcoin` to `walletAppKit`
2021-09-23 09:57:18 +02:00
Sean Gilligan
515a558ec2 walletfx: Extract MainWindowController abstract base class
* Extract `MainWindowController` from `wallettemplate.MainController`
* WalletApplication: `wallettemplate.MainController` with `MainWindowController`
2021-09-22 12:16:45 -07:00
Sean Gilligan
d1aa5e3d36 walletfx: Extract WalletApplication from WalletTemplate
* Extract abstract class `WalletApplication` from `WalletTemplate`
* `WalletTemplate` implements `loadController()` with resource names
* `MainController`: Add `scene` member and `scene()` method
2021-09-22 11:36:04 -07:00
Sean Gilligan
d8b6733c9c walletfx: Create WalletTemplate implementing AppDelegate
* Introduce `AppDelegate` class for delegating JavaFX `Application`
* Move almost all of `Main` to `WalletTemplate`

Rationale:

* The “template” JavaFX Application main class (`Main`) is now about 30 lines of code
* `Main` class allows easy switching between TestNet and MainNet (in fact it could become a command-line argument) and other configuration changes (e.g. `preferredOutputScriptType`)
* Prepares the way for the next steps of refactoring
2021-09-22 09:21:25 -07:00
Sean Gilligan
a7161eed8e walletfx: Move wallettemplate.controls to org.bitcoinj.walletfx 2021-09-21 07:56:17 -07:00
Sean Gilligan
9292bf3c43 walletfx: Refactor overlay, reduce usage of instance static globals
* OverlayController: rename init method, add rootController to params
* OverlayableStackPaneController: update to use updated initOverlay() method, 
          also pass this.getClass() into GuiUtils.getResource()
* GuiUtils.getResource(): replace reference to MainController.class with clazz parameter
* Main: Reduce visibility to “package” of 3 static globals
* MainController: Reduce visibility of `instance` static to “package”, initialize
                  addressControl by calling 2 initialization methods
* 4 other controllers: Update for OverlayController changes
* ClickableBitcoinAddress: OverlayController changes, eliminate use of Main.APP_NAME

Rationale:

* Decrease coupling
* Eliminate cross-package use of `Main` and `MainController` static globals
* Prepare for further refactoring — moving wallettemplate.controls package
  to org.bitcoinj.walletfx.controls
2021-09-21 09:39:08 +02:00
Sean Gilligan
93f0bb7a54 walletfx: Extract OverlayableStackPaneController
* Extract abstract class OverlayableStackPaneController from MainController
* Rename OverlayWindowController to OverlayController (Window was misleading)

Rationale:

1. Overlay functionality is independent of MainContoller’s wallet functions
2. Increases reusability of classes in module
3. Prepares for further refactoring
2021-09-20 12:20:38 -07:00
Sean Gilligan
44ca7f6689 walletfx: Introduce OverlayWindowController interface
Rationale:

1. Stronger typing makes code more readable and refactorable
2. Eliminates “automatic” reflection in MainController
3. Makes overlayUI field in implementing classes private
4. Is a step towards further refactoring and reusability
2021-09-19 12:35:38 -07:00
Sean Gilligan
17aeea2d75 walletfx: move OverlayUI from Main to MainController
Move OverlayUI and other related functionality from Main (Application) class
to MainController.

Motivation:

1. This simplifies the Main class
2. The code more logically belongs in the controller
3. The code being in the controller increases reusability
4. Is a first step towards additional refactoring made possible
   because MainController can subclass an abstract class and Main
   can’t because it must subclass Application
2021-09-19 19:04:12 +02:00
Sean Gilligan
1e7fc7aad5 walletfx: Hook up the unused “Primary” and “Secondary” buttons
I did this for two reasons:

1. So users will know why the buttons are there and that they work
2. A convenient way to test the informational alert function.
2021-09-18 17:42:33 -07:00
Sean Gilligan
e9980e73fa wallettemplate: rename package wallettemplate.utils to org.bitcoinj.walletfx.utils
This is a step towards (a renewed effort at) separating the wallettemplate
into a JavaFX wallet library and a template application.
2021-09-18 19:03:17 +02:00
Sean Gilligan
62f5097933 build.gradle: Update JavaFX to 17.0.0.1. 2021-09-17 17:33:53 +02:00
Sean Gilligan
65e9d9523b build.gradle: Update ZXing to 3.4.1. 2021-09-17 11:57:24 +02:00
Sean Gilligan
6da10f8641 build.gradle: Update SLF4J to 1.7.32. 2021-09-17 11:51:11 +02:00
Sean Gilligan
1e5fa2ed0c wallettemplate: upgrade JavaFX to version 15
JavaFX 15 is now released and is the now the latest supported
version. It supports JDK 11 and later — same as the previous release.

Release notes are here:
https://github.com/openjdk/jfx/blob/jfx15/doc-files/release-notes-15.md#release-notes-for-javafx-15
2020-09-08 15:43:22 -07:00
Andreas Schildbach
a966cd38a1 Apply "Lambda can be replaced with method reference" refactoring. 2020-09-07 21:15:51 +02:00
Andreas Schildbach
e7b00b65f9 Apply "Statement lambda can be replaced with expression lambda" refactoring. 2020-09-07 21:13:14 +02:00
Andreas Schildbach
c08a4d97d3 Apply "Anonymous type can be replaced with lambda" refactoring. 2020-09-07 21:13:14 +02:00
Andreas Schildbach
4847a9df27 Apply "Explicit generic type can be replaced with <>" refactoring. 2020-09-07 21:10:44 +02:00