3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-02-19 13:45:48 +00:00

2271 Commits

Author SHA1 Message Date
Andreas Schildbach
64aa2ecac6 Bech32Test: Sync test vectors with current version of BIP173. 2018-03-02 16:08:36 +01:00
Andreas Schildbach
15a15ac024 AddressFormatException: Add InvalidCharacter exception that is thrown when a character is used that is invalid in the encoding. 2018-03-02 15:53:22 +01:00
Andreas Schildbach
0297ba4d58 AddressFormatException: Add InvalidChecksum exception that is thrown when a Base58 or Bech32 checksum is invalid. 2018-03-02 15:50:44 +01:00
Andreas Schildbach
0a7f346919 Move WrongNetworkException to AddressFormatException.WrongNetwork. 2018-03-02 13:00:56 +01:00
Andreas Schildbach
6a7a136d7c LegacyAddress: Make sure the various by-hash constructors throw AddressFormatException if the hash length isn't 20 bytes. 2018-03-02 12:44:52 +01:00
Andreas Schildbach
82edec0978 DumpedPrivateKey: Don't dump private key into exception message, even if it's likely invalid anyway. 2018-03-01 18:42:20 +01:00
Andreas Schildbach
2e8a7474b2 BitcoinURI: Make aware of native segwit addresses. 2018-02-28 18:25:22 +01:00
Andreas Schildbach
d2caf699e1 LegacyAddress: Deprecate isP2SHAddress(). 2018-02-28 17:07:39 +01:00
Andreas Schildbach
c0d8039c82 LegacyAddress: Deprecate getHash160(). 2018-02-28 17:01:56 +01:00
Andreas Schildbach
e11119b64f Rename VersionedChecksummedBytes→PrefixedChecksummedBytes, Address→LegacyAddress and AbstractAddress→Address.
This also renames corresponding test classes and mentions in comments.
2018-02-28 16:57:16 +01:00
Andreas Schildbach
6593d74619 Implement native segwit addresses in new SegwitAddress class.
This commit establishes a base class for legacy and segwit addresses.

Uses Bech32 code from https://github.com/sipa/bech32/pull/40.
2018-02-28 16:37:29 +01:00
Andreas Schildbach
57f25d4c22 VersionedChecksummedBytes: Store network params rather than version, in preparation for native segwit addresses. 2018-02-28 16:27:43 +01:00
Andreas Schildbach
f25840309b Rename the org.bitcoinj.core.CheckpointManagerTest test package to lowercase. 2018-02-28 10:02:31 +01:00
Andreas Schildbach
a8c9a33d6a PaymentSessionTest: Fix missing context. 2018-02-28 01:35:24 +01:00
Andreas Schildbach
5ed7847a80 PaymentSessionTest: Ignore test that has a hardcoded expiration date. 2018-02-28 01:34:47 +01:00
Andreas Schildbach
2aec06a281 Consequently use constants for network params in test cases. 2018-02-28 00:51:43 +01:00
Andreas Schildbach
1d15d95d97 Some Javadoc changes related to addresses. 2018-02-27 21:32:32 +01:00
Andreas Schildbach
44474be186 Address: Migrate use of the other pubKeyHash constructor to fromPubKeyHash(). Deprecate the constructor. 2018-02-27 12:09:01 +01:00
Andreas Schildbach
cc2e8ba935 Address: Make main constructor private.
There is no reason to call it directly.
2018-02-27 11:34:54 +01:00
Andreas Schildbach
ebd402eb4b Rename static NetworkParameters constants in test cases. 2018-02-27 11:34:54 +01:00
Andreas Schildbach
31a06d7095 ScriptPattern: Add Javadocs to methods. 2018-02-26 13:43:16 +01:00
Andreas Schildbach
4b129475b3 Script: Deprecate the script data extraction methods for CLTV payment channels.
Create and make sure to only use equivalents in ScriptPattern.
2018-02-26 13:25:46 +01:00
Andreas Schildbach
c6bbd947a0 Script: Move getPubKey() to ScriptPattern.extractKeyFromPayToPubKey(). 2018-02-26 13:01:34 +01:00
Andreas Schildbach
234384c87e Script.getPubKey(): Remove ability to extract the pubKey from inputs spending from P2PKH outputs.
This was only used in unit tests to determine the from address. One of the
tests now tests this manually so that we don't loose test coverage.
2018-02-26 11:14:13 +01:00
Andreas Schildbach
ea2dc695d7 Remove the concept of "acceptable Base58 address headers" (version headers) for a given network.
The concept was always weakly defined, as version headers have been used for different types of
data too (which wasn't included in the list). What's acceptable is always dependent on the
usecase, not only the network.

Also, with the coming Bech32 addresses there are no int version headers any more. Rather, it
uses an HRP (human readable part) which is a string.

This is an API breaking change, but I doubt many users have used this in the form of a list.
2018-02-26 02:51:16 +01:00
Andreas Schildbach
55f2a60fb6 Remove the concept of 'from address'.
Segwit is another nail on the coffin, because for each pubkey there is now also a segwit address.
A number of wallets will not recognize returned payments if sent to the wrong address type.
2018-02-26 02:25:34 +01:00
Andreas Schildbach
dedeb01dac Move ECKey.toAddress() to Address.fromKey().
This is a preparation for supporting native segwit addresses. Keys can't know what
type of address is wanted. In future, there will also be a SegwitAddress.fromKey().
2018-02-26 02:13:18 +01:00
Andreas Schildbach
0a21b586e8 Script: Extract the extraction of the P2PKH and P2SH hashes to ScriptPattern. 2018-02-26 01:57:41 +01:00
Andreas Schildbach
e44591a9b5 Script: Deprecate the old matcher methods, move their Javadocs over to ScriptPattern and use only the equivalents in ScriptPattern. 2018-02-25 22:51:15 +01:00
Andreas Schildbach
8d98c3e1e2 Script: Remove deprecated matcher method isSentToP2SH(). 2018-02-25 22:51:08 +01:00
Andreas Schildbach
fc4a29e3cb ScriptPattern: For all matcher methods, take Script as an argument rather than List<ScriptChunk>. 2018-02-25 22:50:28 +01:00
Andreas Schildbach
caf9e52940 ScriptPattern: Rename some matcher methods to the typical name of the matched scripts. 2018-02-25 22:12:39 +01:00
Andreas Schildbach
71a5b1b89f Remove some unused imports. 2018-02-23 20:09:41 +01:00
Andreas Schildbach
e5ec3a6a95 Transaction: Lower REFERENCE_DEFAULT_MIN_TX_FEE to 1000 and MIN_NONDUST_OUTPUT to 546.
These limits are still a thing these days both for relaying and mining transactions.
2018-02-22 20:27:44 +01:00
Andreas Schildbach
04f9de20d4 Use java.util.Arrays for cloning byte arrays. 2018-02-22 20:27:44 +01:00
Andreas Schildbach
0a54554413 ScriptChunkTest: Use Guava for concatenating byte arrays. 2018-02-22 20:10:05 +01:00
Andreas Schildbach
b455ebc635 Use Utils.uint*() and Utils.readUint*() methods for all remaining instances where we still did the bit stuffing manually. 2018-02-22 15:32:55 +01:00
Andreas Schildbach
aa593f46cd Utils: Reorder. 2018-02-22 12:32:52 +01:00
Andreas Schildbach
13828ce311 Utils: Add some missing documentation. 2018-02-22 12:29:38 +01:00
Andreas Schildbach
76c4f03d63 Utils: Rename uint64ToByteArrayLE() helper to int64ToByteArrayLE(), as the implementation is actually signed. 2018-02-22 12:21:59 +01:00
Andreas Schildbach
90636275af Utils: Remove unused and untested isLessThanUnsigned() and isLessThanOrEqualToUnsigned() helpers. 2018-02-22 11:53:49 +01:00
Andreas Schildbach
4daac38758 Utils: Inline getResourceAsString() into DeterministicKeyChainTest, as it's only being used there. 2018-02-22 11:43:26 +01:00
Andreas Schildbach
84048b565b Utils: Move parseAsHexOrBase58() to WalletTool, as it's only being used there. 2018-02-22 11:34:25 +01:00
Andreas Schildbach
e855030204 Utils: Move formatMessageForSigning() to ECKey, as it's only being used there. 2018-02-22 11:28:16 +01:00
Andreas Schildbach
96bdad5a67 Utils: Move copyOf() to UnsafeByteArrayOutputStream, as it's only being used there. 2018-02-22 11:08:58 +01:00
Andreas Schildbach
0fd8ab3fa2 Utils: Remove unused and untested appendByte() helper. 2018-02-22 10:54:45 +01:00
Andreas Schildbach
8295afc03b Utils: Remove reverseDwordBytes(), it wasn't used. 2018-02-22 10:47:07 +01:00
Andreas Schildbach
4300b2ee40 Replace use of Charset.forName() with Guava Charsets constants. 2018-02-22 10:37:10 +01:00
Andreas Schildbach
b50eddb0a2 Utils: Remove toString() and toBytes() helpers, use new String() and getBytes() with Guava charsets instead. 2018-02-22 10:21:14 +01:00
Andreas Schildbach
b6ecc380b8 Utils: Remove closeUnchecked() helpers, use Guava instead. 2018-02-22 10:09:30 +01:00