From 08ddf6cefee7612c54d30b254e77a72ab085d7bb Mon Sep 17 00:00:00 2001 From: Oleksandr Anyshchenko Date: Wed, 6 Jun 2018 15:49:38 +0300 Subject: [PATCH 1/8] Serialize regtest network type --- src/blockchain/consensus_storage.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/blockchain/consensus_storage.rs b/src/blockchain/consensus_storage.rs index 5f7bff4..79f0918 100644 --- a/src/blockchain/consensus_storage.rs +++ b/src/blockchain/consensus_storage.rs @@ -138,6 +138,7 @@ where match *network { btc::Network::Bitcoin => ser.serialize_str("bitcoin"), btc::Network::Testnet => ser.serialize_str("testnet"), + btc::Network::Regtest => ser.serialize_str("regtest"), } } From e9482ab963c705149c7fd5f557b457fd7e4c05d4 Mon Sep 17 00:00:00 2001 From: Oleksandr Anyshchenko Date: Wed, 6 Jun 2018 16:30:51 +0300 Subject: [PATCH 2/8] Update changelog --- CHANGELOG.md | 2 ++ Cargo.toml | 2 +- src/blockchain/consensus_storage.rs | 7 ++----- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b73da6d..b76dce8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] + - Changed `btc::Network` serializing into string + ## 0.8 - 2018-06-01 ### Breaking changes diff --git a/Cargo.toml b/Cargo.toml index 012fdd9..061da11 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,7 @@ travis-ci = { repository = "exonum/exonum-btc-anchoring" } exonum = "0.8.0" exonum_bitcoinrpc = "0.5.1" -bitcoin="0.13.0" +bitcoin = "=0.13.1" byteorder = "1.0.0" btc-transaction-utils = "0.2.0" clap = "2.22.1" diff --git a/src/blockchain/consensus_storage.rs b/src/blockchain/consensus_storage.rs index 79f0918..ed13d30 100644 --- a/src/blockchain/consensus_storage.rs +++ b/src/blockchain/consensus_storage.rs @@ -135,11 +135,7 @@ fn btc_network_to_str(network: &btc::Network, ser: S) -> Result ser.serialize_str("bitcoin"), - btc::Network::Testnet => ser.serialize_str("testnet"), - btc::Network::Regtest => ser.serialize_str("regtest"), - } + ser.serialize_str(&network.to_string()) } fn btc_network_from_str<'de, D>(deserializer: D) -> Result @@ -152,6 +148,7 @@ where match s.as_str() { "bitcoin" => Ok(btc::Network::Bitcoin), "testnet" => Ok(btc::Network::Testnet), + "regtest" => Ok(btc::Network::Regtest), other => Err(::serde::de::Error::unknown_variant(other, VARIANTS)), } } From 9eb817bbc430f16f18871efd8b4b6796de9ae357 Mon Sep 17 00:00:00 2001 From: Oleksandr Anyshchenko Date: Wed, 6 Jun 2018 17:27:14 +0300 Subject: [PATCH 3/8] Some changes --- CHANGELOG.md | 2 +- src/blockchain/consensus_storage.rs | 11 +++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b76dce8..d0c662a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] - - Changed `btc::Network` serializing into string +- Changed `btc::Network` (de)serializing into/from string ## 0.8 - 2018-06-01 diff --git a/src/blockchain/consensus_storage.rs b/src/blockchain/consensus_storage.rs index ed13d30..2c43632 100644 --- a/src/blockchain/consensus_storage.rs +++ b/src/blockchain/consensus_storage.rs @@ -142,15 +142,10 @@ fn btc_network_from_str<'de, D>(deserializer: D) -> Result, { + const VARIANTS: &[&str] = &["bitcoin", "testnet", "regtest"]; let s: String = Deserialize::deserialize(deserializer)?; - - const VARIANTS: &[&str] = &["bitcoin", "testnet"]; - match s.as_str() { - "bitcoin" => Ok(btc::Network::Bitcoin), - "testnet" => Ok(btc::Network::Testnet), - "regtest" => Ok(btc::Network::Regtest), - other => Err(::serde::de::Error::unknown_variant(other, VARIANTS)), - } + s.parse::() + .map_err(|_| ::serde::de::Error::unknown_variant(&s, VARIANTS)) } impl StorageValue for AnchoringConfig { From 6bf40314e0e391ba2c6aeac03d353efe2b6c1182 Mon Sep 17 00:00:00 2001 From: Oleksandr Anyshchenko Date: Wed, 6 Jun 2018 18:56:22 +0300 Subject: [PATCH 4/8] Bump version to 0.8.1 --- CHANGELOG.md | 2 ++ Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d0c662a..14f8c1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +## 0.8.1 - 2018-06-06 + - Changed `btc::Network` (de)serializing into/from string ## 0.8 - 2018-06-01 diff --git a/Cargo.toml b/Cargo.toml index 061da11..3c8ab84 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "exonum-btc-anchoring" -version = "0.8.0" +version = "0.8.1" authors = ["The Exonum Team "] homepage = "https://exonum.com/doc/advanced/bitcoin-anchoring/" repository = "https://github.com/exonum/exonum-btc-anchoring" From f00c7a286d41a63c480667005749b7ae85622eef Mon Sep 17 00:00:00 2001 From: Oleksandr Anyshchenko Date: Wed, 6 Jun 2018 19:24:46 +0300 Subject: [PATCH 5/8] Modified changelog --- CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 14f8c1e..554332c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## 0.8.1 - 2018-06-06 -- Changed `btc::Network` (de)serializing into/from string +### Internal improvements + +- Changed `btc::Network` (de)serializing into/from string (#128) + +- Updated to the [Rust-bitcoin 0.13.1](https://github.com/rust-bitcoin/rust-bitcoin/releases/tag/0.13) + release (#128). ## 0.8 - 2018-06-01 From 1fd88054b8ef3be475e8001d1d9b7bfdd3479b04 Mon Sep 17 00:00:00 2001 From: Oleksandr Anyshchenko Date: Wed, 6 Jun 2018 19:33:26 +0300 Subject: [PATCH 6/8] Modified changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 554332c..30873e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Changed `btc::Network` (de)serializing into/from string (#128) -- Updated to the [Rust-bitcoin 0.13.1](https://github.com/rust-bitcoin/rust-bitcoin/releases/tag/0.13) +- Updated to the [Rust-bitcoin 0.13.1](http`s://github.com/rust-bitcoin/rust-bitcoin/releases/tag/0.13) release (#128). ## 0.8 - 2018-06-01 From 32b211a9ff31d9b2ca24e8b3beab2d1b56364ab1 Mon Sep 17 00:00:00 2001 From: Oleksandr Anyshchenko Date: Wed, 6 Jun 2018 19:44:36 +0300 Subject: [PATCH 7/8] Modified changelog --- CHANGELOG.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 30873e9..b8f9628 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Internal improvements -- Changed `btc::Network` (de)serializing into/from string (#128) +- Changed `btc::Network` (de)serializing into/from string (#128). - Updated to the [Rust-bitcoin 0.13.1](http`s://github.com/rust-bitcoin/rust-bitcoin/releases/tag/0.13) release (#128). @@ -20,7 +20,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Breaking changes -- The anchoring service has been switched to using p2wsh address format. (#123) +- The anchoring service has been switched to using p2wsh address format (#123). It now uses segwit addresses.... This change increases the limit on the number of validators and anchoring security as well as reduces fees for applying thereof. @@ -34,7 +34,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Introduced a new API method `/v1/block_header_proof/:height` that provides cryptographic proofs for Exonum blocks including those anchored to Bitcoin blockchain. The proof is an apparent evidence of availability of a certain Exonum block - in the blockchain. (#124) + in the blockchain (#124). ### Internal improvements @@ -43,7 +43,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Fixed -- Fixed bug with the `nearest_lect` endpoint that sometimes didn't return actual data [ECR-1387]. (#125) +- Fixed bug with the `nearest_lect` endpoint that sometimes didn't return actual data [ECR-1387] (#125). ## 0.7 - 2018-04-11 @@ -64,18 +64,18 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Fixed -- Fix txid for transactions with the witness data [ECR-986]. (#119) +- Fix txid for transactions with the witness data [ECR-986] (#119). Txid for transactions should be always computed without witness data. ### Internal improvements -- Implement `Display` for the wrapped bitcoin types. (#119) +- Implement `Display` for the wrapped bitcoin types (#119). ## 0.6 - 2018-03-06 ### Breaking changes -- The `network` parameter became named. (#114) +- The `network` parameter became named (#114). Now, to generate template config, run the following command: ```shell @@ -86,9 +86,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Internal improvements - Error types now use `failure` instead of `derive-error`, - which makes error messages more human-readable. (#115) + which makes error messages more human-readable (#115). -- Implemented error codes for incorrect anchoring messages. (#117) +- Implemented error codes for incorrect anchoring messages (#117). - Updated to the [Exonum 0.6.0](https://github.com/exonum/exonum/releases/tag/v0.6) release (#117). @@ -124,22 +124,22 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Fixed -- Do not emit panic if lect does not found in bitcoin blockchain. (#88) +- Do not emit panic if lect does not found in bitcoin blockchain (#88). ## 0.2 - 2017-09-14 ### Added -- Add `anchoring-observer-check-interval` to clap fabric (#85) +- Add `anchoring-observer-check-interval` to clap fabric (#85). ### Changed -- Run rpc tests only if the `rpc_tests` feature enabled. (#84) -- Update anchoring chain observer configuration layout. (#85) +- Run rpc tests only if the `rpc_tests` feature enabled (#84). +- Update anchoring chain observer configuration layout (#85). ### Fixed -- Fix typo in documentation (#83) +- Fix typo in documentation (#83). ## 0.1 - 2017-07-17 From 380c26d4d7f03c982103ddd2745b7a09da2b33e4 Mon Sep 17 00:00:00 2001 From: Oleksandr Anyshchenko Date: Wed, 6 Jun 2018 20:41:01 +0300 Subject: [PATCH 8/8] Removed invalid link from changelog --- CHANGELOG.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b8f9628..44836aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,8 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Changed `btc::Network` (de)serializing into/from string (#128). -- Updated to the [Rust-bitcoin 0.13.1](http`s://github.com/rust-bitcoin/rust-bitcoin/releases/tag/0.13) - release (#128). +- Updated to the `Rust-bitcoin 0.13.1` release (#128). ## 0.8 - 2018-06-01