From 4de8b0ebc46bcf9ccf85b1251c802ff9931e92aa Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Thu, 7 Oct 2021 12:26:51 +1100 Subject: [PATCH] Upgrade bitcoin and bdk to latest version The latest version allows us to access `miniscript` via `bdk` which removes the need for declaring it as an extra dependency. --- Cargo.lock | 464 +++++++++---------------------------- swap/Cargo.toml | 6 +- swap/src/bitcoin.rs | 9 +- swap/src/bitcoin/cancel.rs | 2 +- swap/src/bitcoin/lock.rs | 2 +- swap/src/bitcoin/punish.rs | 2 +- swap/src/bitcoin/redeem.rs | 2 +- swap/src/bitcoin/refund.rs | 2 +- swap/src/bitcoin/wallet.rs | 4 +- 9 files changed, 125 insertions(+), 368 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8a03cf46..f731757a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -57,7 +57,7 @@ checksum = "43bb833f0bf979d8475d38fbf09ed3b8a55e1885fe93ad3f93239fc6a4f17b98" dependencies = [ "getrandom 0.2.2", "once_cell", - "version_check 0.9.3", + "version_check", ] [[package]] @@ -209,16 +209,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "base64" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "489d6c0ed21b11d038c31b6ceccca973e65d73ba3bd8ecb9a2babf5546164643" -dependencies = [ - "byteorder", - "safemem", -] - [[package]] name = "base64" version = "0.10.1" @@ -251,55 +241,40 @@ dependencies = [ [[package]] name = "bdk" -version = "0.10.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f4da304c23a06c21807598a7fe3223566e84c76c6bba2cab2504370dd6f4938" +checksum = "ecf7e997526ceefbab7dd99fc0da6834ed8853bd051f53523415ed1dc82b870d" dependencies = [ "async-trait", "bdk-macros", "bitcoin", - "electrum-client 0.7.0", + "electrum-client", "js-sys", - "log 0.4.14", + "log", "miniscript", "rand 0.7.3", "serde", "serde_json", "sled", + "tokio", ] [[package]] name = "bdk-macros" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3f510015e946c5995cc169f7ed4c92ba032bbce795c0956ee0d98d82f7aff78" +checksum = "81c1980e50ae23bb6efa9283ae8679d6ea2c6fa6a99fe62533f65f4a25a1a56c" dependencies = [ "proc-macro2", "quote", "syn", ] -[[package]] -name = "bdk-testutils" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6687d59c3f65c5b318356154f00699e28dc75487abab31c09391c4febea51bbf" -dependencies = [ - "bitcoin", - "bitcoincore-rpc", - "electrum-client 0.6.0", - "log 0.4.14", - "miniscript", - "serde", - "serde_json", - "serial_test", -] - [[package]] name = "bech32" -version = "0.7.3" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dabbe35f96fb9507f7330793dc490461b2962659ac5d427181e451a623751d1" +checksum = "cf9ff0bbfd639f15c74af777d81383cf53efb7c93613f6cab67c6c11e05bbf8b" [[package]] name = "big-bytes" @@ -340,9 +315,9 @@ checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" [[package]] name = "bitcoin" -version = "0.26.2" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6742ec672d3f12506f4ac5c0d853926ff1f94e675f60ffd3224039972bf663f1" +checksum = "9a41df6ad9642c5c15ae312dd3d074de38fd3eb7cc87ad4ce10f90292a83fe4d" dependencies = [ "base64-compat", "bech32", @@ -354,14 +329,14 @@ dependencies = [ [[package]] name = "bitcoin-harness" version = "0.2.0" -source = "git+https://github.com/coblox/bitcoin-harness-rs#5a31e889618d2cdef613bd49cef02758b52eed4d" +source = "git+https://github.com/coblox/bitcoin-harness-rs#53bdc62a98b9a1e0debb06ab3a4239df1bfe4e04" dependencies = [ "async-trait", "base64 0.12.3", "bitcoin", "bitcoincore-rpc-json", "futures", - "hex 0.4.3", + "hex", "jsonrpc_client 0.5.1", "reqwest", "serde", @@ -370,39 +345,25 @@ dependencies = [ "thiserror", "tokio", "tracing", - "url 2.2.2", + "url", ] [[package]] name = "bitcoin_hashes" -version = "0.9.7" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ce18265ec2324ad075345d5814fbeed4f41f0a660055dc78840b74d19b874b1" +checksum = "006cc91e1a1d99819bc5b8214be3555c1f0611b169f527a1fdc54ed1f2b745b0" dependencies = [ "serde", ] -[[package]] -name = "bitcoincore-rpc" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d708433972bf78bd5f909d1d288f9ac1cceeab1460edb954e962f83e1f440a3" -dependencies = [ - "bitcoincore-rpc-json", - "jsonrpc", - "log 0.4.14", - "serde", - "serde_json", -] - [[package]] name = "bitcoincore-rpc-json" -version = "0.13.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "977e55a945ab1e3c446dea93267876703c15e07c7d6eeb1dfa1766b3190c560f" +checksum = "dce91de73c61f5776cf938bfa88378c5b404a70e3369b761dacbe6024fea79dd" dependencies = [ "bitcoin", - "hex 0.3.2", "serde", "serde_json", ] @@ -788,7 +749,7 @@ dependencies = [ "crossterm_winapi", "libc", "mio", - "parking_lot 0.11.2", + "parking_lot", "signal-hook", "signal-hook-mio", "winapi 0.3.9", @@ -1034,28 +995,12 @@ dependencies = [ [[package]] name = "electrum-client" -version = "0.6.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21453800c95bb1aaa57490458c42d60c6277cb8a3e386030ec2381d5c2d4fa77" +checksum = "edd12f125852d77980725243b2a8b3bea73cd4c7a22c33bc52b08b664c561dc7" dependencies = [ "bitcoin", - "log 0.4.14", - "rustls 0.16.0", - "serde", - "serde_json", - "socks", - "webpki", - "webpki-roots 0.19.0", -] - -[[package]] -name = "electrum-client" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cab4d90cc575a7daab4cfed9e315912a88071bc47462e6be57516a2f01ccc89" -dependencies = [ - "bitcoin", - "log 0.4.14", + "log", "rustls 0.16.0", "serde", "serde_json", @@ -1119,7 +1064,7 @@ checksum = "1d34cfa13a63ae058bfa601fe9e313bbdb3746427c1459185464ce0fcf62e1e8" dependencies = [ "cfg-if 1.0.0", "libc", - "redox_syscall 0.2.10", + "redox_syscall", "winapi 0.3.9", ] @@ -1167,7 +1112,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" dependencies = [ "matches", - "percent-encoding 2.1.0", + "percent-encoding", ] [[package]] @@ -1236,8 +1181,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62007592ac46aa7c2b6416f7deb9a8a8f63a01e0f1d6e1787d5630170db2b63e" dependencies = [ "futures-core", - "lock_api 0.4.5", - "parking_lot 0.11.2", + "lock_api", + "parking_lot", ] [[package]] @@ -1326,7 +1271,7 @@ checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817" dependencies = [ "serde", "typenum", - "version_check 0.9.3", + "version_check", ] [[package]] @@ -1392,8 +1337,8 @@ dependencies = [ "bitflags", "libc", "libgit2-sys", - "log 0.4.14", - "url 2.2.2", + "log", + "url", ] [[package]] @@ -1466,12 +1411,6 @@ dependencies = [ "libc", ] -[[package]] -name = "hex" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77" - [[package]] name = "hex" version = "0.4.3" @@ -1569,25 +1508,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05842d0d43232b23ccb7060ecb0f0626922c21f30012e97b767b30afd4a5d4b9" -[[package]] -name = "hyper" -version = "0.10.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a0652d9a2609a968c14be1a9ea00bf4b1d64e2e1f53a1b51b6fff3a6e829273" -dependencies = [ - "base64 0.9.3", - "httparse", - "language-tags", - "log 0.3.9", - "mime 0.2.6", - "num_cpus", - "time 0.1.43", - "traitobject", - "typeable", - "unicase", - "url 1.7.2", -] - [[package]] name = "hyper" version = "0.14.12" @@ -1619,8 +1539,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f9f7a97316d44c0af9b0301e65010573a853a9fc97046d7331d7f6bc0fd5a64" dependencies = [ "futures-util", - "hyper 0.14.12", - "log 0.4.14", + "hyper", + "log", "rustls 0.19.0", "tokio", "tokio-rustls", @@ -1633,17 +1553,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" -[[package]] -name = "idna" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" -dependencies = [ - "matches", - "unicode-bidi", - "unicode-normalization", -] - [[package]] name = "idna" version = "0.2.2" @@ -1769,18 +1678,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "jsonrpc" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "436f3455a8a4e9c7b14de9f1206198ee5d0bdc2db1b560339d2141093d7dd389" -dependencies = [ - "hyper 0.10.16", - "serde", - "serde_derive", - "serde_json", -] - [[package]] name = "jsonrpc_client" version = "0.5.1" @@ -1792,7 +1689,7 @@ dependencies = [ "reqwest", "serde", "serde_json", - "url 2.2.2", + "url", ] [[package]] @@ -1806,7 +1703,7 @@ dependencies = [ "reqwest", "serde", "serde_json", - "url 2.2.2", + "url", ] [[package]] @@ -1845,12 +1742,6 @@ dependencies = [ "tiny-keccak", ] -[[package]] -name = "language-tags" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a" - [[package]] name = "lazy_static" version = "1.4.0" @@ -1910,7 +1801,7 @@ dependencies = [ "libp2p-websocket", "libp2p-yamux", "multiaddr", - "parking_lot 0.11.2", + "parking_lot", "pin-project 1.0.5", "smallvec", "wasm-timer", @@ -1930,11 +1821,11 @@ dependencies = [ "futures-timer", "lazy_static", "libsecp256k1", - "log 0.4.14", + "log", "multiaddr", "multihash", "multistream-select", - "parking_lot 0.11.2", + "parking_lot", "pin-project 1.0.5", "prost", "prost-build", @@ -1956,7 +1847,7 @@ source = "git+https://github.com/comit-network/rust-libp2p?branch=rendezvous#4af dependencies = [ "futures", "libp2p-core", - "log 0.4.14", + "log", "smallvec", "trust-dns-resolver", ] @@ -1970,9 +1861,9 @@ dependencies = [ "bytes 1.0.1", "futures", "libp2p-core", - "log 0.4.14", + "log", "nohash-hasher", - "parking_lot 0.11.2", + "parking_lot", "rand 0.7.3", "smallvec", "unsigned-varint 0.7.0", @@ -1988,7 +1879,7 @@ dependencies = [ "futures", "lazy_static", "libp2p-core", - "log 0.4.14", + "log", "prost", "prost-build", "rand 0.8.3", @@ -2007,7 +1898,7 @@ dependencies = [ "futures", "libp2p-core", "libp2p-swarm", - "log 0.4.14", + "log", "rand 0.7.3", "void", "wasm-timer", @@ -2023,7 +1914,7 @@ dependencies = [ "futures", "libp2p-core", "libp2p-swarm", - "log 0.4.14", + "log", "prost", "prost-build", "rand 0.8.3", @@ -2045,7 +1936,7 @@ dependencies = [ "futures", "libp2p-core", "libp2p-swarm", - "log 0.4.14", + "log", "lru", "minicbor", "rand 0.7.3", @@ -2062,7 +1953,7 @@ dependencies = [ "either", "futures", "libp2p-core", - "log 0.4.14", + "log", "rand 0.7.3", "smallvec", "void", @@ -2089,7 +1980,7 @@ dependencies = [ "ipnet", "libc", "libp2p-core", - "log 0.4.14", + "log", "socket2 0.4.0", "tokio", ] @@ -2103,11 +1994,11 @@ dependencies = [ "futures", "futures-rustls", "libp2p-core", - "log 0.4.14", + "log", "quicksink", "rw-stream-sink", "soketto", - "url 2.2.2", + "url", "webpki-roots 0.21.0", ] @@ -2118,7 +2009,7 @@ source = "git+https://github.com/comit-network/rust-libp2p?branch=rendezvous#4af dependencies = [ "futures", "libp2p-core", - "parking_lot 0.11.2", + "parking_lot", "thiserror", "yamux", ] @@ -2200,15 +2091,6 @@ version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" -[[package]] -name = "lock_api" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" -dependencies = [ - "scopeguard", -] - [[package]] name = "lock_api" version = "0.4.5" @@ -2218,15 +2100,6 @@ dependencies = [ "scopeguard", ] -[[package]] -name = "log" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" -dependencies = [ - "log 0.4.14", -] - [[package]] name = "log" version = "0.4.14" @@ -2290,15 +2163,6 @@ dependencies = [ "autocfg 1.0.1", ] -[[package]] -name = "mime" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba626b8a6de5da682e1caa06bdb42a335aee5a84db8e5046a3e8ab17ba0a3ae0" -dependencies = [ - "log 0.3.9", -] - [[package]] name = "mime" version = "0.3.16" @@ -2333,9 +2197,9 @@ checksum = "0c835948974f68e0bd58636fc6c5b1fbff7b297e3046f11b3b3c18bbac012c6d" [[package]] name = "miniscript" -version = "5.1.0" +version = "6.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71f455be59a359d50370c4f587afbc5739c862e684c5afecae80ab93e7474b4e" +checksum = "d69450033bf162edf854d4aacaff82ca5ef34fa81f6cf69e1c81a103f0834997" dependencies = [ "bitcoin", "serde", @@ -2357,7 +2221,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2182a122f3b7f3f5329cb1972cee089ba2459a0a80a56935e6e674f096f8d839" dependencies = [ "libc", - "log 0.4.14", + "log", "miow", "ntapi", "winapi 0.3.9", @@ -2381,7 +2245,7 @@ dependencies = [ "base58-monero", "curve25519-dalek-ng", "fixed-hash", - "hex 0.4.3", + "hex", "hex-literal", "keccak-hash", "serde", @@ -2420,7 +2284,7 @@ version = "0.1.0" dependencies = [ "anyhow", "curve25519-dalek", - "hex 0.4.3", + "hex", "hex-literal", "jsonrpc_client 0.7.1", "monero", @@ -2459,11 +2323,11 @@ dependencies = [ "byteorder", "data-encoding", "multihash", - "percent-encoding 2.1.0", + "percent-encoding", "serde", "static_assertions", "unsigned-varint 0.7.0", - "url 2.2.2", + "url", ] [[package]] @@ -2506,7 +2370,7 @@ source = "git+https://github.com/comit-network/rust-libp2p?branch=rendezvous#4af dependencies = [ "bytes 1.0.1", "futures", - "log 0.4.14", + "log", "pin-project 1.0.5", "smallvec", "unsigned-varint 0.7.0", @@ -2526,7 +2390,7 @@ checksum = "ffb4262d26ed83a1c0a33a38fe2bb15797329c85770da05e6b828ddb782627af" dependencies = [ "lexical-core", "memchr", - "version_check 0.9.3", + "version_check", ] [[package]] @@ -2537,7 +2401,7 @@ checksum = "7ffd9d26838a953b4af82cbeb9f1592c6798916983959be223a7124e992742c1" dependencies = [ "memchr", "minimal-lexical", - "version_check 0.9.3", + "version_check", ] [[package]] @@ -2666,16 +2530,6 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28988d872ab76095a6e6ac88d99b54fd267702734fd7ffe610ca27f533ddb95a" -[[package]] -name = "parking_lot" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3a704eb390aafdc107b0e392f56a82b668e3a71366993b5340f5833fd62505e" -dependencies = [ - "lock_api 0.3.4", - "parking_lot_core 0.7.2", -] - [[package]] name = "parking_lot" version = "0.11.2" @@ -2683,22 +2537,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" dependencies = [ "instant", - "lock_api 0.4.5", - "parking_lot_core 0.8.5", -] - -[[package]] -name = "parking_lot_core" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d58c7c768d4ba344e3e8d72518ac13e259d7c7ade24167003b8488e10b6740a3" -dependencies = [ - "cfg-if 0.1.10", - "cloudabi", - "libc", - "redox_syscall 0.1.57", - "smallvec", - "winapi 0.3.9", + "lock_api", + "parking_lot_core", ] [[package]] @@ -2710,7 +2550,7 @@ dependencies = [ "cfg-if 1.0.0", "instant", "libc", - "redox_syscall 0.2.10", + "redox_syscall", "smallvec", "winapi 0.3.9", ] @@ -2726,12 +2566,6 @@ dependencies = [ "regex", ] -[[package]] -name = "percent-encoding" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" - [[package]] name = "percent-encoding" version = "2.1.0" @@ -2884,7 +2718,7 @@ dependencies = [ "proc-macro2", "quote", "syn", - "version_check 0.9.3", + "version_check", ] [[package]] @@ -2895,7 +2729,7 @@ checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ "proc-macro2", "quote", - "version_check 0.9.3", + "version_check", ] [[package]] @@ -2958,7 +2792,7 @@ dependencies = [ "bytes 1.0.1", "heck", "itertools 0.9.0", - "log 0.4.14", + "log", "multimap", "petgraph", "prost", @@ -3250,12 +3084,6 @@ dependencies = [ "rand_core 0.3.1", ] -[[package]] -name = "redox_syscall" -version = "0.1.57" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" - [[package]] name = "redox_syscall" version = "0.2.10" @@ -3272,7 +3100,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" dependencies = [ "getrandom 0.2.2", - "redox_syscall 0.2.10", + "redox_syscall", ] [[package]] @@ -3322,14 +3150,14 @@ dependencies = [ "futures-util", "http", "http-body", - "hyper 0.14.12", + "hyper", "hyper-rustls", "ipnet", "js-sys", "lazy_static", - "log 0.4.14", - "mime 0.3.16", - "percent-encoding 2.1.0", + "log", + "mime", + "percent-encoding", "pin-project-lite 0.2.6", "rustls 0.19.0", "serde", @@ -3338,7 +3166,7 @@ dependencies = [ "tokio", "tokio-rustls", "tokio-socks", - "url 2.2.2", + "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", @@ -3420,7 +3248,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b25a18b1bf7387f0145e7f8324e700805aade3842dd3db2e74e4cdeb4677c09e" dependencies = [ "base64 0.10.1", - "log 0.4.14", + "log", "ring", "sct", "webpki", @@ -3433,7 +3261,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "064fd21ff87c6e87ed4506e68beb42459caa4a0e2eb144932e6776768556980b" dependencies = [ "base64 0.13.0", - "log 0.4.14", + "log", "ring", "sct", "webpki", @@ -3486,12 +3314,6 @@ version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" -[[package]] -name = "safemem" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" - [[package]] name = "schannel" version = "0.1.19" @@ -3688,28 +3510,6 @@ dependencies = [ "syn", ] -[[package]] -name = "serial_test" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fef5f7c7434b2f2c598adc6f9494648a1e41274a75c0ba4056f680ae0c117fd6" -dependencies = [ - "lazy_static", - "parking_lot 0.10.2", - "serial_test_derive", -] - -[[package]] -name = "serial_test_derive" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d08338d8024b227c62bd68a12c7c9883f5c66780abaef15c550dc56f46ee6515" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "sha-1" version = "0.9.4" @@ -3824,8 +3624,8 @@ dependencies = [ "fs2", "fxhash", "libc", - "log 0.4.14", - "parking_lot 0.11.2", + "log", + "parking_lot", ] [[package]] @@ -3896,7 +3696,7 @@ dependencies = [ "flate2", "futures", "httparse", - "log 0.4.14", + "log", "rand 0.7.3", "sha-1", ] @@ -3958,15 +3758,15 @@ dependencies = [ "futures-intrusive", "futures-util", "hashlink", - "hex 0.4.3", + "hex", "itoa", "libc", "libsqlite3-sys", - "log 0.4.14", + "log", "memchr", "once_cell", - "parking_lot 0.11.2", - "percent-encoding 2.1.0", + "parking_lot", + "percent-encoding", "rustls 0.19.0", "serde", "sha2", @@ -3976,7 +3776,7 @@ dependencies = [ "stringprep", "thiserror", "tokio-stream", - "url 2.2.2", + "url", "webpki", "webpki-roots 0.21.0", "whoami", @@ -3992,7 +3792,7 @@ dependencies = [ "either", "futures", "heck", - "hex 0.4.3", + "hex", "once_cell", "proc-macro2", "quote", @@ -4002,7 +3802,7 @@ dependencies = [ "sqlx-core", "sqlx-rt", "syn", - "url 2.2.2", + "url", ] [[package]] @@ -4112,7 +3912,6 @@ dependencies = [ "backoff", "base64 0.13.0", "bdk", - "bdk-testutils", "big-bytes", "bitcoin", "bitcoin-harness", @@ -4128,11 +3927,10 @@ dependencies = [ "ed25519-dalek", "futures", "get-port", - "hex 0.4.3", - "hyper 0.14.12", + "hex", + "hyper", "itertools 0.10.1", "libp2p", - "miniscript", "monero", "monero-harness", "monero-rpc", @@ -4171,7 +3969,7 @@ dependencies = [ "tracing-appender", "tracing-futures", "tracing-subscriber", - "url 2.2.2", + "url", "uuid", "vergen", "void", @@ -4210,7 +4008,7 @@ dependencies = [ "cfg-if 1.0.0", "libc", "rand 0.8.3", - "redox_syscall 0.2.10", + "redox_syscall", "remove_dir_all", "winapi 0.3.9", ] @@ -4232,9 +4030,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "959ba8f27f326db356678cb5d6ac8a418f3cb9c1ad2d677c1fe8d3afb9056d46" dependencies = [ "derivative", - "hex 0.4.3", + "hex", "hmac 0.8.1", - "log 0.4.14", + "log", "rand 0.7.3", "serde", "serde_json", @@ -4247,9 +4045,9 @@ version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d5e3ed6e3598dbf32cba8cb356b881c085e0adea57597f387723430dd94b4084" dependencies = [ - "hex 0.4.3", + "hex", "hmac 0.10.1", - "log 0.4.14", + "log", "rand 0.8.3", "serde", "serde_json", @@ -4350,7 +4148,7 @@ dependencies = [ "mio", "num_cpus", "once_cell", - "parking_lot 0.11.2", + "parking_lot", "pin-project-lite 0.2.6", "signal-hook-registry", "tokio-macros", @@ -4411,7 +4209,7 @@ dependencies = [ "filetime", "futures-core", "libc", - "redox_syscall 0.2.10", + "redox_syscall", "tokio", "tokio-stream", "xattr", @@ -4424,7 +4222,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "511de3f85caf1c98983545490c3d09685fa8eb634e57eec22bb4db271f46cbd8" dependencies = [ "futures-util", - "log 0.4.14", + "log", "pin-project 1.0.5", "rustls 0.19.0", "tokio", @@ -4443,7 +4241,7 @@ dependencies = [ "bytes 1.0.1", "futures-core", "futures-sink", - "log 0.4.14", + "log", "pin-project-lite 0.2.6", "tokio", ] @@ -4467,7 +4265,7 @@ dependencies = [ "base64 0.13.0", "derive_more", "ed25519-dalek", - "hex 0.4.3", + "hex", "hmac 0.11.0", "rand 0.7.3", "sha2", @@ -4543,7 +4341,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a6923477a48e41c1951f1999ef8bb5a3023eb723ceadafe78ffb65dc366761e3" dependencies = [ "lazy_static", - "log 0.4.14", + "log", "tracing-core", ] @@ -4578,12 +4376,6 @@ dependencies = [ "tracing-serde", ] -[[package]] -name = "traitobject" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079" - [[package]] name = "trust-dns-proto" version = "0.20.1" @@ -4597,16 +4389,16 @@ dependencies = [ "futures-channel", "futures-io", "futures-util", - "idna 0.2.2", + "idna", "ipnet", "lazy_static", - "log 0.4.14", + "log", "rand 0.8.3", "smallvec", "thiserror", "tinyvec", "tokio", - "url 2.2.2", + "url", ] [[package]] @@ -4619,9 +4411,9 @@ dependencies = [ "futures-util", "ipconfig", "lazy_static", - "log 0.4.14", + "log", "lru-cache", - "parking_lot 0.11.2", + "parking_lot", "resolv-conf", "smallvec", "thiserror", @@ -4646,23 +4438,17 @@ dependencies = [ "bytes 1.0.1", "http", "httparse", - "log 0.4.14", + "log", "rand 0.8.3", "rustls 0.19.0", "rustls-native-certs", "sha-1", "thiserror", - "url 2.2.2", + "url", "utf-8", "webpki", ] -[[package]] -name = "typeable" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1410f6f91f21d1612654e7cc69193b0334f909dcf2c790c4826254fbb86f8887" - [[package]] name = "typenum" version = "1.13.0" @@ -4683,19 +4469,10 @@ checksum = "e11fe9a9348741cf134085ad57c249508345fe16411b3d7fb4ff2da2f1d6382e" dependencies = [ "byteorder", "crunchy", - "hex 0.4.3", + "hex", "static_assertions", ] -[[package]] -name = "unicase" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" -dependencies = [ - "version_check 0.1.5", -] - [[package]] name = "unicode-bidi" version = "0.3.4" @@ -4772,17 +4549,6 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" -[[package]] -name = "url" -version = "1.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" -dependencies = [ - "idna 0.1.5", - "matches", - "percent-encoding 1.0.1", -] - [[package]] name = "url" version = "2.2.2" @@ -4790,9 +4556,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" dependencies = [ "form_urlencoded", - "idna 0.2.2", + "idna", "matches", - "percent-encoding 2.1.0", + "percent-encoding", "serde", ] @@ -4840,12 +4606,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "version_check" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" - [[package]] name = "version_check" version = "0.9.3" @@ -4873,7 +4633,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" dependencies = [ - "log 0.4.14", + "log", "try-lock", ] @@ -4909,7 +4669,7 @@ checksum = "5b7d8b6942b8bb3a9b0e73fc79b98095a27de6fa247615e59d096754a3bc2aa8" dependencies = [ "bumpalo", "lazy_static", - "log 0.4.14", + "log", "proc-macro2", "quote", "syn", @@ -4965,7 +4725,7 @@ checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" dependencies = [ "futures", "js-sys", - "parking_lot 0.11.2", + "parking_lot", "pin-utils", "wasm-bindgen", "wasm-bindgen-futures", @@ -5125,9 +4885,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7d9028f208dd5e63c614be69f115c1b53cacc1111437d4c765185856666c107" dependencies = [ "futures", - "log 0.4.14", + "log", "nohash-hasher", - "parking_lot 0.11.2", + "parking_lot", "rand 0.8.3", "static_assertions", ] diff --git a/swap/Cargo.toml b/swap/Cargo.toml index 6a066938..d45933e2 100644 --- a/swap/Cargo.toml +++ b/swap/Cargo.toml @@ -15,9 +15,9 @@ async-trait = "0.1" atty = "0.2" backoff = { version = "0.3", features = [ "tokio" ] } base64 = "0.13" -bdk = "0.10" +bdk = "0.12" big-bytes = "1" -bitcoin = { version = "0.26", features = [ "rand", "use-serde" ] } +bitcoin = { version = "0.27", features = [ "rand", "use-serde" ] } bmrng = "0.5" comfy-table = "4.1.1" config = { version = "0.11", default-features = false, features = [ "toml" ] } @@ -32,7 +32,6 @@ futures = { version = "0.3", default-features = false } hex = "0.4" itertools = "0.10" libp2p = { git = "https://github.com/comit-network/rust-libp2p", branch = "rendezvous", default-features = false, features = [ "tcp-tokio", "yamux", "mplex", "dns-tokio", "noise", "request-response", "websocket", "ping", "rendezvous" ] } -miniscript = { version = "5", features = [ "serde" ] } monero = { version = "0.12", features = [ "serde_support" ] } monero-rpc = { path = "../monero-rpc" } pem = "0.8" @@ -76,7 +75,6 @@ tokio-tar = "0.3" zip = "0.5" [dev-dependencies] -bdk-testutils = { version = "0.4" } bitcoin-harness = { git = "https://github.com/coblox/bitcoin-harness-rs" } get-port = "3" hyper = "0.14" diff --git a/swap/src/bitcoin.rs b/swap/src/bitcoin.rs index 10953f6c..53fc5197 100644 --- a/swap/src/bitcoin.rs +++ b/swap/src/bitcoin.rs @@ -29,12 +29,12 @@ use ::bitcoin::hashes::hex::ToHex; use ::bitcoin::hashes::Hash; use ::bitcoin::{secp256k1, SigHash}; use anyhow::{bail, Context, Result}; +use bdk::miniscript::descriptor::Wsh; +use bdk::miniscript::{Descriptor, Segwitv0}; use ecdsa_fun::adaptor::{Adaptor, HashTranscript}; use ecdsa_fun::fun::Point; use ecdsa_fun::nonce::Deterministic; use ecdsa_fun::ECDSA; -use miniscript::descriptor::Wsh; -use miniscript::{Descriptor, Segwitv0}; use rand::{CryptoRng, RngCore}; use serde::{Deserialize, Serialize}; use sha2::Sha256; @@ -215,8 +215,9 @@ pub fn build_shared_output_descriptor(A: Point, B: Point) -> Descriptor::from_str(&miniscript) - .expect("a valid miniscript"); + let miniscript = + bdk::miniscript::Miniscript::::from_str(&miniscript) + .expect("a valid miniscript"); Descriptor::Wsh(Wsh::new(miniscript).expect("a valid descriptor")) } diff --git a/swap/src/bitcoin/cancel.rs b/swap/src/bitcoin/cancel.rs index 177d7e00..f3f13032 100644 --- a/swap/src/bitcoin/cancel.rs +++ b/swap/src/bitcoin/cancel.rs @@ -6,8 +6,8 @@ use crate::bitcoin::{ use ::bitcoin::util::bip143::SigHashCache; use ::bitcoin::{OutPoint, Script, SigHash, SigHashType, TxIn, TxOut, Txid}; use anyhow::Result; +use bdk::miniscript::{Descriptor, DescriptorTrait}; use ecdsa_fun::Signature; -use miniscript::{Descriptor, DescriptorTrait}; use serde::{Deserialize, Serialize}; use std::cmp::Ordering; use std::collections::HashMap; diff --git a/swap/src/bitcoin/lock.rs b/swap/src/bitcoin/lock.rs index 559ef1e4..ea6c5cdd 100644 --- a/swap/src/bitcoin/lock.rs +++ b/swap/src/bitcoin/lock.rs @@ -6,8 +6,8 @@ use ::bitcoin::util::psbt::PartiallySignedTransaction; use ::bitcoin::{OutPoint, TxIn, TxOut, Txid}; use anyhow::{bail, Result}; use bdk::database::BatchDatabase; +use bdk::miniscript::{Descriptor, DescriptorTrait}; use bitcoin::Script; -use miniscript::{Descriptor, DescriptorTrait}; use serde::{Deserialize, Serialize}; const SCRIPT_SIZE: usize = 34; diff --git a/swap/src/bitcoin/punish.rs b/swap/src/bitcoin/punish.rs index 674d93a2..fda37155 100644 --- a/swap/src/bitcoin/punish.rs +++ b/swap/src/bitcoin/punish.rs @@ -4,7 +4,7 @@ use ::bitcoin::util::bip143::SigHashCache; use ::bitcoin::{SigHash, SigHashType}; use anyhow::{Context, Result}; use bdk::bitcoin::Script; -use miniscript::{Descriptor, DescriptorTrait}; +use bdk::miniscript::{Descriptor, DescriptorTrait}; use std::collections::HashMap; #[derive(Debug)] diff --git a/swap/src/bitcoin/redeem.rs b/swap/src/bitcoin/redeem.rs index 39c237fb..a244b0cd 100644 --- a/swap/src/bitcoin/redeem.rs +++ b/swap/src/bitcoin/redeem.rs @@ -6,12 +6,12 @@ use crate::bitcoin::{ use ::bitcoin::util::bip143::SigHashCache; use ::bitcoin::{SigHash, SigHashType, Txid}; use anyhow::{bail, Context, Result}; +use bdk::miniscript::{Descriptor, DescriptorTrait}; use bitcoin::Script; use ecdsa_fun::adaptor::{Adaptor, HashTranscript}; use ecdsa_fun::fun::Scalar; use ecdsa_fun::nonce::Deterministic; use ecdsa_fun::Signature; -use miniscript::{Descriptor, DescriptorTrait}; use sha2::Sha256; use std::collections::HashMap; diff --git a/swap/src/bitcoin/refund.rs b/swap/src/bitcoin/refund.rs index a0f3dc64..6f6cade0 100644 --- a/swap/src/bitcoin/refund.rs +++ b/swap/src/bitcoin/refund.rs @@ -7,8 +7,8 @@ use crate::{bitcoin, monero}; use ::bitcoin::util::bip143::SigHashCache; use ::bitcoin::{Script, SigHash, SigHashType, Txid}; use anyhow::{bail, Context, Result}; +use bdk::miniscript::{Descriptor, DescriptorTrait}; use ecdsa_fun::Signature; -use miniscript::{Descriptor, DescriptorTrait}; use std::collections::HashMap; #[derive(Debug)] diff --git a/swap/src/bitcoin/wallet.rs b/swap/src/bitcoin/wallet.rs index fb746b10..c6b0d472 100644 --- a/swap/src/bitcoin/wallet.rs +++ b/swap/src/bitcoin/wallet.rs @@ -607,9 +607,7 @@ impl WalletBuilder { pub fn build(self) -> Wallet<(), bdk::database::MemoryDatabase, StaticFeeRate> { use bdk::database::MemoryDatabase; - use bdk::{ConfirmationTime, LocalUtxo, TransactionDetails}; - use bitcoin::OutPoint; - use testutils::testutils; + use bdk::testutils; let descriptors = testutils!(@descriptors (&format!("wpkh({}/*)", self.key)));