Commit Graph

1043 Commits

Author SHA1 Message Date
Steven Roose 5fd92d1c09 psbt: Serialize maps with byte values using hex 2020-12-30 16:32:52 +01:00
Steven Roose a05f8feec6 serde_util: Rename the btreemap module to btreemap_as_seq
So that we can later distinguish other modules over maps.
2020-12-30 16:32:52 +01:00
Steven Roose a9c13272a0 psbt: Fix serde for maps with non-string keys and binary values 2020-12-30 16:32:52 +01:00
Steven Roose e5f3bca2b4 Add serde_utils module to fix JSON serialization 2020-12-30 16:32:52 +01:00
Steven Roose cdedb0a9d5 psbt::raw: Use hex::format_hex to format the raw key bytes 2020-12-30 16:32:52 +01:00
Steven Roose 94b7371424 Replace serde_struct_impl with derive-based impls 2020-12-30 16:32:52 +01:00
Steven Roose d527a2c2cf Remove the impl_array_newtype_show macro
Instead, implement Debug in impl_bytes_newtype.
2020-12-30 16:32:52 +01:00
Andrew Poelstra 0ab8823984
Merge pull request #536 from 0xB10C/2020-12-add-blockheader-tests
Add BlockHeader tests
2020-12-28 16:56:56 +00:00
Andrew Poelstra 1cc466fec6
Merge pull request #498 from LNP-BP/pending/derivation
Derivation path improvements, closes #473
2020-12-28 00:53:25 +00:00
0xB10C b7caf0110f test: BlockHeader::difficulty()
https://github.com/rust-bitcoin/rust-bitcoin/issues/462
2020-12-26 11:33:54 +01:00
0xB10C 4eca40dcc1 test: BlockHeader::validate_pow()
https://github.com/rust-bitcoin/rust-bitcoin/issues/462#issuecomment-683916241
2020-12-26 11:33:39 +01:00
0xB10C d5bf5c88a3 test: BlockHeader::work()
https://github.com/rust-bitcoin/rust-bitcoin/issues/462#issuecomment-683916241
2020-12-26 11:33:22 +01:00
Andrew Poelstra 3c1117305f
Merge pull request #471 from LNP-BP/feat/psbt-keytypes
PSBT proprietary key system matching BIP 174
2020-12-21 15:41:06 +00:00
Andrew Poelstra 65c972b0b0
Merge pull request #496 from stevenroose/exhaustive-enums
Make Inventory and NetworkMessage enums exhaustive
2020-12-21 15:17:22 +00:00
Steven Roose 767b14f696
Make Inventory and NetworkMessage enums exhaustive
Both by added an `Unknown` variant.
2020-12-21 12:04:26 +00:00
Steven Roose 944371d6a2
Clean up CommandString
- Add length invariant.
- Siimplify constructors.
2020-12-21 11:56:51 +00:00
Dr Maxim Orlovsky 7400bccb60
PSBT: proprietary keys type system according to BIP 174 2020-12-21 12:22:35 +01:00
Dr Maxim Orlovsky c3024c3ebb
PSBT: basic support for proprietary keys 2020-12-21 12:17:07 +01:00
Dr Maxim Orlovsky 44ffddab8c
Impl IntoDerivationPath for string types 2020-12-20 23:39:01 +01:00
Dr Maxim Orlovsky f9290438cd
DerivationPath improvements
Adding IntoDerivationPath trait
DerivationPath is_master function
DerivationPath constructor for empty path + Default impl
2020-12-20 23:39:01 +01:00
Andrew Poelstra a6264cfca6
Merge pull request #499 from LNP-BP/pending/psbt-global
New PSBT global keys
2020-12-20 21:27:57 +00:00
Dr Maxim Orlovsky 7f5c2795d6
PSBT global xpub merging algorithm reworked 2020-12-20 11:41:24 +01:00
Andrew Poelstra 99201676ae
Merge pull request #514 from stevenroose/tosocketaddrs
network: Implement net::ToSocketAddrs for address messages
2020-12-16 17:11:35 +00:00
Dr Maxim Orlovsky b84faa7f5e
PSBT: Improved global keys version and xpub handling 2020-12-16 16:46:28 +01:00
Dr Maxim Orlovsky 21c11e3315
BSPT: Improving global xpub merging algorithm 2020-12-16 16:39:46 +01:00
Andrew Poelstra c62cd98615
Merge pull request #516 from stevenroose/max-inv-size
Add message::MAX_INV_SIZE constant
2020-12-15 23:45:42 +00:00
Alekos Filini 373f355b5a Flush unrecognized network messages from the read buffer
Currently whenever an unrecognized network message is received, it is never
flushed from the read buffer, meaning that unless the stream is closed and
recreated it will keep returning the same error every time `read_next()` is
called.

This commit adds the length of the message to `UnrecognizedNetworkCommand`,
so that the `StreamReader` can flush those bytes before returning the error
to the caller.
2020-12-15 19:54:21 +01:00
Dr Maxim Orlovsky 8b1666295c
Nits in new PSBT global types reviews 2020-12-15 16:04:02 +01:00
Dr Maxim Orlovsky 0235abfac2
Improving PSBT merge with dedicated 1.29 rustc borrow scope 2020-12-15 15:50:18 +01:00
Dr Maxim Orlovsky df8635c5fe
PSBT: Key pair serialization for new global keys
Conflicts:
	src/util/psbt/map/global.rs
2020-12-15 15:50:18 +01:00
Dr Maxim Orlovsky 2f838218a8
PSBT: merging new global keys
Plus necessary changes to BIP 32 implementations and error type
2020-12-15 15:47:37 +01:00
Dr Maxim Orlovsky af61d7e7bc
PSBT: adding global types (version, xpub) 2020-12-15 15:47:37 +01:00
Steven Roose 6df16b7ce2
Merge pull request #530 from LNP-BP/psbt/constants
PSBT types are now constants
2020-12-15 14:45:52 +00:00
Elichai Turkel ba001b73eb
Merge pull request #531 from stevenroose/pub-msg-prefix
Make signed message prefix a public constant
2020-12-09 14:39:34 +02:00
Steven Roose 874ab8eca6
Make signed message prefix a public constant 2020-12-08 17:31:28 +00:00
Dr Maxim Orlovsky 881f4d75dd
PSBT: Making hash preimage constant names match BIP 174 2020-12-07 16:35:28 +01:00
Dr Maxim Orlovsky 214e10baef
PSBT types are now constants 2020-12-07 15:37:16 +01:00
Steven Roose 02c3d8fca5
Merge pull request #401 from dpc/sighhash_u32
Improve `sighash_u32` handling
2020-12-07 11:37:26 +00:00
Steven Roose b4c8e12f36
Merge pull request #259 from stevenroose/taproot
Tagged hashes for taproot
2020-12-07 11:34:37 +00:00
Steven Roose f0ee94f2b2
Merge pull request #513 from LNP-BP/psbt/standard-names
PSBT: making input and output field names match spec type names
2020-12-07 11:34:06 +00:00
Dr Maxim Orlovsky 27037e2c72
PSBT: Making RIPEMD160 hash match standard name 2020-12-05 15:46:30 +01:00
Dr Maxim Orlovsky 9b106ee161
PSBT: making BIP32 field name match spec type names 2020-12-05 15:45:20 +01:00
Steven Roose a56712befc
Create tagged taproot hashes 2020-11-30 20:13:11 +00:00
Dawid Ciężarkiewicz cf2c12a816 Add ability to pass `SigHashType` directly to `signature_hash` 2020-11-24 22:53:56 -08:00
Dawid Ciężarkiewicz 8773cb4a42 Document `sighash_u32` of `Transaction::signature_hash` 2020-11-24 22:50:06 -08:00
Steven Roose ee192eb61d
Merge pull request #470 from LNP-BP/feat/bip32-bin
BIP 32 binary encoding functions are extracted from base58
2020-11-23 21:33:54 +00:00
Elichai Turkel 7c05673b86
Merge pull request #487 from RCasatta/map_with_u128
use u128 in map_to_range
2020-11-15 15:42:00 +02:00
Elichai Turkel ac7bf8099b
Merge pull request #517 from stevenroose/inv-ord
Implement PartialOrd and Ord for Inventory
2020-11-11 11:51:14 +02:00
Steven Roose f1b0f263ce
Implement PartialOrd and Ord for Inventory 2020-11-10 19:54:07 +00:00
Dr Maxim Orlovsky fa4ecb4a6a
Making ExtendedPubKey decode aligned with ExtendedPrivKey variant 2020-11-10 09:30:33 +01:00