Carl Dong
c830fb4629
Remove code deprecated by bitcoin_hashes from util::hash
2019-01-24 16:27:52 -05:00
Carl Dong
99f63a8ca4
Convert codebase from util::hash to bitcoin_hashes
...
Also replace unsafe transmute with call to read_u64_into
2019-01-24 16:27:52 -05:00
Carl Dong
45aa709467
Implement En/Decodable for sha256d::Hash
2019-01-24 11:31:07 -05:00
Carl Dong
b88f00c698
Add bitcoin_hashes dependency, rename some features
...
Because features and dependencies share the same namespace, and we want
to pass down the optional dependence on serde to bitcoin_hashes, we need
to rename the feature to something other than serde. Right now only
features can be passed down to dependencies.
Note that we could have also renamed the dependency to something like
serde-dep and kept the same feature name, however, dependency renaming
has only been available since cargo 0.27.0
Features that represent optional dependencies have been prefixed with
'use-'. The travis file has also been modified to conform to this
change.
2019-01-24 11:31:07 -05:00
Carl Dong
b6ec6a0d62
Merge pull request #212 from TheBlueMatt/2019-01-travis-nightly-bench
...
Run cargo bench on rustc nightly in travis
2019-01-23 19:25:44 -05:00
Dimitris Apostolou
132ca5ea95
Fix typos
2019-01-23 14:17:29 -05:00
Tamas Blummer
96be35b1d3
it is annoying to have a difference between debug and print for hash
2019-01-23 14:14:29 -05:00
Matt Corallo
0d7e13b034
Run cargo bench on rustc nightly in travis, remote useless move
2019-01-15 14:06:24 -05:00
Matt Corallo
2ed4b1f246
Merge pull request #208 from sgeisler/hex_bytes
...
Use more performant hex_bytes function
2019-01-15 14:06:00 -05:00
Carl Dong
ff5c4a1806
Bump secp to 0.12
2019-01-15 12:58:54 -05:00
Carl Dong
b2e044f9db
Internalize unnecessarily exported macros
2019-01-15 11:53:31 -05:00
Antoine Riard
96c66292c8
Fix comment on transaction version
2019-01-10 18:29:50 -08:00
Sebastian Geisler
4c29fc0e8d
Add feature gated hex decode benchmark
2019-01-07 17:49:55 -08:00
Sebastian Geisler
7c7ec02ed2
Remove unused Pair iterator and util::iter module
2019-01-03 17:28:36 -08:00
Sebastian Geisler
c6a41651ab
Replace slow hex decoding function with optimized version
...
Fixes #207 .
2019-01-03 17:28:32 -08:00
Steven Roose
a10d5e15b3
Extract the Script assembly creator from fmt::Debug
2018-12-19 21:17:00 +01:00
Andrew Poelstra
5a5158e120
Merge pull request #198 from sgeisler/safe-opcodes
...
Safe opcodes 1.14.0
2018-12-14 16:32:29 +00:00
Sebastian Geisler
a6d204cbda
Fix indentation in opcodes.rs
2018-12-13 15:35:29 -08:00
Andrew Poelstra
bb7ca63776
Merge pull request #196 from sgeisler/separate-fuzzing
...
Move fuzzing code out of utils
2018-12-09 16:33:21 +00:00
Andrew Poelstra
617406228a
add some opcode tests
2018-12-09 16:30:23 +00:00
Sebastian Geisler
9fee72cf20
make opcode PR work with 1.14.0
2018-12-04 15:56:18 -08:00
Sebastian Geisler
79a88e1612
Move fuzzing code out of utils
2018-12-03 16:31:13 -08:00
Sebastian Geisler
e88612d617
add test case and cleanup
2018-12-03 14:51:55 -08:00
Sebastian Geisler
4a27c1369a
avoid heap use when encoding base58
2018-12-03 14:51:53 -08:00
Kaz Wesley
6b67c8cdff
squashme: work around lack of associated constants
2018-11-11 14:58:33 -08:00
Kaz Wesley
45234eb09a
safe implementation of All -> Ordinary
2018-11-11 14:19:25 -08:00
Kaz Wesley
0bfef68851
newtype implementation of opcodes::All
...
Removes unsafety when converting u8 -> All
2018-11-11 14:11:06 -08:00
Nadav Ivgi
18fcab6715
Detect compressed p2pk in script.is_p2pk()
2018-11-08 02:37:27 +02:00
Andrew Poelstra
b8a72448df
Merge pull request #153 from rust-bitcoin/2018-08-segwit-ambiguity
...
transaction: make 0-input de/serialization always use Segwit
2018-11-03 15:29:51 +00:00
Andrew Poelstra
c2146e1bbc
Merge pull request #181 from stevenroose/export-network
...
Export network::constants::Network
2018-10-23 16:18:30 +00:00
Andrew Poelstra
7813c0ae3d
Merge pull request #178 from stevenroose/wif
...
Add explicit WIF methods for Privkey
2018-10-22 15:28:09 +00:00
Steven Roose
5f912bdeae
Implement Debug for PrivKey
...
It returns a fixed string to prevent accidental data leakage.
2018-10-22 00:06:46 +01:00
Steven Roose
f7b95c7533
Add explicit WIF methods for Privkey
2018-10-22 00:05:59 +01:00
Steven Roose
6f4bfe68f3
Export network::constants::Network
2018-10-21 23:28:27 +01:00
Andrew Poelstra
0764673c38
Merge pull request #177 from stevenroose/outpoint-fromstr
...
Implement FromStr for OutPoint
2018-10-18 23:12:47 +00:00
Steven Roose
fefd5d4fe2
Implement FromStr for OutPoint
2018-10-18 12:37:02 +01:00
Andrew Poelstra
11a2783235
add comment expanding on the segwit ambiguity
2018-10-10 02:45:09 +00:00
Andrew Poelstra
a181a523c6
remove special case for 0-input 0-output transaction deserialization
...
This creates two ways to encode an empty transaction; we should use only the
Segwit-enabled one because that's what we do for 0-input non-0-output transactions.
2018-10-10 02:03:08 +00:00
Jeff Barg
1c2564fc08
Added example for creating an address from a public key
...
Added an example to the address rustdoc (addresses https://github.com/rust-bitcoin/rust-bitcoin/issues/160 )
2018-09-29 17:43:28 -04:00
evgeniy.scherbina
bc41772f89
added p2wkh, p2sh-p2wkh tests
2018-09-27 18:54:20 +03:00
Andrew Poelstra
98e39b4383
transaction: make 0-input de/serialization always use Segwit
2018-09-27 13:50:35 +00:00
Carl Dong
c42252c1da
Use default impl for Encoder for Sha256dEncoder
2018-09-25 21:20:24 +08:00
Carl Dong
0f42ca69b0
Move relevant names into consensus::encode
...
- Move network::encodable::* to consensus::encode::*
- Rename Consensus{En,De}codable to {En,De}codable (now under
consensus::encode)
- Move network::serialize::Error to consensus::encode::Error
- Remove Raw{En,De}coder, implement {En,De}coder for T: {Write,Read}
instead
- Move network::serialize::Simple{En,De}coder to
consensus::encode::{En,De}coder
- Rename util::Error::Serialize to util::Error::Encode
- Modify comments to refer to new names
- Modify files to refer to new names
- Expose {En,De}cod{able,er}, {de,}serialize, Params
- Do not return Result for serialize{,_hex} as serializing to a Vec
should never fail
2018-09-25 21:19:35 +08:00
Carl Dong
8e0e4eb55a
Move serialize::BitcoinHash to util: #️⃣ :BitcoinHash
...
- Use Sha256dEncoder for calculating merkle root
- Remove BitcoinHash implementation for Vec<u8>
2018-09-25 21:19:10 +08:00
Carl Dong
97937b1b5f
Move network::consensus_params to consensus::params
2018-09-25 21:13:34 +08:00
Carl Dong
7e9d393d03
Remove low-level networking support
...
- Modify VersionMessage constructor to take in parameters directly that
would have otherwise been extracted from a Socket (now removed)
2018-09-25 21:13:34 +08:00
Carl Dong
7f11766c65
Remove nu_select macro
2018-09-25 21:13:34 +08:00
Thomas Eizinger
50e3a4abf2
Add FromStr for Sha256dHash
...
The FromStr implementation just delegates to the `from_hex` method for
the actual parsing.
2018-09-20 12:18:45 +10:00
Steven Roose
8edfbec1cb
Implement serde serialiation for Address
2018-09-11 18:37:36 +01:00
Andrew Poelstra
849674651f
Merge pull request #157 from rust-bitcoin/2018-08-pub-use
...
`pub use` a ton of stuff at the top level
2018-08-28 17:13:40 +00:00
Andrew Poelstra
97c1773ec9
`pub use` a ton of stuff at the top level
2018-08-28 15:57:46 +00:00
Andrew Poelstra
fe99a88acf
Merge pull request #152 from rust-bitcoin/2018-08-script-ord
...
impl PartialOrd, Ord for Script
2018-08-26 15:38:43 +00:00
Andrew Poelstra
b33aa6fa6c
add unit test for script ordering
2018-08-25 22:09:22 +00:00
Andrew Poelstra
ef642295c5
encodable: reject non-compact VarInts on Vec and Box<[T]> lengths
2018-08-24 20:31:46 +00:00
Andrew Poelstra
f0221fb79b
transaction: reject transactions with Segwit byte set but no witnesses
2018-08-24 19:57:58 +00:00
Andrew Poelstra
68413d306d
impl PartialOrd, Ord for Script
2018-08-24 02:20:37 +00:00
Andrew Poelstra
08db6fe29f
script: let Instructions iterator enforce minimal pushes; remove `IntoIter` impl to force users to choose
2018-08-22 19:55:31 +00:00
Andrew Poelstra
dbefaef25c
Merge pull request #142 from jeandudey/2018-08-decimal-fromstr
...
Implement `FromStr` for `UDecimal`/`Decimal`.
2018-08-22 19:00:02 +00:00
Jean Pierre Dudey
9cdc75a930
Forbid exponents larger than 18.
...
Signed-off-by: Jean Pierre Dudey <jeandudey@hotmail.com>
2018-08-22 14:00:30 -04:00
Jean Pierre Dudey
6902bf826c
Fix negative symbol bug in `FromStr` display implementation.
...
The negative symbol wasn't there when `int_part` was equal to zero.
Signed-off-by: Jean Pierre Dudey <jeandudey@hotmail.com>
2018-08-22 11:26:05 -04:00
Jean Pierre Dudey
a915bc194d
Fix multiplication logic in decimal parsing functions.
...
Signed-off-by: Jean Pierre Dudey <jeandudey@hotmail.com>
2018-08-22 07:22:47 -04:00
Jean Pierre Dudey
e48e559740
Fix `UDecimal::parse_udecimal` identation.
...
Signed-off-by: Jean Pierre Dudey <jeandudey@hotmail.com>
2018-08-21 21:31:02 -04:00
Jean Pierre Dudey
455bc66d3c
Fix parsing for numbers that are too big to fit in a `Decimal`/`UDecimal`.
...
Signed-off-by: Jean Pierre Dudey <jeandudey@hotmail.com>
2018-08-21 21:29:07 -04:00
Andrew Poelstra
a61ad5d382
Merge pull request #137 from dongcarl/2018-8-better-errors
...
Fix Error type for SimpleDecoder and SimpleEncoder
2018-08-22 00:55:54 +00:00
Jean Pierre Dudey
07838568f9
Implement `FromStr` for `Decimal`/`UDecimal`.
...
Signed-off-by: Jean Pierre Dudey <jeandudey@hotmail.com>
2018-08-21 16:13:58 -04:00
Andrew Poelstra
d16fdd63d3
Merge pull request #141 from jeandudey/2018-08-display
...
Implement `Display` instead of `ToString` for `Address` and `PrivKey`.
2018-08-21 16:41:58 +00:00
Carl Dong
bccdd06794
Replace catch-all match arms with specific ones
2018-08-21 01:58:40 -07:00
Carl Dong
0c172941af
Replace serialize::Error::Detail with variants
...
- Add serialize::Error::ParseFailed(&'static str) variant for
serialization errors without context
- Add appropriate variants to replace network::Error::Detail for
serialization error with context
- Remove error method from SimpleDecoders
2018-08-21 01:58:40 -07:00
Carl Dong
d12a861f85
Remove unnecessary network::Error::Detail variant
2018-08-21 01:58:40 -07:00
Carl Dong
95303a1d28
Use full path in macros to to eliminate uses
2018-08-21 01:58:40 -07:00
Carl Dong
e5b5cbfadb
Fix Error type for SimpleDecoder and SimpleEncoder
...
- Separate serialize::Error and network::Error from util::Error
- Remove unneeded propagate_err and consume_err
- Change fuzzing code to ignore Err type
2018-08-21 01:58:40 -07:00
Jean Pierre Dudey
df7f084e96
Implement `Display` instead of `ToString` for `Address` and `PrivKey`.
...
Signed-off-by: Jean Pierre Dudey <jeandudey@hotmail.com>
2018-08-20 19:46:56 -04:00
Andrew Poelstra
77e2fe3dda
Merge pull request #144 from jeandudey/2018-08-address-starts-with
...
trivial: Use `str::starts_with` method to check bech32 address prefixes.
2018-08-20 23:12:03 +00:00
Jean Pierre Dudey
b78d7a7428
Use `str::starts_with` method to check bech32 address prefixes.
...
Signed-off-by: Jean Pierre Dudey <jeandudey@hotmail.com>
2018-08-20 18:11:14 -04:00
Jean Pierre Dudey
4dfb98bd70
Use `as_`,`to_`,`into_` conventions for array types.
...
Signed-off-by: Jean Pierre Dudey <jeandudey@hotmail.com>
2018-08-20 17:20:43 -04:00
Andrew Poelstra
2d961412af
Merge pull request #139 from jeandudey/2018-08-18-outpoint
...
Rename `TxOutRef` to `OutPoint` and use it in `TxIn`.
2018-08-20 18:18:00 +00:00
Jean Pierre Dudey
32631e44ad
Rename `TxOutRef` to `OutPoint` and use it in `TxIn`.
...
Previously this structure was unused, it's now being used by the `TxIn`
structure to simplify the code a little bit and avoid confusions. Also
the rust-lightning source code has an `OutPoint` similar to this one
but with the `vout` index as an `u16` to avoid unsafe conversions.
I've added to new methods to `OutPoint`:
- `null`: Creates a new "null" `OutPoint`.
- `is_null`: Checks if the given `OutPoint` is null.
Signed-off-by: Jean Pierre Dudey <jeandudey@hotmail.com>
2018-08-20 13:46:10 -04:00
Jean Pierre Dudey
1b4aba1d80
Update serde to 1.0 and strason to 0.4
...
The `serde_struct_impl!` macro has been modified to be compatible
with the serde 1.0 crate, we use this macro and not the `serde_derive`
crate because the latter doesn't support Rust 1.14.0 which is shipped
on Debian stable and we should remain compatible with it.
Two new features were added:
- "serde": enables serialization/deserialization for common types, it pulls
the serde 1.0 dependency.
- "serde-decimal": enables serialization/deserialization for `UDecimal`/`Decimal`,
this pulls the strason 0.4 depdendency and the serde 1.0 dependency.
Signed-off-by: Jean Pierre Dudey <jeandudey@hotmail.com>
2018-08-20 13:42:34 -04:00
Andrew Poelstra
94f3d4b0f9
update to secp256k1 0.10.0
2018-08-20 15:28:43 +00:00
Andrew Poelstra
85ddb66be0
Merge pull request #138 from dongcarl/2018-8-usize-fix
...
Fix compilation warning when comparing usize and u64 on 32-bit arch
2018-08-20 14:11:26 +00:00
Aleksei
356d13e465
Add some useful standard trait implementations
2018-08-20 12:11:17 +03:00
Carl Dong
9da96e1d46
Fix compilation warning when comparing usize and u64 on 32-bit arch
2018-08-17 10:08:56 -07:00
Andrew Poelstra
6c82001ead
Merge pull request #128 from jeandudey/2018-08-12-bitcoinconsenus
...
Remove unused "bitcoinconsenus" feature.
2018-08-15 20:55:51 +00:00
Roman Zeyde
fdbccf055d
Remove variable shadowing in listener.rs
2018-08-15 09:43:35 +03:00
Carl Dong
70203831d6
Make deserialize error if input bytes not consumed
...
- Adjust tests in encodable.rs to account for this change
2018-08-14 16:50:33 -07:00
Carl Dong
60577f286d
Add derive_* methods to Extended*Key
...
- Add derive_pub to ExtendedPubKey
- Add derive_priv to ExtendedPrivKey
- Removed from_path from ExtendedPrivKey as it is superseded by
derive_priv
- Add checking of derive_pub and derive_priv to test_path
- Add checking of correct error when invoking ckd_pub on a hardened
ChildNumber
- Add test vector 3 from BIP32 specification
2018-08-12 17:16:33 -07:00
Andrew Poelstra
bc7125e955
Merge pull request #119 from jeandudey/2018-08-08-try-op
...
Remove `try!` macro usage and use the `?` operator instead.
2018-08-12 23:44:43 +00:00
Jean Pierre Dudey
f918311b8a
Remove unused "bitcoinconsenus" feature.
...
Also I've updated the feature name on the README.md, and fixed a typo in
src/blockdata/script.rs
Signed-off-by: Jean Pierre Dudey <jeandudey@hotmail.com>
2018-08-12 16:06:06 -04:00
Jean Pierre Dudey
6e99d2d33c
Hidde `From<T>` implementations for error types in Rustdoc.
...
Signed-off-by: Jean Pierre Dudey <jeandudey@hotmail.com>
2018-08-12 12:57:59 -04:00
Jean Pierre Dudey
b2594087db
Use the `?` (try) instead of the `try!` macro.
...
Signed-off-by: Jean Pierre Dudey <jeandudey@hotmail.com>
2018-08-12 12:47:31 -04:00
Andrew Poelstra
24c0f1a3fc
Merge pull request #118 from jeandudey/2018-08-08-bip32-tostring
...
Implement `Display` trait instead of implementing `ToString` directly.
2018-08-12 13:48:39 +00:00
Carl Dong
c485a74c09
Add helper methods is_normal, is_hardened
...
- Fix documentation links
2018-08-11 13:29:10 -07:00
Carl Dong
4a5bf52ed9
Improve consistency for bip32::ChildNumber
...
There seemed to be some confusion as to whether the internal
represenation of a ChildNumber is supposed to be the index (0..2^31-1
for _both_ Normal and Hardened) or the actual number (0..2^31-1 for
Normal and 2^31..2^32-1 for Hardened). This commits fixes this
confusion.
- Make clear that the internal representation is the index rather
than the actual number
- Make the internal representation non-public
- Provide methods for creating valid ChildNumbers
- Change relevant callers and tests to conform to this new ChildNumber
My rationale for using index rather than the actual number as internal
representation is that the difference between the two enum variants
already encode wether a ChildNumber is a normal one or a hardened one,
so the only bit of extra information left to be encoded is its index.
2018-08-11 12:46:46 -07:00
Andrew Poelstra
ebe5133d1a
Merge pull request #110 from D4nte/regtest
...
Regtest bech32 address support
2018-08-11 17:21:12 +00:00
Andrew Poelstra
259c5902f1
Merge pull request #116 from jeandudey/2018-08-08-module-docs
...
Fix modules documentation title.
2018-08-11 17:12:50 +00:00
Andrew Poelstra
ee9802d813
Merge pull request #120 from dpc/from_secret_key-doc-fix
...
Simple doc fix for `from_secret_key`
2018-08-11 17:05:29 +00:00
Andrew Poelstra
e17c280e4f
Merge pull request #121 from jeandudey/2018-08-10-network
...
Refactor and add more documentation for the `Network` type.
2018-08-11 16:52:52 +00:00
Carl Dong
d4f28b6785
Add conversion between u32 and ChildNumber, fix docs
2018-08-10 13:49:45 -07:00
Jean Pierre Dudey
7ecb6b9dea
Refactor and add more documentation for the `Network` type.
...
Signed-off-by: Jean Pierre Dudey <jeandudey@hotmail.com>
2018-08-10 14:56:19 -04:00
Dawid Ciężarkiewicz
1646a80f77
Simple doc fix for `from_secret_key`
2018-08-09 15:41:48 -07:00
Jean Pierre Dudey
0225b530cc
Implement `Display` trait instead of implementing `ToString` directly.
...
ExtendedPubKey and ExtendedPrivKey implemented `ToString` directly but
Rust documentation says to implement `Display` and get the `ToString`
implementation for free.
Signed-off-by: Jean Pierre Dudey <jeandudey@hotmail.com>
2018-08-08 19:11:16 -04:00
Jean Pierre Dudey
77c185d9ec
Fix modules documentation title.
...
Signed-off-by: Jean Pierre Dudey <jeandudey@hotmail.com>
2018-08-08 17:38:50 -04:00
Andrew Poelstra
45c699f005
Merge pull request #112 from TheBlueMatt/2018-07-p2wsh-name
...
Clarify to_v0_p2wsh docs a bit further
2018-07-28 18:28:00 +00:00
Matt Corallo
3686cd7201
Clarify to_v0_p2wsh docs a bit further
2018-07-26 15:13:44 -04:00
Savil Srivastava
933dcaeb82
[code hygiene] remove deprecated rustc-serialize
...
Addresses #96 .
Turns out it was being used for hex encoding/decoding, so replaced that with the `hex` crate.
i chose to import the `decode` method as:
```
use hex::decode as hex_decode
```
so that it is clear to the reader what is being decoded when it is called. "decode" is such a generic sounding function name that it would get confusing otherwise.
2018-07-26 09:49:15 -07:00
Franck Royer
f05f831569
Regtest has a longer hrp, need to adjust length safety check
2018-07-26 17:06:35 +10:00
Franck Royer
0f31608796
Add support for bech32 regtest address format
2018-07-26 10:51:37 +10:00
Franck Royer
ba2879cfac
Add test for regtest network
2018-07-26 10:51:15 +10:00
Carl Dong
db76a63669
Fix to_v0_p2wsh docs
2018-07-25 17:11:27 -07:00
Sebastian Geisler
00cca03edd
use bitcoin-bech32 v0.8.0 and adapt internal API usage
2018-07-25 21:09:46 +02:00
Tamas Blummer
caeadb42be
check if output is OP_RETURN
2018-06-23 14:49:55 +02:00
Igor Aleksanov
2ff5f8e51e
Added module with consensus parameters ( #93 )
2018-06-23 10:23:34 +02:00
Igor Aleksanov
14a920ab7d
Added method to convert target from Uint256 to compact form ( #86 )
...
Renamed method for getting compact from u256
Removed unnecessary asserts from convert function
2018-06-12 20:58:25 +02:00
Roman Zeyde
69ea2a760b
Fix 2 small typos in comments
2018-06-09 22:27:40 +03:00
Andrew Poelstra
62d080afc7
Merge pull request #83 from tamasblummer/is_coinbase
...
add is_coin_base
2018-06-04 18:46:03 +00:00
Andrew Poelstra
dd176b4177
Merge pull request #84 from popzxc/add-regtest
...
Added regtest network
2018-06-04 18:42:05 +00:00
Andrew Poelstra
fb0c782df6
Merge pull request #89 from tamasblummer/wittness_block
...
add witness inv types
2018-06-04 18:34:28 +00:00
Andrew Poelstra
33261c7a12
Merge pull request #91 from TheBlueMatt/master
...
Check in fuzz inputs for all current targets
2018-06-04 18:32:19 +00:00
Matt Corallo
e2403a37fa
Don't try to do a base58 checksum if an address is excessively long
2018-06-04 10:23:55 -04:00
Matt Corallo
dab2f0b6b6
Switch fuzztarget SHA256 to simply XOR'ing all input bytes
2018-06-04 10:23:26 -04:00
Tamás Blummer
47b2364554
Merge branch 'master' into wittness_block
2018-06-04 04:24:51 +02:00
Matt Corallo
b78ab0f60b
Expose merkleroot(Vec<Sha256dHash>) publicly
...
In a project of mine I needed to check the merkle root before
moving some Vec<Transaction>s around, so need to be able to
calculate the merkle root on a Vec<Sha256dHash> directly.
2018-06-01 18:50:31 -04:00
Tamas Blummer
3921899c65
add is_coin_base
...
add data access as copy
2018-06-01 21:39:51 +02:00
Igor Aleksanov
97908ea058
Merge branch 'master' into add-regtest
2018-05-29 12:21:56 +03:00
Igor Aleksanov
34e228c699
Added regtest
...
Completed regtest integration to the code
Added tests for regtest
Get rid of panics
2018-05-29 12:21:41 +03:00
Igor Aleksanov
881972b2a5
Fix multiplication for uint256 ( #88 )
2018-05-28 20:41:07 +02:00
Tamas Blummer
9f2d737045
add witness inv types
2018-05-28 15:24:35 +02:00
Tamás Blummer
cf4024beb4
Merge branch 'master' into hotfix-network-from-str-err
2018-05-20 11:32:19 +02:00
Andrew Poelstra
ab96df162a
Merge branch 'master' into data-method-in-impl-array-newtype
2018-05-19 17:29:53 +00:00
Aleksey Sidorov
5771841144
Replace serde error with the io error.
2018-05-18 12:08:11 +03:00
Igor Aleksanov
13f1fe1f08
Merge branch 'master' into data-method-in-impl-array-newtype
2018-05-17 19:07:08 +03:00
Andrew Poelstra
cc23f09b10
Merge branch 'master' into improve-network-constant
2018-05-17 15:00:35 +00:00
Igor Aleksanov
582afb1611
Added impl display for uint
2018-05-16 13:13:48 +03:00
Igor Aleksanov
539a74de12
Added test for Sha256dHash::data()
2018-05-16 12:44:30 +03:00
Igor Aleksanov
5df8893ea1
Macro impl_array_newtype now generates method for representing data as array
2018-05-16 12:34:36 +03:00
Aleksei Sidorov
3224cf2b18
Implement `FromStr` for Network constant
2018-05-16 12:22:07 +03:00
Roman Zeyde
44d0ad90e9
block: fix a small typo in comment
2018-04-11 12:23:15 +03:00
Matt Corallo
8aa6253a3b
Correct consensus verify args, fix tests to catch error in travis
2018-04-02 15:38:43 -04:00
Matt Corallo
bfe889904a
Fix whitespace (s/\t/ /g)
2018-04-02 14:58:25 -04:00
Matt Corallo
0e1d927b47
Only provide the required TxIn to bip143 sighash_all.
...
This resolves an very unergonomic API by allowing iteration over a
Transaction being signed's inputs without needing to take a
conflicting reference to the transaction.
The API is still relateively unsafe in that its very easy to
generate bogus sighashes with it, but this is much better than it
was, and its not clear how to fix it further.
2018-04-02 12:42:59 -04:00
Matt Corallo
3793b2859a
Add a Transaction.get_weight() method, check it in fuzzing
2018-04-02 12:23:05 -04:00
Matt Corallo
f859dc8b26
Expose VarInt's encoded length
2018-04-02 12:23:05 -04:00
Matt Corallo
a33f00621b
Move witness inside of TxIn.
...
This is a rather large breaking API change, but is significantly
more sensible. In the "do not allow internal representation to
represent an invalid state" category, this ensures that witness
cannot have an length other than the number of inputs. Further,
it reduces vec propagation, which may help performance in some
cases by reducing allocs. Fianlly, this just makes more sense (tm).
Witness are a per-input field like the scriptSig, placing them
outside of the TxIn is just where they are serialized, not where
they logically belong.
2018-03-26 10:25:33 -04:00
Tamas Blummer
ae708447a2
create Address message with SocketAddr, get SocketAddr from Address message.
2018-03-23 15:12:06 +01:00
Matt Corallo
855b377d51
Fix crash in Address::from_str if input isn't long enough
2018-03-21 18:44:10 -04:00
Matt Corallo
6826d8f35c
Stub out Sha2 calls when fuzzing to mask all but the first byte
2018-03-21 18:44:10 -04:00
Andrew Poelstra
64987e349c
minor nits to get compilation to work on rustc 1.14 (currently shipping Debian version)
2018-03-21 18:49:46 +00:00
Tamas Blummer
1a87244b2b
Implement Segwit addresses
2018-03-20 18:26:51 +01:00
Andrew Poelstra
65d8df08b8
address: implement Bech32 support
2018-03-13 14:48:01 +00:00
Andrew Poelstra
9884bec577
add docs indicating change in Sha256dHash debug output
2018-03-12 21:50:35 +00:00