Carl Dong
24361dd2f1
Merge pull request #298 from tamasblummer/upgrade_secp_bitcoinconsensus
...
upgrade to secp256k1 0.15 and bitcoinconsensus 0.17
2019-08-23 14:18:05 -04:00
Tamás Blummer
f01568c85a
use lambda instead of a hash map to find spent outputs ( #319 )
...
* use lambda instead of a hash map to find spent outputs
* check for double use of an input
2019-08-23 18:49:31 +02:00
Tamas Blummer
9f3e355c5c
upgrade to secp256k1 0.15 and bitcoinconsensus 0.17
2019-08-21 19:04:40 +02:00
Elichai Turkel
52ff97cddc
Deny unused imports and remove unneeded
2019-08-19 13:29:43 -04:00
Elichai Turkel
747e9ce75c
Pinned serde version and re-export bech32
2019-08-16 16:08:14 -04:00
Steven Roose
c01172780b
Re-export bitcoin_hashes and secp256k1 dependency
2019-08-16 15:52:58 +01:00
Steven Roose
48f4c1989f
Rename bitcoin_hashes dependency to hashes
2019-08-16 15:52:27 +01:00
Steven Roose
09a65023a2
Add tests for p2shwpkh and p2shwsh
2019-08-15 22:29:09 +01:00
Steven Roose
170abaa82f
Use the new bech32 functions
2019-08-15 22:29:06 +01:00
Steven Roose
3a93f8522c
Format address module
2019-08-15 22:28:46 +01:00
Steven Roose
8de13a3915
Redo the BIP-173 test vectors
...
Before, non-version-zero segwit addresses were not included.
2019-08-15 22:28:27 +01:00
Steven Roose
e469fec839
address: Drop error::Error::description impl
2019-08-15 22:28:25 +01:00
Steven Roose
bfdcfee28e
Add Address::from_script constructor
2019-08-15 22:28:20 +01:00
Steven Roose
33e8ba3c7e
Extract roundtrip method from Address tests
2019-08-13 08:47:17 +01:00
Steven Roose
8804a41f1f
Add AddressType enum
2019-08-13 08:47:15 +01:00
Steven Roose
7e0d997150
Remove unused encode::Error variant
2019-08-13 08:47:13 +01:00
Steven Roose
385a657974
Refactor Address
...
- use AddressError instead of encode::Error
- replace using bech32-bitcoin with Payload::WitnessProgram variant
2019-08-13 08:47:10 +01:00
Andrew Poelstra
cc0f1143dc
Merge pull request #309 from elichai/2019-08-amount-precision
...
Check that the amount precision isn't more than the size of the amount
2019-08-12 17:20:18 +00:00
Riccardo Casatta
7d6687451a
use BTreeMap instead of HashMap to always serialize the same ( #310 )
...
* use BTreeMap instead of HashMap to always serialize the same
* fix rust 1.22 error
* psbt fuzz roundtrip
* psbt fuzz roundtrip on our ser
2019-08-09 17:03:12 +02:00
Tamás Blummer
4ddf6f80b9
Reduce blockfilter memory ( #302 )
...
* use same Error type in all methods of BlockFilter
* reduce Blockfilter memory footprint
* amend the example use
* remove unused constant
2019-08-09 16:58:02 +02:00
Elichai Turkel
a9e65f36d3
Check that the amount precision isn't more than the size of the amount
2019-08-09 10:41:21 -04:00
Elichai Turkel
4a1830c423
Replaced Read trait with a generic over Read ( #307 )
...
Removed tempfile usage from stream_reader
2019-08-07 17:35:22 +02:00
Andrew Poelstra
db8c8b497b
Merge pull request #303 from practicalswift/typos
...
Fix typos
2019-08-05 15:16:17 +00:00
Aleru
40c5a568fa
add TODOs
2019-08-04 22:27:59 -04:00
practicalswift
8152ed758c
Fix typos
2019-08-04 19:27:36 +00:00
Steven Roose
cc2ede7a80
Use `$crate::` prefix for uses in macros
2019-07-29 11:30:35 +02:00
Steven Roose
2c2d55d90a
bip32: Implement hex serialization for Fingerprint and ChainCode
2019-07-26 15:32:33 +02:00
Steven Roose
4530e403e0
Use collect_str instead of serialize_str in serde macros
2019-07-26 15:30:47 +02:00
Steven Roose
fc6415d652
Add human-readable serde for OutPoint as `<txid>:<vout>`
2019-07-26 15:30:46 +02:00
Steven Roose
3c66418f3a
bip32: Add serde for Extended(Priv|Pub)Key
2019-07-26 15:30:44 +02:00
Tamás Blummer
c93a70487f
Add client side block filter (BIP158) ( #281 )
...
* add client side block filters with code from murmel. use siphash from bitcoin_hashes pass Bitcoin Core tests upgrade to bitcoin_hashes 0.7
* add filter.filter_id() test use BlockFilter directly
* fixed edge cases of matching empty query sets or or using empty filter
2019-07-26 09:36:25 +02:00
Andrew Poelstra
b6c1266102
Merge pull request #293 from stevenroose/bip143-script-code
...
bip143: Rename witness_script to script_code
2019-07-24 22:43:58 +00:00
Andrew Poelstra
a041168205
Merge pull request #265 from apoelstra/2019-05-enc-dec-cleanup
...
clean up encoding/decoding traits
2019-07-24 19:30:21 +00:00
Tamas Blummer
ff2f5d9ec2
forbid unsafe
2019-07-23 23:29:45 +02:00
Steven Roose
b312c4de6a
bip143: Rename witness_script to script_code
...
For p2wsh the scriptCode is the witness script, but for p2wpkh, it's the
equivalent legacy p2pkh output script.
The name scriptCode is used in the BIP, so it's less confusing.
2019-07-15 17:33:23 +02:00
Andrew Poelstra
3b9a94a178
eliminate type parameter from the `Decodable` trait
2019-07-11 17:23:01 +00:00
Andrew Poelstra
42960b959f
eliminate type parameter from `Encodable` trait
2019-07-11 17:21:19 +00:00
Andrew Poelstra
87e7ebcf1b
prevent compilation on 16-bit targets so we can use `usize` and assume it is 32 bits
2019-07-11 17:15:33 +00:00
Andrew Poelstra
b734d6488a
make consensus_encode return the encoded length
2019-07-11 17:15:32 +00:00
Andrew Poelstra
abb9210c04
make `VarInt::len` and `Transaction::get_weight` return a usize
2019-07-11 17:14:05 +00:00
Andrew Poelstra
7e6ad7c893
rename Encoder to WriteExt and Decoder to ReadExt
2019-07-11 15:01:38 +00:00
Andrew Poelstra
24ebc29005
fix some recent rustc warnings
2019-07-11 15:01:38 +00:00
John L. Jegutanis
aae2937d11
Add a MerkleBlock construction
...
This is a port of the bitcoin-core CPartialMerkleTree and CMerkleBlock classes.
Here they are called PartialMerkleTree and MerkleBlock.
These are useful for SPV clients that wish to verify that a transaction is
present in a specific block in an authenticated way.
2019-07-05 20:44:31 +02:00
John L. Jegutanis
56f98e00a0
Changed constants from `static` to `const` and added 2 new constants
2019-07-05 15:01:54 +02:00
Andrew Poelstra
1a4bb371a1
Merge pull request #286 from apoelstra/2019-06-builder-ext
...
script: give `Builder` ability to verify-ify opcodes
2019-07-03 21:50:57 +00:00
Andrew Poelstra
cded694381
Merge pull request #277 from jonasnick/rand
...
Remove unused rand dependency
2019-07-03 20:42:44 +00:00
Andrew Poelstra
b2727b6ebe
Merge pull request #250 from stevenroose/no-strason
...
Remove Decimal and replace strason with serde_json
2019-07-03 17:30:21 +00:00
Andrew Poelstra
a11412862c
script: give `Builder` ability to verify-ify opcodes
2019-06-29 21:26:56 +00:00
Steven Roose
560a709faa
Add OutPoint::new() for one-liner construction ( #285 )
2019-06-24 18:49:20 +02:00
Steven Roose
d2923b7cce
Rename OP_NOP2 and OP_NOP3 to OP_CLTV and OP_CSV
2019-06-13 18:56:35 +01:00