From f54560a14820a31d0852022f1b640c4c3b68eeb3 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Sun, 12 Sep 2021 17:32:50 +1000 Subject: [PATCH 1/8] Proptest is a test dependency --- daemon/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemon/Cargo.toml b/daemon/Cargo.toml index d5b2d4a..6d833f7 100644 --- a/daemon/Cargo.toml +++ b/daemon/Cargo.toml @@ -7,7 +7,6 @@ edition = "2018" anyhow = "1" bdk = { version = "0.10", default-features = false } futures = "0.3" -proptest = "1" rocket = { git = "https://github.com/SergioBenitez/Rocket", features = ["json"] } rocket_db_pools = { git = "https://github.com/SergioBenitez/Rocket", features = ["sqlx_sqlite"] } rust_decimal = { version = "1.15", features = ["serde-float", "serde-arbitrary-precision"] } @@ -22,3 +21,4 @@ uuid = { version = "0.8", features = ["serde", "v4"] } [dev-dependencies] tempfile = "3" +proptest = "1" From dd17d7da1a888131e669be540315400cbba9d671 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Sun, 12 Sep 2021 17:33:16 +1000 Subject: [PATCH 2/8] Align bdk versions --- Cargo.lock | 64 ++++++----------------------------------------- daemon/Cargo.toml | 2 +- 2 files changed, 9 insertions(+), 57 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fb8312b..31eb1a5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -131,23 +131,6 @@ dependencies = [ "byteorder", ] -[[package]] -name = "bdk" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f4da304c23a06c21807598a7fe3223566e84c76c6bba2cab2504370dd6f4938" -dependencies = [ - "async-trait", - "bdk-macros", - "bitcoin 0.26.2", - "js-sys", - "log", - "miniscript 5.1.0", - "rand 0.7.3", - "serde", - "serde_json", -] - [[package]] name = "bdk" version = "0.10.1-dev" @@ -155,11 +138,11 @@ source = "git+https://github.com/bitcoindevkit/bdk/?rev=acf157a99a305226203d2b55 dependencies = [ "async-trait", "bdk-macros", - "bitcoin 0.27.0", + "bitcoin", "electrum-client", "js-sys", "log", - "miniscript 6.0.1", + "miniscript", "rand 0.7.3", "serde", "serde_json", @@ -177,12 +160,6 @@ dependencies = [ "syn", ] -[[package]] -name = "bech32" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dabbe35f96fb9507f7330793dc490461b2962659ac5d427181e451a623751d1" - [[package]] name = "bech32" version = "0.8.1" @@ -210,19 +187,6 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" -[[package]] -name = "bitcoin" -version = "0.26.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6742ec672d3f12506f4ac5c0d853926ff1f94e675f60ffd3224039972bf663f1" -dependencies = [ - "base64-compat", - "bech32 0.7.3", - "bitcoin_hashes 0.9.7", - "secp256k1", - "serde", -] - [[package]] name = "bitcoin" version = "0.27.0" @@ -230,7 +194,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a427b27dae305157520d86673f2393b3eb08d880609abfcffc6e3c3c820e764" dependencies = [ "base64-compat", - "bech32 0.8.1", + "bech32", "bitcoin_hashes 0.10.0", "bitcoinconsensus", "secp256k1", @@ -242,9 +206,6 @@ name = "bitcoin_hashes" version = "0.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ce18265ec2324ad075345d5814fbeed4f41f0a660055dc78840b74d19b874b1" -dependencies = [ - "serde", -] [[package]] name = "bitcoin_hashes" @@ -309,8 +270,8 @@ name = "cfd_protocol" version = "0.1.0" dependencies = [ "anyhow", - "bdk 0.10.1-dev", - "bitcoin 0.27.0", + "bdk", + "bitcoin", "itertools", "rand 0.6.5", "rand_chacha 0.1.1", @@ -424,7 +385,7 @@ name = "daemon" version = "0.1.0" dependencies = [ "anyhow", - "bdk 0.10.0", + "bdk", "futures", "proptest", "rocket", @@ -539,7 +500,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edd12f125852d77980725243b2a8b3bea73cd4c7a22c33bc52b08b664c561dc7" dependencies = [ - "bitcoin 0.27.0", + "bitcoin", "log", "rustls 0.16.0", "serde", @@ -1050,22 +1011,13 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c835948974f68e0bd58636fc6c5b1fbff7b297e3046f11b3b3c18bbac012c6d" -[[package]] -name = "miniscript" -version = "5.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71f455be59a359d50370c4f587afbc5739c862e684c5afecae80ab93e7474b4e" -dependencies = [ - "bitcoin 0.26.2", -] - [[package]] name = "miniscript" version = "6.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d69450033bf162edf854d4aacaff82ca5ef34fa81f6cf69e1c81a103f0834997" dependencies = [ - "bitcoin 0.27.0", + "bitcoin", ] [[package]] diff --git a/daemon/Cargo.toml b/daemon/Cargo.toml index 6d833f7..1456c2e 100644 --- a/daemon/Cargo.toml +++ b/daemon/Cargo.toml @@ -5,7 +5,7 @@ edition = "2018" [dependencies] anyhow = "1" -bdk = { version = "0.10", default-features = false } +bdk = { git = "https://github.com/bitcoindevkit/bdk/", rev = "acf157a99a305226203d2b55a567291a93c64720" } futures = "0.3" rocket = { git = "https://github.com/SergioBenitez/Rocket", features = ["json"] } rocket_db_pools = { git = "https://github.com/SergioBenitez/Rocket", features = ["sqlx_sqlite"] } From 2234e15ce9c5210dbf67b971a4636d382ca648be Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Sun, 12 Sep 2021 17:35:31 +1000 Subject: [PATCH 3/8] Remove unused dependency --- Cargo.lock | 71 ----------------------------------------------- daemon/Cargo.toml | 1 - 2 files changed, 72 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 31eb1a5..09e4349 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -394,7 +394,6 @@ dependencies = [ "rust_decimal_macros", "serde", "serde_json", - "serde_with", "sqlx", "tempfile", "tokio", @@ -402,41 +401,6 @@ dependencies = [ "uuid", ] -[[package]] -name = "darling" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "757c0ded2af11d8e739c4daea1ac623dd1624b06c844cf3f5a39f1bdbd99bb12" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c34d8efb62d0c2d7f60ece80f75e5c63c1588ba68032740494b0b9a996466e3" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn", -] - -[[package]] -name = "darling_macro" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ade7bff147130fe5e6d39f089c6bd49ec0250f35d70b2eebf72afdfc919f15cc" -dependencies = [ - "darling_core", - "quote", - "syn", -] - [[package]] name = "devise" version = "0.3.1" @@ -851,12 +815,6 @@ dependencies = [ "want", ] -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - [[package]] name = "idna" version = "0.2.3" @@ -1808,29 +1766,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_with" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "062b87e45d8f26714eacfaef0ed9a583e2bfd50ebd96bdd3c200733bd5758e2c" -dependencies = [ - "rustversion", - "serde", - "serde_with_macros", -] - -[[package]] -name = "serde_with_macros" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98c1fcca18d55d1763e1c16873c4bde0ac3ef75179a28c7b372917e0494625be" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "sha2" version = "0.9.8" @@ -2045,12 +1980,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - [[package]] name = "syn" version = "1.0.76" diff --git a/daemon/Cargo.toml b/daemon/Cargo.toml index 1456c2e..e9c1ce1 100644 --- a/daemon/Cargo.toml +++ b/daemon/Cargo.toml @@ -13,7 +13,6 @@ rust_decimal = { version = "1.15", features = ["serde-float", "serde-arbitrary-p rust_decimal_macros = "1.15" serde = { version = "1", features = ["derive"] } serde_json = "1" -serde_with = { version = "1", features = ["macros"] } sqlx = { version = "0.5", features = ["macros", "offline"] } tokio = { version = "1", features = ["rt-multi-thread", "time", "macros", "sync", "process", "fs", "net"] } tokio-util = { version = "0.6", features = ["codec"] } From 7af1e1310e23577a417beef72018a980084fe157 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Sun, 12 Sep 2021 17:38:20 +1000 Subject: [PATCH 4/8] Deactivate futures default features --- daemon/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemon/Cargo.toml b/daemon/Cargo.toml index e9c1ce1..462cc63 100644 --- a/daemon/Cargo.toml +++ b/daemon/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" [dependencies] anyhow = "1" bdk = { git = "https://github.com/bitcoindevkit/bdk/", rev = "acf157a99a305226203d2b55a567291a93c64720" } -futures = "0.3" +futures = { version = "0.3", default-features = false } rocket = { git = "https://github.com/SergioBenitez/Rocket", features = ["json"] } rocket_db_pools = { git = "https://github.com/SergioBenitez/Rocket", features = ["sqlx_sqlite"] } rust_decimal = { version = "1.15", features = ["serde-float", "serde-arbitrary-precision"] } From 89e75d117dfceb6cf79210753cac696a3a64ae32 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Sun, 12 Sep 2021 17:39:26 +1000 Subject: [PATCH 5/8] Don't activate features we don't use --- daemon/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemon/Cargo.toml b/daemon/Cargo.toml index 462cc63..a16ff53 100644 --- a/daemon/Cargo.toml +++ b/daemon/Cargo.toml @@ -14,7 +14,7 @@ rust_decimal_macros = "1.15" serde = { version = "1", features = ["derive"] } serde_json = "1" sqlx = { version = "0.5", features = ["macros", "offline"] } -tokio = { version = "1", features = ["rt-multi-thread", "time", "macros", "sync", "process", "fs", "net"] } +tokio = { version = "1", features = ["rt-multi-thread", "macros", "sync", "net"] } tokio-util = { version = "0.6", features = ["codec"] } uuid = { version = "0.8", features = ["serde", "v4"] } From 8993492543bd43e8a04e920301de9b0b8b3dfb5f Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Sun, 12 Sep 2021 17:41:16 +1000 Subject: [PATCH 6/8] Track bdk's rev in lockfile --- Cargo.lock | 2 +- cfd_protocol/Cargo.toml | 2 +- daemon/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 09e4349..bc1d1ff 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -134,7 +134,7 @@ dependencies = [ [[package]] name = "bdk" version = "0.10.1-dev" -source = "git+https://github.com/bitcoindevkit/bdk/?rev=acf157a99a305226203d2b55a567291a93c64720#acf157a99a305226203d2b55a567291a93c64720" +source = "git+https://github.com/bitcoindevkit/bdk/#acf157a99a305226203d2b55a567291a93c64720" dependencies = [ "async-trait", "bdk-macros", diff --git a/cfd_protocol/Cargo.toml b/cfd_protocol/Cargo.toml index f12bf9e..ae74903 100644 --- a/cfd_protocol/Cargo.toml +++ b/cfd_protocol/Cargo.toml @@ -5,7 +5,7 @@ edition = "2018" [dependencies] anyhow = "1" -bdk = { git = "https://github.com/bitcoindevkit/bdk/", rev = "acf157a99a305226203d2b55a567291a93c64720" } +bdk = { git = "https://github.com/bitcoindevkit/bdk/" } itertools = "0.10" rand = "0.6" rand_chacha = "0.1" diff --git a/daemon/Cargo.toml b/daemon/Cargo.toml index a16ff53..dc484ed 100644 --- a/daemon/Cargo.toml +++ b/daemon/Cargo.toml @@ -5,7 +5,7 @@ edition = "2018" [dependencies] anyhow = "1" -bdk = { git = "https://github.com/bitcoindevkit/bdk/", rev = "acf157a99a305226203d2b55a567291a93c64720" } +bdk = { git = "https://github.com/bitcoindevkit/bdk/" } futures = { version = "0.3", default-features = false } rocket = { git = "https://github.com/SergioBenitez/Rocket", features = ["json"] } rocket_db_pools = { git = "https://github.com/SergioBenitez/Rocket", features = ["sqlx_sqlite"] } From ea07efcae89cfd42a82a27070d671fa9ac95a856 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Sun, 12 Sep 2021 17:43:00 +1000 Subject: [PATCH 7/8] Remove proptest while we are not using it --- Cargo.lock | 80 +---------------------------------------------- daemon/Cargo.toml | 1 - 2 files changed, 1 insertion(+), 80 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bc1d1ff..6e525c6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -172,21 +172,6 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "383d29d513d8764dcdc42ea295d979eb99c3c9f00607b3692cf68a431f7dca72" -[[package]] -name = "bit-set" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e11e16035ea35e4e5997b393eacbf6f63983188f7a2ad25bfb13465f5ad59de" -dependencies = [ - "bit-vec", -] - -[[package]] -name = "bit-vec" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" - [[package]] name = "bitcoin" version = "0.27.0" @@ -387,7 +372,6 @@ dependencies = [ "anyhow", "bdk", "futures", - "proptest", "rocket", "rocket_db_pools", "rust_decimal", @@ -1183,38 +1167,6 @@ dependencies = [ "yansi", ] -[[package]] -name = "proptest" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e0d9cc07f18492d879586c92b485def06bc850da3118075cd45d50e9c95b0e5" -dependencies = [ - "bit-set", - "bitflags", - "byteorder", - "lazy_static", - "num-traits", - "quick-error 2.0.1", - "rand 0.8.4", - "rand_chacha 0.3.1", - "rand_xorshift 0.3.0", - "regex-syntax", - "rusty-fork", - "tempfile", -] - -[[package]] -name = "quick-error" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" - -[[package]] -name = "quick-error" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" - [[package]] name = "quote" version = "1.0.9" @@ -1239,7 +1191,7 @@ dependencies = [ "rand_jitter", "rand_os", "rand_pcg", - "rand_xorshift 0.1.1", + "rand_xorshift", "winapi 0.3.9", ] @@ -1411,15 +1363,6 @@ dependencies = [ "rand_core 0.3.1", ] -[[package]] -name = "rand_xorshift" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" -dependencies = [ - "rand_core 0.6.3", -] - [[package]] name = "rdrand" version = "0.4.0" @@ -1651,18 +1594,6 @@ version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61b3909d758bb75c79f23d4736fac9433868679d3ad2ea7a61e3c25cfda9a088" -[[package]] -name = "rusty-fork" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" -dependencies = [ - "fnv", - "quick-error 1.2.3", - "tempfile", - "wait-timeout", -] - [[package]] name = "ryu" version = "1.0.5" @@ -2278,15 +2209,6 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" -[[package]] -name = "wait-timeout" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" -dependencies = [ - "libc", -] - [[package]] name = "want" version = "0.3.0" diff --git a/daemon/Cargo.toml b/daemon/Cargo.toml index dc484ed..bec2afd 100644 --- a/daemon/Cargo.toml +++ b/daemon/Cargo.toml @@ -20,4 +20,3 @@ uuid = { version = "0.8", features = ["serde", "v4"] } [dev-dependencies] tempfile = "3" -proptest = "1" From d6b8df7958b7360d533723a2cf0e897e76915a95 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Sun, 12 Sep 2021 17:46:26 +1000 Subject: [PATCH 8/8] `macros` is a default feature --- daemon/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemon/Cargo.toml b/daemon/Cargo.toml index bec2afd..ef558aa 100644 --- a/daemon/Cargo.toml +++ b/daemon/Cargo.toml @@ -13,7 +13,7 @@ rust_decimal = { version = "1.15", features = ["serde-float", "serde-arbitrary-p rust_decimal_macros = "1.15" serde = { version = "1", features = ["derive"] } serde_json = "1" -sqlx = { version = "0.5", features = ["macros", "offline"] } +sqlx = { version = "0.5", features = ["offline"] } tokio = { version = "1", features = ["rt-multi-thread", "macros", "sync", "net"] } tokio-util = { version = "0.6", features = ["codec"] } uuid = { version = "0.8", features = ["serde", "v4"] }