Commit Graph

206 Commits

Author SHA1 Message Date
Sean Gilligan
af7c903df7 GuiUtils: use UI_ANIMATION_TIME consistently, deprecate UI_ANIMATION_TIME_MSEC 2023-09-12 18:01:40 +02:00
Sean Gilligan
b83c0b96e6 WalletApplication: remove unreachable default case in suffixFromNetwork() 2023-09-12 17:59:43 +02:00
Sean Gilligan
b5d3c07612 WalletApplication: use switch expression in suffixFromNetwork() 2023-09-12 17:56:45 +02:00
Sean Gilligan
6fc1087aba wallettemplate: mark fields as final
This commit fixes every IntelliJ warning about fields being final for
the wallettemplate module.
2023-09-12 17:54:46 +02:00
Sean Gilligan
7a1135246c EasingInterpolator: remove redundant default clause from switch expression 2023-09-12 17:52:04 +02:00
Sean Gilligan
7a30041578 EasingInterpolator: use switch expression 2023-09-12 17:43:31 +02:00
Sean Gilligan
9e9d3afd6a WTUtils: fix warning about raw generic 2023-09-12 17:40:33 +02:00
Sean Gilligan
8aa808f7d4 build.gradle: update JavaFX to 20.0.2 2023-09-07 11:06:14 +02:00
Sean Gilligan
96d0022d09 build.gradle: update javafxplugin to 0.1.0 2023-09-07 11:04:03 +02:00
Sean Gilligan
0fe0daba59 wallettemplate: require JDK 17+ and Gradle 7.3+
Also update the README for latest build JDK/Gradle information.
2023-09-06 23:47:07 +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
dead2c74ab AddressParser: simpler address parsing by making it a @FunctionalInterface
We`re making `AddressParser` the `@FunctionalInterface` and a nested class
is used to define an `AddressParserProvider`
2023-07-18 23:54:59 +02:00
Sean Gilligan
41ed5a984b Wallet: deprecate public fields in SendResult, replace with accessors
* Deprecate public fields in `SendResult`
* Make available equivalent accessors
* Update all usages

This prepares the way for replacing `SendResult` with `TransactionBroadcast`
in the future.
2023-03-27 20:22:35 +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
Sean Gilligan
b7cf58ba6d GuiUtils: replace Guava Throwables.getRootCause() with private helper method
Private helper walks up the chain and avoids loops.
2023-03-26 01:50:02 +01:00
Sean Gilligan
66d96ab29d WalletPasswordController: remove use of Guava Longs
Use ByteBuffer in private methods for long to byte[] conversion.
2023-03-26 01:47:03 +01:00
Sean Gilligan
8566819ff2 SendMoneyController: use CompletableFuture not Guava
This is the last remaining use of Guava futures in
WalletTemplate.
2023-03-26 01:35:34 +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
b309308076 EncryptableItem: rename creationTime() method from getCreationTime() 2023-03-18 11:23:05 +01:00
Andreas Schildbach
9ec245c259 Objects: migrate entire codebase to requireNonNull() from Guava Precondition.checkNotNull()
This has the added benefit of exception messages being evaluated on demand.
2023-03-16 20:12:28 +01:00
Andreas Schildbach
54754e14e9 EncryptableItem, ECKey, DeterministicKey, DeterministicSeed: migrate creationTime field to java.time API 2023-03-10 09:28:27 +01:00
Andreas Schildbach
92ee36848c DeterministicSeed: introduce static constructors meant for external consumers
* native constructors that were meant to be called by consumers now have static equivalents
* all native constructors are discouraged from being used by a JavaDoc comment
* one constructor that wasn't meant to be used by consumers is switched to private access
* tests and tools that resemble consumers are updated to use the new API

Note: although most native constructors are now deprecated, we're not using
annotations because we're still calling them.
2023-03-10 00:53:35 +01:00
Sean Gilligan
c41128b4df AesKey: replace o.bouncycastle.c.p.KeyParameter
We were using KeyParameter as a wrapper for a byte[] containing an
AES Key and passing it around our API. This introduced an unnecessary
API dependency on Bouncy Castle. This PR adds an AesKey class
for the same purpose to replace it.

This is a breaking change, but one that should be easy to accommodate.
2023-03-08 18:13:21 +01:00
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