Commit Graph

4058 Commits

Author SHA1 Message Date
Sean Gilligan
47eb2620cc o.b.c.net: TimeoutHandler interface replaces abstract base class
* Create TimeoutHandler interface
* Create standalone SocketTimeoutTask to implement it
* Deprecate and replace AbstractTimeoutHandler

This simplifies the inheritance of PeerSocketHandler and NioClient and
will enable future refactoring.
2022-07-06 15:39:53 +02:00
Sean Gilligan
458b777d51 PeerGroup: use standard ScheduledExecutorService instead of Listenable
Since we migrated to (Listenable)CompletableFuture in startAync/stopAsync
we no longer need it.
2022-07-06 15:27:27 +02:00
Sean Gilligan
043993645d TaggableObject, BaseTaggableObject: deprecate setting and getting tags on objects
The only known usage of this feature is in the JavaFX wallettemplate where
it is used to save the estimated elapsed time for deriving a key for purposes
of displaying a progress bar.
2022-07-06 15:18:26 +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
3bb2af795f Address: deprecate getParameters() and find alternatives for its usages
* Add NetworkParameters.fromAddress() method to consolidate the use cases
  where an Address is used to get a NetworkParameters
* Deprecate NetworkParameters.fromAddress() to indicate code must be rewritten
* This also removes one dependency on NetworkParameters in Address and helps
  prepare for moving Address to `o.b.base`
2022-06-26 22:05:44 +02:00
Sean Gilligan
bfa6536942 org.bitcoinj.base: move Network to base 2022-06-26 20:05:09 +02:00
Sean Gilligan
26117bbda8 Address: add network() helper to allow migrating away from using NetworkParameters 2022-06-26 19:49:20 +02:00
Sean Gilligan
1d5e752917 Address: implement PrefixedChecksummedBytes inline, rather than extend it
In preparation for future refactoring of Address, we don't want Address
tied to a base class with dependencies on o.b.core or NetworkParameters.

We also want the option of making Address itself an interface in the future.

This results in some code duplication but there is no strong need for or
use of polymorphism in the subclasses of PrefixedChecksummedBytes.

Since equals() was copied from NetworkParameters into Address, create AddressTest
and copy the equals() test from PrefixedChecksummedBytesTest.
2022-06-26 19:36:29 +02:00
Andreas Schildbach
bd002594eb Context: remove useless Context instantiations from a few tests 2022-06-26 17:26:04 +02:00
Andreas Schildbach
76c8d71e44 Context: fix implicit context propagation by constructor
We used to do this a long time ago, but switched the codebase to explicit propagation.
Generally, constructors should not have any side-effects.
2022-06-26 17:09:15 +02:00
Andreas Schildbach
05394641ce TestWithNetworkConnections: remove unused context field 2022-06-26 17:05:47 +02:00
Sean Gilligan
ddfaa606af ScriptType: add ID string, deprecate numeric ID 2022-06-26 16:03:16 +02:00
Sean Gilligan
a40ca0ce26 NetworkParameters: deprecate/move fromID()
Deprecate static fromID() method that only knows about Bitcoin networks and
move to AbstractBitcoinNetParams.
2022-06-25 14:52:18 -07:00
Sean Gilligan
fc036c6fd0 NetworkParameters: fix JavaDoc error that breaks build
Removing the whole line because the suggested method doesn't exist yet.
2022-06-25 22:58:09 +02:00
Sean Gilligan
ce103ed2c3 NetworkParameters: move payment protocol related IDs and methods to PaymentProtocol
The old symbols are marked as deprecated.
2022-06-25 18:26:37 +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
a8b83c95e7 GitHub graalvm.yml: run test task
This makes sure that unit and integration tests are run before doing
the native compile.
2022-06-25 12:26:45 +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
Andreas Schildbach
7db1521b6c ByteUtils: fix integer shift implicitly cast to long problem 2022-06-23 17:06:33 +02:00
Andreas Schildbach
8ab62e7149 ByteUtils: fix redundant type casts 2022-06-23 17:06:33 +02:00
Andreas Schildbach
91f22138e8 ByteUtils: fix long literal ends with lowercase l problems 2022-06-23 17:06:28 +02:00
Sean Gilligan
ef870fcbc8 PrefixedChecksummedBytes: remove unused transient keyword
Now that serialization support has been removed from PrefixedChecksummedBytes,
we no longer need the `transient` keyword.
2022-06-23 16:54:27 +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
a4ea1f62bb BasicKeyChain, KeyChainGroup: functional earliest key creation time 2022-06-20 11:41:01 +02:00
Sean Gilligan
69ff779a82 DeterministicKey: deprecate serializeP*B58 methods with outputScriptType parameter
The reasons are explained in the added JavaDoc.

* Add deprecation and JavaDoc comments
2022-06-20 11:22:08 +02:00
Sean Gilligan
6688a472f1 KeyChainGroup: supportsDeterministicChains() without the 'is'
The JavaBean-style syntax is unnecessary and distracting here. Rename
the method and provide the old name as a deprecated method.
2022-06-19 13:43:06 +02:00
Sean Gilligan
4e5c00937f Wallet: private listener lists as List type (was CopyOnWriteArrayList)
This simplifies the declaration and verifies that we're using the standard List
interface in all our code. The implementation remains unchanged.
2022-06-19 13:33:48 +02:00
Sean Gilligan
6671bc01c6 VarInt: make value member private 2022-06-19 12:44:59 +02:00
Sean Gilligan
7e1be32369 Wallet.calculateAllSpendCandidates: make more functional
Use a filtered stream to generate an unmodifiable list.
2022-06-19 12:01:13 +02:00
Sean Gilligan
36ac6926e9 Wallet: minor JavaDoc improvements 2022-06-18 16:25:49 -07:00
Andreas Schildbach
24095fd9b8 NativeSecp256k1: deprecate native interface to libsecp256k1
This native implementation is unmaintained and untested for years.
2022-06-15 10:34:17 +02:00
Sean Gilligan
7f50aa78b3 org.bitcionj.jni: deprecate all classes
These native implementations have been unused and unmaintained for years.
2022-06-15 10:22:54 +02:00
Sean Gilligan
5ae7a42a9e DeterministicKey: remove deprecated serializePublic/serializePrivate
Add a package-visible serialize() method annotated with @VisibleForTesting to
support existing tests.
2022-06-13 10:35:05 +02:00
Sean Gilligan
1aa1bf6d94 Remove all usage of Java Serialization
* Remove all implementations of `Serializable`
* Remove unit tests of Java serialization
2022-06-12 10:39:24 -07:00
Sean Gilligan
f6b3d82e8d PrefixedChecksummedBytes: remove Cloneable
* Remove the `implements Cloneable` marker
* Remove the `@Override` of `clone()`
* Remove tests of `clone()` for the implementing classes
2022-06-12 18:35:24 +02:00
Sean Gilligan
6d70c60bca PeerTest: static import of FakeTxBuilder methods 2022-05-31 14:01:42 +02:00
Sean Gilligan
8800840e7e integration-test: move tests derived from TestWithNetworkConnections to integration-test submodule 2022-05-31 13:56:38 +02:00
Sean Gilligan
aafdbccbc5 FakeTxBuilder: move from src/test to src/main
This will allow it to be used in both core tests and integration-test.
2022-05-24 22:52:16 +02:00
Sean Gilligan
6bd2785b64 integration-test: add support for "Vintage" tests 2022-05-24 18:22:28 +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
Andreas Schildbach
bf71730c3d Deterministic wallets.txt: fix typos heirarchy → hierarchy 2022-05-03 21:30:34 +02:00
Sean Gilligan
c5fd900346 WalletAccountPathTest: use Wallet.fromSeed() to simplify private createWallet() 2022-05-03 20:37:56 +02:00
Sean Gilligan
8f2757c0eb WalletTool: explicitly specify BIP32 in createWallet() 2022-05-03 20:04:16 +02:00
Andreas Schildbach
6a47695fc8 README.md: fix spelling of GitHub 2022-05-03 19:15:43 +02:00
Sean Gilligan
906f82a095 WalletAppKit: replace null with BIP32 in constructor
This makes the code for this constructor more explicit/readable
and prepares the way for making the parameter in the "full" constructor
non-nullable (in a minor breaking change) in the future.
2022-05-03 19:04:24 +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
760d9847fb Wallet: add createDeterministic() overloads with KeyChainGroupStructure parameter 2022-05-02 12:34:36 +02:00