Commit Graph

216 Commits

Author SHA1 Message Date
Elichai Turkel 52ff97cddc
Deny unused imports and remove unneeded 2019-08-19 13:29:43 -04:00
Steven Roose 48f4c1989f
Rename bitcoin_hashes dependency to hashes 2019-08-16 15:52:27 +01:00
Steven Roose bfdcfee28e
Add Address::from_script constructor 2019-08-15 22:28:20 +01:00
practicalswift 8152ed758c Fix typos 2019-08-04 19:27:36 +00:00
Steven Roose fc6415d652
Add human-readable serde for OutPoint as `<txid>:<vout>` 2019-07-26 15:30:46 +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 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 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
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 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
Steven Roose 30201f3924
Remove Decimal and replace strason with serde_json 2019-06-13 18:29:16 +01:00
Jonas Nick 30f24a39d0 Remove confusing mentions of SPV 2019-06-07 13:12:07 +00:00
Steven Roose 093d60bf7f
Rename BlockHeader::spv_validate to validate_pow 2019-06-06 10:39:03 +01:00
Matt Corallo 4f96a87475 Drop LoneHeaders and just use BlockHeader
The protocol has a bug where a 0u8 is pushed at the end of each
block header on the wire in headers messages. WHy this bug came
about is unrealted and shouldn't impact API design.
2019-05-17 17:55:02 -04:00
Andrew Poelstra 049f75e502 script: add `push_key` function to Builder to allow serializing public keys more easily 2019-03-04 01:32:35 +00:00
Matt Corallo 084703cba9
Merge pull request #218 from tamasblummer/merkle_root_fix
Merkle root calculation and witness commitment check for Block
2019-02-16 19:05:42 -05:00
Carl Dong 560dfb7c01
Merge pull request #203 from stevenroose/asm
Extract the Script assembly creator from fmt::Debug
2019-02-11 17:24:03 -05:00
ariard 51971dd533 Fix typos and clarify some comment in blockdata, block, address (#230) 2019-02-04 07:30:41 +01:00
Tamas Blummer d8c93d9935 Implement Witness commitment check for Block. Remove MerkleRoot implementations for types implementing BitcoinHash as
it is misleading. MerkleRoot is defined instead for a Block.
2019-02-01 17:46:26 +01: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
Dimitris Apostolou 132ca5ea95 Fix typos 2019-01-23 14:17:29 -05:00
Antoine Riard 96c66292c8 Fix comment on transaction version 2019-01-10 18:29:50 -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 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
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
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
Andrew Poelstra 98e39b4383 transaction: make 0-input de/serialization always use Segwit 2018-09-27 13:50:35 +00: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
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 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