Skip to content
This repository was archived by the owner on Mar 23, 2021. It is now read-only.

Commit 2b5370c

Browse files
Merge btsieve crate into cnd
1 parent d44ef78 commit 2b5370c

File tree

76 files changed

+137
-281
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+137
-281
lines changed

Cargo.lock

Lines changed: 2 additions & 58 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[workspace]
2-
members = ["cnd", "btsieve", "libp2p-comit", "internal/*"]
2+
members = ["cnd", "libp2p-comit", "internal/*"]

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ all: format build clippy test doc e2e_scripts
4949
format: install_rustfmt install_tomlfmt yarn_install
5050
$(CARGO_NIGHTLY) fmt
5151
$(CARGO) tomlfmt -p Cargo.toml
52+
$(CARGO) tomlfmt -p cnd/Cargo.toml
53+
$(CARGO) tomlfmt -p libp2p-comit/Cargo.toml
5254
(cd ./api_tests; yarn run fix)
5355

5456
ci: check_format doc clippy test build e2e

btsieve/Cargo.toml

Lines changed: 0 additions & 27 deletions
This file was deleted.

btsieve/src/bitcoin/quickcheck_impls.rs

Lines changed: 0 additions & 15 deletions
This file was deleted.

btsieve/src/ethereum/quickcheck_impls.rs

Lines changed: 0 additions & 88 deletions
This file was deleted.

btsieve/src/quickcheck.rs

Lines changed: 0 additions & 14 deletions
This file was deleted.

cnd/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ async-trait = "0.1"
1212
binary_macros = "0.6"
1313
bitcoin = "0.19.1"
1414
blockchain_contracts = "0.1"
15-
btsieve = { version = "0.1.0", path = "../btsieve" }
1615
chrono = { version = "0.4", features = ["serde"] }
1716
config = { version = "0.9", features = ["toml"] }
1817
debug_stub_derive = "0.3"
@@ -23,6 +22,7 @@ diesel_migrations = "1.4.0"
2322
directories = "2.0"
2423
either = "1.5"
2524
enum-display-derive = "0.1"
25+
ethbloom = "0.6.4"
2626
ethereum_support = { path = "../internal/ethereum_support" }
2727
fern = { version = "0.5", features = ["colored"] }
2828
futures = { version = "0.1" }
@@ -54,6 +54,7 @@ state_machine_future = { version = "0.2" }
5454
structopt = "0.3"
5555
strum = "0.16"
5656
strum_macros = "0.16"
57+
testcontainers = "0.8"
5758
thiserror = "1"
5859
tokio = "0.1"
5960
toml = "0.5"

btsieve/src/lib.rs renamed to cnd/src/btsieve.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33

44
pub mod bitcoin;
55
pub mod ethereum;
6-
pub mod first_or_else;
7-
8-
#[cfg(test)]
9-
pub mod quickcheck;
106

117
use tokio::prelude::{Future, Stream};
128

btsieve/src/bitcoin/bitcoind_connector.rs renamed to cnd/src/btsieve/bitcoin/bitcoind_connector.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
use crate::{bitcoin::bitcoin_http_request_for_hex_encoded_object, BlockByHash, LatestBlock};
1+
use crate::btsieve::{
2+
bitcoin::bitcoin_http_request_for_hex_encoded_object, BlockByHash, LatestBlock,
3+
};
24
use bitcoin::{hashes::sha256d, Network};
35
use reqwest::{r#async::Client, Url};
46
use serde::Deserialize;
@@ -9,7 +11,7 @@ struct ChainInfo {
911
bestblockhash: sha256d::Hash,
1012
}
1113

12-
#[derive(Clone)]
14+
#[derive(Clone, Debug)]
1315
pub struct BitcoindConnector {
1416
chaininfo_url: Url,
1517
raw_block_by_hash_url: Url,
@@ -33,7 +35,7 @@ impl BitcoindConnector {
3335
}
3436

3537
impl LatestBlock for BitcoindConnector {
36-
type Error = crate::bitcoin::Error;
38+
type Error = crate::btsieve::bitcoin::Error;
3739
type Block = bitcoin::Block;
3840
type BlockHash = sha256d::Hash;
3941

@@ -66,7 +68,7 @@ impl LatestBlock for BitcoindConnector {
6668
}
6769

6870
impl BlockByHash for BitcoindConnector {
69-
type Error = crate::bitcoin::Error;
71+
type Error = crate::btsieve::bitcoin::Error;
7072
type Block = bitcoin::Block;
7173
type BlockHash = sha256d::Hash;
7274

0 commit comments

Comments
 (0)