Commit Graph

65 Commits

Author SHA1 Message Date
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 259c5902f1
Merge pull request #116 from jeandudey/2018-08-08-module-docs
Fix modules documentation title.
2018-08-11 17:12:50 +00:00
Carl Dong d4f28b6785 Add conversion between u32 and ChildNumber, fix docs 2018-08-10 13:49:45 -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
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
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
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 ee1dfcf4a2 base58: remove Base58 traits, replace with encode/decode functions 2018-03-12 21:27:07 +00:00
Andrew Poelstra 066c49305f update secp256k1 to latest version with minimized dependencies 2018-02-20 16:19:29 +00:00
Andrew Poelstra af10b153be segwit: add transaction/block serialization support for BIP141/BIP144; bump to 0.8
Do not yet support new sighash type
2016-08-24 16:24:55 +00:00
Andrew Poelstra 9d2826d5d1 bip32: error API cleanups 2016-06-24 19:45:42 +00:00
Andrew Poelstra f7d4ae8265 bip32: add accessor for the tweak used in public key derivation 2016-06-24 19:25:47 +00:00
Andrew Poelstra 14af175a11 Resurrect BIP32 support 2016-06-24 19:15:57 +00:00