From 594082cb0a79675d36284b55a4ea075abd0afe57 Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Tue, 20 Aug 2024 00:08:33 +0200 Subject: [PATCH 01/10] chore: update dependencies --- Cargo.lock | 439 +++++++++++++++++++++++++++------------------------ Cargo.toml | 53 +++---- MANIFEST.yml | 2 +- 3 files changed, 251 insertions(+), 243 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e5b48c6..fca0cc6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -19,9 +19,9 @@ dependencies = [ [[package]] name = "aluvm" -version = "0.11.0-beta.6" +version = "0.11.0-beta.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97a05798f882593a692d1e05d2b650d8d19f6dd8b04a9a8d31f09fcf0d44d90a" +checksum = "1aaa9bf6c54f2d232adc6a9e748f359f1b4570d0a498f92e7823321ae7c656b5" dependencies = [ "amplify", "ascii-armor", @@ -40,9 +40,9 @@ dependencies = [ [[package]] name = "amplify" -version = "4.6.2" +version = "4.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8865957597bdcba8da49806e1280867df9621e88404edc1d156fc98fe8ae86c8" +checksum = "7147b742325842988dd6c793d55f58df3ae36bccf7d9b6e07db10ab035be343d" dependencies = [ "amplify_apfloat", "amplify_derive", @@ -171,9 +171,9 @@ checksum = "9d151e35f61089500b617991b791fc8bfd237ae50cd5950803758a179b41e67a" [[package]] name = "arrayvec" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "ascii" @@ -282,32 +282,16 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.72", + "syn 2.0.75", "which", ] -[[package]] -name = "bitcoin-io" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "340e09e8399c7bd8912f495af6aa58bea0c9214773417ffaa8f6460f93aaee56" - [[package]] name = "bitcoin-private" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73290177011694f38ec25e165d0387ab7ea749a4b81cd4c80dae5988229f7a57" -[[package]] -name = "bitcoin_hashes" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb18c03d0db0247e147a21a6faafd5a7eb851c743db062de72018b6b7e8e4d16" -dependencies = [ - "bitcoin-io", - "hex-conservative", -] - [[package]] name = "bitflags" version = "1.3.2" @@ -322,9 +306,9 @@ checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "blake3" -version = "1.5.3" +version = "1.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9ec96fe9a81b5e365f9db71fe00edc4fe4ca2cc7dcb7861f0603012a7caa210" +checksum = "d82033247fd8e890df8f740e407ad4d038debb9eb1f40533fffb32e7d17dc6f7" dependencies = [ "arrayref", "arrayvec", @@ -344,13 +328,14 @@ dependencies = [ [[package]] name = "bp-consensus" -version = "0.11.0-beta.6" -source = "git+https://github.com/BP-WG/bp-core?branch=master#1989b57875a33243070b387158f5061e5df5be49" +version = "0.11.0-beta.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d23ea438647522d1f1a8fc8fa1420cc56321433d5d5964636294991f18f9e0c9" dependencies = [ "amplify", "chrono", "commit_verify", - "secp256k1 0.29.0", + "secp256k1", "serde", "strict_encoding", "strict_types", @@ -358,9 +343,9 @@ dependencies = [ [[package]] name = "bp-core" -version = "0.11.0-beta.6" +version = "0.11.0-beta.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea9b90b2e6cfafc0e45dc0a856e9b45e933ab4147c576ca8c26f038ba8c97bb" +checksum = "b43a6b5389fd99298fca47f4566dda754fa10bdb41200b5cdfc16147400f5951" dependencies = [ "amplify", "bp-consensus", @@ -377,38 +362,40 @@ dependencies = [ [[package]] name = "bp-dbc" -version = "0.11.0-beta.6" +version = "0.11.0-beta.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec406f105bf1e421ead00b47e309901028d10de7033fe918445b089cf7505669" +checksum = "f0f70bd407dfcbeadfbc012959e04decbe63e7dc6f30a4f705b804b699b37a0a" dependencies = [ "amplify", "base85", "bp-consensus", "commit_verify", - "secp256k1 0.29.0", + "secp256k1", "serde", "strict_encoding", ] [[package]] name = "bp-derive" -version = "0.11.0-beta.6" -source = "git+https://github.com/BP-WG/bp-std?branch=master#b664d65aeec68b11b42fa55d6b82d0e66228a0be" +version = "0.11.0-beta.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5a1a38a6324920d6aa183245be6f13acde5aef1008b24fecf5f8e4036f33fe8" dependencies = [ "amplify", - "bitcoin_hashes", "bp-consensus", "bp-invoice", "commit_verify", - "indexmap 2.3.0", + "hmac", + "indexmap 2.4.0", "serde", + "sha2", ] [[package]] name = "bp-electrum" -version = "0.11.0-beta.6" +version = "0.11.0-beta.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21146e28b615c9b6f55b4af2240818ff218d823c6525b0572c673d1f3f0273fe" +checksum = "760cbe0955ad8b3531e113b9c7917ab78646b979a0c1a450ce3c6356c7bd80e5" dependencies = [ "amplify", "bp-std", @@ -419,15 +406,15 @@ dependencies = [ "serde", "serde_json", "sha2", - "webpki-roots 0.25.4", + "webpki-roots", "winapi", ] [[package]] name = "bp-esplora" -version = "0.11.0-beta.6" +version = "0.11.0-beta.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ffba40457f99cf5e7715858cdc743e05925686d23798b6b21221a4bb50b118" +checksum = "b894bcb5df729d67e0d2a802fabbf889ff41cf8820cd35a468df36ac407f3630" dependencies = [ "amplify", "bp-std", @@ -440,21 +427,22 @@ dependencies = [ [[package]] name = "bp-invoice" -version = "0.11.0-beta.6" -source = "git+https://github.com/BP-WG/bp-std?branch=master#b664d65aeec68b11b42fa55d6b82d0e66228a0be" +version = "0.11.0-beta.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddcb55fe081418fc6e508370eaf8431001274727862e57e6672b6c892b8d3d66" dependencies = [ "amplify", "bech32", - "bitcoin_hashes", "bp-consensus", + "commit_verify", "serde", ] [[package]] name = "bp-seals" -version = "0.11.0-beta.6" +version = "0.11.0-beta.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4f81b41d82e4138d4bcac17afbb421099c887e406947430131c14ba22abe45d" +checksum = "497bb5989b9b549cd8e4ebfabc50a5d57cf318ab56affd3d4d7b7749fcd780da" dependencies = [ "amplify", "baid64", @@ -469,23 +457,27 @@ dependencies = [ [[package]] name = "bp-std" -version = "0.11.0-beta.6" -source = "git+https://github.com/BP-WG/bp-std?branch=master#b664d65aeec68b11b42fa55d6b82d0e66228a0be" +version = "0.11.0-beta.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac66f7e326e203f228fd60f1fb1f5629f6ec20f37c61b580a627c3194e85d7fc" dependencies = [ "amplify", "bp-consensus", "bp-derive", "bp-invoice", "descriptors", + "getrandom", "psbt", - "secp256k1 0.29.0", + "secp256k1", "serde", + "wasm-bindgen", ] [[package]] name = "bp-wallet" -version = "0.11.0-beta.6.1" -source = "git+https://github.com/BP-WG/bp-wallet?branch=master#7d5105f6fd9103d25067a47e45616cdcc77737e9" +version = "0.11.0-beta.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced31423a2325a666532e92c1ca7ceff986eda9f147a241ba812e5ed2fee0eaf" dependencies = [ "amplify", "base64", @@ -521,12 +513,13 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "cc" -version = "1.1.7" +version = "1.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26a5c3fd7bfa1ce3897a3a3501d362b2d87b7f2583ebcb4a949ec25911025cbc" +checksum = "72db2f7947ecee9b03b510377e8bb9077afa27176fdbff55c51027e976fdcc48" dependencies = [ "jobserver", "libc", + "shlex", ] [[package]] @@ -572,9 +565,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.13" +version = "4.5.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fbb260a053428790f3de475e304ff84cdbc4face759ea7a3e64c1edd938a7fc" +checksum = "ed6719fffa43d0d87e5fd8caeab59be1554fb028cd30edc88fc4369b17971019" dependencies = [ "clap_builder", "clap_derive", @@ -582,9 +575,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.13" +version = "4.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64b17d7ea74e9f833c7dbf2cbe4fb12ff26783eda4782a8975b72f895c9b4d99" +checksum = "216aec2b177652e3846684cbfe25c9964d18ec45234f0f5da5157b207ed1aab6" dependencies = [ "anstream", "anstyle", @@ -598,10 +591,10 @@ version = "4.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" dependencies = [ - "heck 0.5.0", + "heck", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.75", ] [[package]] @@ -612,9 +605,9 @@ checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" [[package]] name = "cmake" -version = "0.1.50" +version = "0.1.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" +checksum = "fb1e43aa7fd152b1f968787f7dbcdeb306d1867ff373c69955211876c053f91a" dependencies = [ "cc", ] @@ -637,9 +630,9 @@ dependencies = [ [[package]] name = "commit_encoding_derive" -version = "0.11.0-beta.5" +version = "0.11.0-beta.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d660fdac917fb67edd1707bc9481e51ed9062ab4ba1c4e56ed7856977fff9f3" +checksum = "ca41bd14a6c400486463a5b0e7e8916b1c7bad554a382f62c3b11bd58dea5934" dependencies = [ "amplify", "amplify_syn", @@ -650,9 +643,9 @@ dependencies = [ [[package]] name = "commit_verify" -version = "0.11.0-beta.6" +version = "0.11.0-beta.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b350bc4d1c5992571e3323810921d0eb4a65a3171cbf06fd1b9d1249cf1c3339" +checksum = "538b69bbb2f7259c1d07334fa8adae0006c8b559efbdb6daafacb6df249b897b" dependencies = [ "amplify", "commit_encoding_derive", @@ -683,15 +676,15 @@ checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" [[package]] name = "core-foundation-sys" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.12" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "51e852e6dc9a5bed1fae92dd2375037bf2b768725bf3be87811edee3249d09ad" dependencies = [ "libc", ] @@ -742,7 +735,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.72", + "syn 2.0.75", ] [[package]] @@ -753,7 +746,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.72", + "syn 2.0.75", ] [[package]] @@ -768,12 +761,13 @@ dependencies = [ [[package]] name = "descriptors" -version = "0.11.0-beta.6" -source = "git+https://github.com/BP-WG/bp-std?branch=master#b664d65aeec68b11b42fa55d6b82d0e66228a0be" +version = "0.11.0-beta.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88b6883b7b23aedc5a2ff149a54b0f57496935be3fd4b453f0c76361b08f5649" dependencies = [ "amplify", "bp-derive", - "indexmap 2.3.0", + "indexmap 2.4.0", "serde", ] @@ -785,6 +779,7 @@ checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", "crypto-common", + "subtle", ] [[package]] @@ -810,9 +805,9 @@ dependencies = [ [[package]] name = "dunce" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" [[package]] name = "either" @@ -867,9 +862,9 @@ checksum = "27ea9bdb2356e5a92403cf23ac493f9b43bd71e4ffd0f800862b841dd723994c" [[package]] name = "flate2" -version = "1.0.30" +version = "1.0.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" +checksum = "7f211bbe8e69bbd0cfdea405084f128ae8b4aaa6b0b522fc8f2b009084797920" dependencies = [ "crc32fast", "miniz_oxide", @@ -956,12 +951,6 @@ version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - [[package]] name = "heck" version = "0.5.0" @@ -975,12 +964,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] -name = "hex-conservative" -version = "0.2.1" +name = "hmac" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5313b072ce3c597065a808dbf612c4c8e8590bdbf8b579508bf7a762c5eae6cd" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "arrayvec", + "digest", ] [[package]] @@ -1050,9 +1039,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.3.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3fc2e30ba82dd1b3911c8de1ffc143c74a914a14e99514d7637e3099df5ea0" +checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c" dependencies = [ "equivalent", "hashbrown 0.14.5", @@ -1091,9 +1080,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.69" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" dependencies = [ "wasm-bindgen", ] @@ -1112,9 +1101,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.155" +version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" [[package]] name = "libloading" @@ -1123,7 +1112,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" dependencies = [ "cfg-if", - "windows-targets 0.48.5", + "windows-targets 0.52.6", ] [[package]] @@ -1160,6 +1149,16 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" +[[package]] +name = "minicov" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c71e683cd655513b99affab7d317deb690528255a0d5f717f1024093c12b169" +dependencies = [ + "cc", + "walkdir", +] + [[package]] name = "minimal-lexical" version = "0.2.1" @@ -1244,9 +1243,9 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.18" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee4364d9f3b902ef14fab8a1ddffb783a1cb6b4bba3bfc1fa3922732c7de97f" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" dependencies = [ "zerocopy", ] @@ -1258,7 +1257,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" dependencies = [ "proc-macro2", - "syn 2.0.72", + "syn 2.0.75", ] [[package]] @@ -1272,8 +1271,9 @@ dependencies = [ [[package]] name = "psbt" -version = "0.11.0-beta.6" -source = "git+https://github.com/BP-WG/bp-std?branch=master#b664d65aeec68b11b42fa55d6b82d0e66228a0be" +version = "0.11.0-beta.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2afd0eef00260666da5c2c72e61c23bd2e07076e0791ea4cc3e79ab408246a17" dependencies = [ "amplify", "base64", @@ -1282,7 +1282,7 @@ dependencies = [ "chrono", "commit_verify", "descriptors", - "indexmap 2.3.0", + "indexmap 2.4.0", "serde", "strict_encoding", ] @@ -1328,9 +1328,9 @@ dependencies = [ [[package]] name = "redox_users" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ "getrandom", "libredox", @@ -1339,9 +1339,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.5" +version = "1.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" +checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" dependencies = [ "aho-corasick", "memchr", @@ -1368,8 +1368,9 @@ checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "rgb-core" -version = "0.11.0-beta.6" -source = "git+https://github.com/RGB-WG/rgb-core?branch=master#f47d1a33e189d8b88c869e39527c525f90aafda5" +version = "0.11.0-beta.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "243f1dcdf028b1cbadc9ed27866619feed0608eba0c84f59b344026648312731" dependencies = [ "aluvm", "amplify", @@ -1389,24 +1390,28 @@ dependencies = [ [[package]] name = "rgb-interfaces" -version = "0.11.0-beta.6" -source = "git+https://github.com/RGB-WG/rgb-interfaces.git?branch=master#eca2fa65d306b83e158b12957f6f72681b93c15f" +version = "0.11.0-beta.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcaa75b09d8f4d0f80f814d2edde1815bc22532b2e26b738797169e0a940d050" dependencies = [ "aluvm", "amplify", "bp-core", "chrono", + "getrandom", "rgb-std", "serde_json", "sha2", "strict_encoding", "strict_types", + "wasm-bindgen", ] [[package]] name = "rgb-invoice" -version = "0.11.0-beta.6" -source = "git+https://github.com/RGB-WG/rgb-std?branch=master#a90e556dc9fe8adb9584992c643318c68ff26a0f" +version = "0.11.0-beta.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d43cd206275a055440a8c496cb7b5040842d6a0e354d00df268bc635ee07b871" dependencies = [ "amplify", "baid64", @@ -1414,7 +1419,7 @@ dependencies = [ "bp-invoice", "fast32", "fluent-uri", - "indexmap 2.3.0", + "indexmap 2.4.0", "percent-encoding", "rand", "rgb-core", @@ -1425,7 +1430,7 @@ dependencies = [ [[package]] name = "rgb-psbt" -version = "0.11.0-beta.6" +version = "0.11.0-beta.7" dependencies = [ "amplify", "baid64", @@ -1443,7 +1448,7 @@ dependencies = [ [[package]] name = "rgb-runtime" -version = "0.11.0-beta.6" +version = "0.11.0-beta.7" dependencies = [ "amplify", "baid64", @@ -1455,7 +1460,7 @@ dependencies = [ "chrono", "commit_verify", "descriptors", - "indexmap 2.3.0", + "indexmap 2.4.0", "log", "rgb-psbt", "rgb-std", @@ -1466,8 +1471,9 @@ dependencies = [ [[package]] name = "rgb-std" -version = "0.11.0-beta.6" -source = "git+https://github.com/RGB-WG/rgb-std?branch=master#a90e556dc9fe8adb9584992c643318c68ff26a0f" +version = "0.11.0-beta.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c66b8810d29c080f3ee5046bd9dda7b42ab2321e09dd914bc9a4702b4731f15c" dependencies = [ "aluvm", "amplify", @@ -1478,7 +1484,7 @@ dependencies = [ "chrono", "commit_verify", "getrandom", - "indexmap 2.3.0", + "indexmap 2.4.0", "rand", "rgb-core", "rgb-invoice", @@ -1490,7 +1496,7 @@ dependencies = [ [[package]] name = "rgb-wallet" -version = "0.11.0-beta.6" +version = "0.11.0-beta.7" dependencies = [ "amplify", "baid64", @@ -1574,9 +1580,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" +checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" [[package]] name = "rustls-webpki" @@ -1597,21 +1603,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] -name = "scoped-tls" -version = "1.0.1" +name = "same-file" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] [[package]] -name = "secp256k1" -version = "0.28.2" +name = "scoped-tls" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d24b59d129cdadea20aea4fb2352fa053712e5d713eee47d700cd4b2bc002f10" -dependencies = [ - "rand", - "secp256k1-sys 0.9.2", - "serde", -] +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" [[package]] name = "secp256k1" @@ -1620,19 +1624,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e0cc0f1cf93f4969faf3ea1c7d8a9faed25918d96affa959720823dfe86d4f3" dependencies = [ "rand", - "secp256k1-sys 0.10.0", + "secp256k1-sys", "serde", ] -[[package]] -name = "secp256k1-sys" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d1746aae42c19d583c3c1a8c646bfad910498e2051c551a7f2e3c0c9fbb7eb" -dependencies = [ - "cc", -] - [[package]] name = "secp256k1-sys" version = "0.10.0" @@ -1644,52 +1639,52 @@ dependencies = [ [[package]] name = "secp256k1-zkp" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4e48ef9c98bfbcb98bd15693ffa19676cb3e29426b75eda8b73c05cdd7959f8" +checksum = "52a44aed3002b5ae975f8624c5df3a949cfbf00479e18778b6058fcd213b76e3" dependencies = [ "bitcoin-private", "rand", - "secp256k1 0.28.2", + "secp256k1", "secp256k1-zkp-sys", "serde", ] [[package]] name = "secp256k1-zkp-sys" -version = "0.9.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ead52f43074bae2ddbd1e0e66e6b170135e76117f5ea9916f33d7bd0b36e29" +checksum = "8c6eea7919e0cab992510edfbf40bd9342c0a3c2bb910f2c51355c2cb2d69839" dependencies = [ "cc", - "secp256k1-sys 0.9.2", + "secp256k1-sys", ] [[package]] name = "serde" -version = "1.0.204" +version = "1.0.208" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" +checksum = "cff085d2cb684faa248efb494c39b68e522822ac0de72ccf08109abde717cfb2" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.204" +version = "1.0.208" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" +checksum = "24008e81ff7613ed8e5ba0cfaf24e2c2f1e5b8a0495711e44fcd4882fca62bcf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.75", ] [[package]] name = "serde_json" -version = "1.0.122" +version = "1.0.125" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784b6203951c57ff748476b126ccb5e8e2959a5c19e5c617ab1956be3dbc68da" +checksum = "83c8e735a073ccf5be70aa8066aa984eaf2fa000db6c8d0100ae605b366d31ed" dependencies = [ "itoa", "memchr", @@ -1726,7 +1721,7 @@ dependencies = [ "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.3.0", + "indexmap 2.4.0", "serde", "serde_derive", "serde_json", @@ -1743,7 +1738,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.75", ] [[package]] @@ -1752,7 +1747,7 @@ version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.3.0", + "indexmap 2.4.0", "itoa", "ryu", "serde", @@ -1787,9 +1782,9 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "single_use_seals" -version = "0.11.0-beta.6" +version = "0.11.0-beta.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55367b3a0d642ee289fec6781fda0b527a35d45511a04bb4cd19fa315c441b77" +checksum = "66c34b7d0a73e5b821f2647331b1303463ce58c51b32f54b006f0e7bb3edcd8a" dependencies = [ "amplify_derive", ] @@ -1813,24 +1808,25 @@ checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" [[package]] name = "strict_encoding" -version = "2.7.0-beta.4" +version = "2.7.0-rc.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2854135bbecf01fac5bae609ec3408e130259670424e2cd755660556d239c92" +checksum = "662b8c3ff360ff33370e6875dd5bdcbf3cecc992241f30e5f7071227ef693451" dependencies = [ "amplify", "half", "serde", "strict_encoding_derive", + "wasm-bindgen", ] [[package]] name = "strict_encoding_derive" -version = "2.7.0-beta.3" +version = "2.7.0-rc.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "475fa6f1fdde6e0555422b5111ad34bde30a1459af3599f920c3af9829772c0e" +checksum = "0ad171ee0ac09497f5f87d90bb36acc21992fb58f3565ad8c2663160c07c306d" dependencies = [ "amplify_syn", - "heck 0.4.1", + "heck", "proc-macro2", "quote", "syn 1.0.109", @@ -1838,15 +1834,15 @@ dependencies = [ [[package]] name = "strict_types" -version = "2.7.0-beta.4" +version = "2.7.0-rc.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7a5479921604482fd8775ec07fbb9075c92e12649358d1f70dc9552783d0d1e" +checksum = "e6e182f593e9c4f02ccfcea7929bef866cff12a3f8e213338ce48a706bb263c1" dependencies = [ "amplify", "ascii-armor", "baid64", "half", - "indexmap 2.3.0", + "indexmap 2.4.0", "serde", "serde_json", "serde_yaml", @@ -1854,6 +1850,7 @@ dependencies = [ "strict_encoding", "toml", "vesper-lang", + "wasm-bindgen", ] [[package]] @@ -1891,9 +1888,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.72" +version = "2.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" +checksum = "f6af063034fc1935ede7be0122941bafa9bacb949334d090b77ca98b5817c7d9" dependencies = [ "proc-macro2", "quote", @@ -1917,7 +1914,7 @@ checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.75", ] [[package]] @@ -1993,7 +1990,7 @@ version = "0.22.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" dependencies = [ - "indexmap 2.3.0", + "indexmap 2.4.0", "serde", "serde_spanned", "toml_datetime", @@ -2041,9 +2038,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "ureq" -version = "2.10.0" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72139d247e5f97a3eff96229a7ae85ead5328a39efe76f8bf5a06313d505b6ea" +checksum = "b74fc6b57825be3373f7054754755f03ac3a8f5d70015ccad699ba2029956f4a" dependencies = [ "base64", "flate2", @@ -2055,7 +2052,7 @@ dependencies = [ "serde_json", "socks", "url", - "webpki-roots 0.26.3", + "webpki-roots", ] [[package]] @@ -2091,6 +2088,16 @@ dependencies = [ "strict_encoding", ] +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -2099,34 +2106,35 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" dependencies = [ "cfg-if", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.75", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.42" +version = "0.4.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" dependencies = [ "cfg-if", "js-sys", @@ -2136,9 +2144,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2146,31 +2154,32 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.75", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" [[package]] name = "wasm-bindgen-test" -version = "0.3.42" +version = "0.3.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9bf62a58e0780af3e852044583deee40983e5886da43a271dd772379987667b" +checksum = "68497a05fb21143a08a7d24fc81763384a3072ee43c44e86aad1744d6adef9d9" dependencies = [ "console_error_panic_hook", "js-sys", + "minicov", "scoped-tls", "wasm-bindgen", "wasm-bindgen-futures", @@ -2179,31 +2188,25 @@ dependencies = [ [[package]] name = "wasm-bindgen-test-macro" -version = "0.3.42" +version = "0.3.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7f89739351a2e03cb94beb799d47fb2cac01759b40ec441f7de39b00cbf7ef0" +checksum = "4b8220be1fa9e4c889b30fd207d4906657e7e90b12e0e6b0c8b8d8709f5de021" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.75", ] [[package]] name = "web-sys" -version = "0.3.69" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" dependencies = [ "js-sys", "wasm-bindgen", ] -[[package]] -name = "webpki-roots" -version = "0.25.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" - [[package]] name = "webpki-roots" version = "0.26.3" @@ -2241,6 +2244,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +[[package]] +name = "winapi-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +dependencies = [ + "windows-sys 0.59.0", +] + [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -2274,6 +2286,15 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + [[package]] name = "windows-targets" version = "0.48.5" @@ -2406,9 +2427,9 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.6.6" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "854e949ac82d619ee9a14c66a1b674ac730422372ccb759ce0c39cabcf2bf8e6" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ "byteorder", "zerocopy-derive", @@ -2416,13 +2437,13 @@ dependencies = [ [[package]] name = "zerocopy-derive" -version = "0.6.6" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "125139de3f6b9d625c39e2efdd73d41bdac468ccd556556440e322be0e1bbd91" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.75", ] [[package]] @@ -2442,5 +2463,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.75", ] diff --git a/Cargo.toml b/Cargo.toml index 18d592c..f56beda 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,35 +10,35 @@ default-members = [ ] [workspace.package] -version = "0.11.0-beta.6" +version = "0.11.0-beta.7" keywords = ["bitcoin", "lightning", "rgb", "smart-contracts", "lnp-bp"] categories = ["cryptography::cryptocurrencies"] authors = ["Dr Maxim Orlovsky "] -homepage = "https://lnp-bp.org" +homepage = "https://rgb.tech" repository = "https://github.com/RGB-WG/rgb" -rust-version = "1.75.0" +rust-version = "1.76.0" edition = "2021" license = "Apache-2.0" [workspace.dependencies] -amplify = "4.6.2" +amplify = "4.7.0" baid64 = "0.2.2" -strict_encoding = "2.7.0-beta.4" -strict_types = "2.7.0-beta.4" -commit_verify = "0.11.0-beta.6" -bp-core = "0.11.0-beta.6" -bp-seals = "0.11.0-beta.6" -bp-std = "0.11.0-beta.6" -bp-electrum = "0.11.0-beta.6" -bp-esplora = { version = "0.11.0-beta.6", default-features = false, features = ["blocking"] } -descriptors = "0.11.0-beta.6" -psbt = { version = "0.11.0-beta.6", features = ["client-side-validation"] } -bp-wallet = { version = "0.11.0-beta.6.1" } -rgb-std = { version = "0.11.0-beta.6" } -rgb-psbt = { version = "0.11.0-beta.6", path = "psbt" } -rgb-interfaces = "0.11.0-beta.6" -indexmap = "2.0.2" -chrono = "0.4.31" +strict_encoding = "2.7.0-rc.1" +strict_types = "2.7.0-rc.1" +commit_verify = "0.11.0-beta.7" +bp-core = "0.11.0-beta.7" +bp-seals = "0.11.0-beta.7" +bp-std = "0.11.0-beta.7" +bp-electrum = "0.11.0-beta.7" +bp-esplora = { version = "0.11.0-beta.7", default-features = false, features = ["blocking"] } +descriptors = "0.11.0-beta.7" +psbt = { version = "0.11.0-beta.7", features = ["client-side-validation"] } +bp-wallet = { version = "0.11.0-beta.7" } +rgb-std = { version = "0.11.0-beta.7" } +rgb-psbt = { version = "0.11.0-beta.7", path = "psbt" } +rgb-interfaces = "0.11.0-beta.7" +indexmap = "2.4.0" +chrono = "0.4.38" serde_crate = { package = "serde", version = "1", features = ["derive"] } serde_yaml = "0.9.19" log = { version = "0.4", features = ["max_level_trace", "release_max_level_debug"] } @@ -92,16 +92,3 @@ mempool_blocking = ["esplora_blocking"] [package.metadata.docs.rs] features = ["all"] - -[patch.crates-io] -bp-consensus = { git = "https://github.com/BP-WG/bp-core", branch = "master" } -bp-derive = { git = "https://github.com/BP-WG/bp-std", branch = "master" } -bp-invoice = { git = "https://github.com/BP-WG/bp-std", branch = "master" } -descriptors = { git = "https://github.com/BP-WG/bp-std", branch = "master" } -psbt = { git = "https://github.com/BP-WG/bp-std", branch = "master" } -bp-std = { git = "https://github.com/BP-WG/bp-std", branch = "master" } -bp-wallet = { git = "https://github.com/BP-WG/bp-wallet", branch = "master" } -rgb-core = { git = "https://github.com/RGB-WG/rgb-core", branch = "master" } -rgb-invoice = { git = "https://github.com/RGB-WG/rgb-std", branch = "master" } -rgb-std = { git = "https://github.com/RGB-WG/rgb-std", branch = "master" } -rgb-interfaces = { git = "https://github.com/RGB-WG/rgb-interfaces.git", branch = "master" } diff --git a/MANIFEST.yml b/MANIFEST.yml index 4d6c120..0cf78b4 100644 --- a/MANIFEST.yml +++ b/MANIFEST.yml @@ -3,7 +3,7 @@ Type: Binary Kind: Free software License: Apache-2.0 Language: Rust -Compiler: 1.75 +Compiler: 1.76 Author: Maxim Orlovsky Maintained: LNP/BP Standards Association, Switzerland Maintainers: From e2733780cc0af313f016cb9a6b304df7e6f8bb6a Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Tue, 20 Aug 2024 12:29:59 +0200 Subject: [PATCH 02/10] pay: return PSBT back on error --- src/errors.rs | 7 ++++--- src/pay.rs | 5 ++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/errors.rs b/src/errors.rs index bd9aabc..d2b4d42 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -25,6 +25,7 @@ use std::convert::Infallible; use std::io; use amplify::IoError; +use bpstd::Psbt; use psrgbt::{CommitError, ConstructionError, EmbedError, TapretKeyError}; use rgbstd::containers::LoadError; use rgbstd::interface::{BuilderError, ContractError}; @@ -124,13 +125,13 @@ pub enum HistoryError { } #[derive(Debug, Display, Error, From)] -#[display(inner)] pub enum PayError { #[from] + #[display(inner)] Composition(CompositionError), - #[from] - Completion(CompletionError), + #[display("{0}")] + Completion(CompletionError, Psbt), } #[derive(Debug, Display, Error, From)] diff --git a/src/pay.rs b/src/pay.rs index 41ed0a3..b2eb19c 100644 --- a/src/pay.rs +++ b/src/pay.rs @@ -118,7 +118,10 @@ where Self::Descr: DescriptorRgb ) -> Result<(Psbt, PsbtMeta, Transfer), PayError> { let (mut psbt, meta) = self.construct_psbt_rgb(stock, invoice, params)?; // ... here we pass PSBT around signers, if necessary - let transfer = self.transfer(stock, invoice, &mut psbt)?; + let transfer = match self.transfer(stock, invoice, &mut psbt) { + Ok(transfer) => transfer, + Err(e) => return Err(PayError::Completion(e, psbt)), + }; Ok((psbt, meta, transfer)) } From 6ba314856e673f1457b0199ffdd0d99e1b452fc7 Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Tue, 20 Aug 2024 12:30:59 +0200 Subject: [PATCH 03/10] chore: modernize rustfmt --- .rustfmt.toml | 7 +++---- cli/src/command.rs | 6 +----- psbt/src/rgb.rs | 10 +++------- src/pay.rs | 4 +++- 4 files changed, 10 insertions(+), 17 deletions(-) diff --git a/.rustfmt.toml b/.rustfmt.toml index de9c4d6..9017cd7 100644 --- a/.rustfmt.toml +++ b/.rustfmt.toml @@ -4,10 +4,12 @@ version = "Two" max_width = 100 array_width = 100 attr_fn_like_width = 100 +comment_width = 100 fn_call_width = 100 +single_line_if_else_max_width = 100 -format_code_in_doc_comments = true fn_single_line = true +format_code_in_doc_comments = true format_macro_matchers = true format_macro_bodies = true format_strings = true @@ -19,9 +21,6 @@ use_try_shorthand = true wrap_comments = true where_single_line = true unstable_features = true -empty_item_single_line = true - -binop_separator = "Back" imports_granularity = "Module" group_imports = "StdExternalCrate" diff --git a/cli/src/command.rs b/cli/src/command.rs index 1a089d1..412a04a 100644 --- a/cli/src/command.rs +++ b/cli/src/command.rs @@ -384,11 +384,7 @@ impl Exec for RgbArgs { (op.payers.first(), op.payers.len().saturating_sub(1)) } }; - let more = if more > 0 { - format!(" (+{more})") - } else { - s!("") - }; + let more = if more > 0 { format!(" (+{more})") } else { s!("") }; let cparty = cparty .map(XOutputSeal::to_string) .unwrap_or_else(|| s!("none")); diff --git a/psbt/src/rgb.rs b/psbt/src/rgb.rs index 3029acb..a50a49b 100644 --- a/psbt/src/rgb.rs +++ b/psbt/src/rgb.rs @@ -221,8 +221,8 @@ impl RgbExt for Psbt { .proprietary .keys() .filter(|prop_key| { - prop_key.identifier == PSBT_RGB_PREFIX && - prop_key.subtype == PSBT_IN_RGB_CONSUMED_BY + prop_key.identifier == PSBT_RGB_PREFIX + && prop_key.subtype == PSBT_IN_RGB_CONSUMED_BY }) .map(|prop_key| prop_key.data.as_slice()) .map(ContractId::copy_from_slice) @@ -416,11 +416,7 @@ pub trait RgbOutExt { impl RgbOutExt for psbt::Output { fn rgb_velocity_hint(&self) -> Option { let data = self.proprietary.get(&PropKey::rgb_out_velocity_hint())?; - if data.len() != 1 { - None - } else { - data.first().map(VelocityHint::with_value) - } + if data.len() != 1 { None } else { data.first().map(VelocityHint::with_value) } } fn set_rgb_velocity_hint(&mut self, hint: VelocityHint) -> bool { diff --git a/src/pay.rs b/src/pay.rs index b2eb19c..d2d82b6 100644 --- a/src/pay.rs +++ b/src/pay.rs @@ -348,7 +348,9 @@ where Self::Descr: DescriptorRgb impl> WalletProvider for Wallet where Wallet: Save { - type Filter<'a> = WalletWrapper<'a, K, D> where Self: 'a; + type Filter<'a> = WalletWrapper<'a, K, D> + where + Self: 'a; fn filter(&self) -> Self::Filter<'_> { WalletWrapper(self) } fn descriptor_mut(&mut self, f: impl FnOnce(&mut WalletDescr) -> R) -> R { self.descriptor_mut(f) From 3bbbdd035f10b7b0c62b7d85b74234fd02d8d9dd Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Tue, 20 Aug 2024 13:28:27 +0200 Subject: [PATCH 04/10] cli: fix use of -h argument --- cli/src/args.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cli/src/args.rs b/cli/src/args.rs index a027e6d..29a47ad 100644 --- a/cli/src/args.rs +++ b/cli/src/args.rs @@ -72,7 +72,7 @@ pub struct RgbArgs { /// Specify blockchain height starting from which witness transactions /// should be checked for re-orgs - #[clap(short = 'h', long, requires = "sync")] + #[clap(short = 'H', long, requires = "sync")] pub from_height: Option, } @@ -94,7 +94,7 @@ impl Default for RgbArgs { impl RgbArgs { pub(crate) fn load_stock( &self, - stock_path: impl ToOwned, + stock_path: impl ToOwned, ) -> Result { let stock_path = stock_path.to_owned(); @@ -110,7 +110,7 @@ impl RgbArgs { fs::create_dir_all(&stock_path)?; let stock = Stock::new(stock_path.to_owned()); stock.store()?; - return Ok(stock) + return Ok(stock); } eprintln!("stock file is damaged, failing"); Err(err) @@ -173,7 +173,7 @@ impl RgbArgs { _ => Err(s!(" - error: no transaction resolver is specified; use either \ --esplora --mempool or --electrum argument")), } - .map_err(WalletError::Resolver)?; + .map_err(WalletError::Resolver)?; resolver.check(self.general.network)?; Ok(resolver) } From 538d3177de03cb9e9ea3d159040dcd620a8b9c6f Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Tue, 20 Aug 2024 16:15:21 +0200 Subject: [PATCH 05/10] chore --- Cargo.lock | 16 ++++++++-------- README.md | 39 +++++++++++++++++++++++---------------- cli/Cargo.toml | 8 ++++---- 3 files changed, 35 insertions(+), 28 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fca0cc6..3d58076 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3,10 +3,10 @@ version = 3 [[package]] -name = "adler" -version = "1.0.2" +name = "adler2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" [[package]] name = "aho-corasick" @@ -862,9 +862,9 @@ checksum = "27ea9bdb2356e5a92403cf23ac493f9b43bd71e4ffd0f800862b841dd723994c" [[package]] name = "flate2" -version = "1.0.31" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f211bbe8e69bbd0cfdea405084f128ae8b4aaa6b0b522fc8f2b009084797920" +checksum = "9c0596c1eac1f9e04ed902702e9878208b336edc9d6fddc8a48387349bab3666" dependencies = [ "crc32fast", "miniz_oxide", @@ -1167,11 +1167,11 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.4" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" dependencies = [ - "adler", + "adler2", ] [[package]] diff --git a/README.md b/README.md index 5ab5aec..9b322f0 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,24 @@ -# RGB smart contracts +# RGB smart contracts ![Build](https://github.com/RGB-WG/rgb/workflows/Build/badge.svg) ![Tests](https://github.com/RGB-WG/rgb/workflows/Tests/badge.svg) ![Lints](https://github.com/RGB-WG/rgb/workflows/Lints/badge.svg) [![codecov](https://codecov.io/gh/RGB-WG/rgb/branch/master/graph/badge.svg)](https://codecov.io/gh/RGB-WG/rgb) -[![crates.io](https://img.shields.io/crates/v/rgb-contracts)](https://crates.io/crates/rgb-contracts) -[![Docs](https://docs.rs/rgb-contracts/badge.svg)](https://docs.rs/rgb-contracts) +[![crates.io](https://img.shields.io/crates/v/rgb-wallet)](https://crates.io/crates/rgb-wallet) +[![Docs](https://docs.rs/rgb-wallet/badge.svg)](https://docs.rs/rgb-wallet) [![unsafe forbidden](https://img.shields.io/badge/unsafe-forbidden-success.svg)](https://github.com/rust-secure-code/safety-dance/) -[![Apache-2 licensed](https://img.shields.io/crates/l/rgb-contracts)](./LICENSE) +[![Apache-2 licensed](https://img.shields.io/crates/l/rgb-wallet)](./LICENSE) RGB is confidential & scalable client-validated smart contracts for Bitcoin & -Lightning. It embraces the concepts of private & mutual ownership, abstraction -and separation of concerns and represents "post-blockchain", Turing-complete -form of trustless distributed computing which does not require introduction of +Lightning. It embraces the concepts of private & mutual ownership, abstraction +and separation of concerns and represents "post-blockchain", Turing-complete +form of trustless distributed computing which does not require introduction of "tokens". To learn more about RGB please check [RGB black paper][Blackpaper] and [RGB Tech] websites. -This repository provides client-facing library which can be used by desktop -apps and mobile wallets for integrating RGB support. It also provides binary +This repository provides client-facing library which can be used by desktop +apps and mobile wallets for integrating RGB support. It also provides binary `rgb` which runs in the command-line and exposes all RGB functionality locally, requiring only Electrum server. @@ -29,7 +29,6 @@ by [Dr Maxim Orlovsky][Max] basing or earlier ideas of client-side-validation and RGB as "assets for bitcoin and LN" by [Peter Todd][Todd] and [Giacomo Zucco][Zucco]. - ## Installing First, you need to install [cargo](https://doc.rust-lang.org/cargo/). @@ -48,41 +47,49 @@ Next, you need to install developer components, which are OS-specific: brew install cmake pkg-config ``` -* Windows: download and install the latest [Build Tools for Visual Studio](https://aka.ms/vs/17/release/vs_BuildTools.exe), including the 'Desktop development with C++' workflow and recommended optional features +* Windows: download and install the + latest [Build Tools for Visual Studio](https://aka.ms/vs/17/release/vs_BuildTools.exe), including the 'Desktop + development with C++' workflow and recommended optional features Finally, install RGB command-line utility shipped with this repo by running + ``` cargo install rgb-wallet ``` To use the library from other rust code add dependency to the `Cargo.toml` file: + ```toml [dependencies] -rgb-std = "0.11.0-beta.3" # use the latest version -rgb-runtime = "0.11.0-beta.1" # use the latest version +rgb-std = "0.11.0-beta.7" # use the latest version +rgb-runtime = "0.11.0-beta.7" # use the latest version ``` - ## Using command-line - ## Contributing Altcoins and "blockchains" other than Bitcoin blockchain/Bitcoin protocols are not supported and not planned to be supported; pull requests targeting them will be declined. - ## License See [LICENCE](LICENSE) file. [Association]: https://lnp-bp.org + [Blackpaper]: https://blackpaper.rgb.tech + [RGB Tech]: https://rgb.tech + [FAQ]: https://rgbfaq.com + [Max]: https://github.com/dr-orlovsky + [Todd]: https://petertodd.org/ + [Zucco]: https://giacomozucco.com/ + [VS]: https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170 diff --git a/cli/Cargo.toml b/cli/Cargo.toml index b1887ff..1b69954 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -29,13 +29,13 @@ rgb-std = { workspace = true, features = ["serde"] } rgb-interfaces = { workspace = true } rgb-runtime = { version = "0.11.0-beta.6", path = "..", features = ["electrum_blocking", "esplora_blocking", "log", "serde", "fs", "cli"] } log = { workspace = true } -env_logger = "0.11.3" -clap = { version = "4.4.8", features = ["derive", "env"] } +env_logger = "0.11.5" +clap = { version = "4.5.16", features = ["derive", "env"] } shellexpand = "3.1.0" serde_crate = { workspace = true } serde_yaml = { workspace = true } -serde_json = "1.0.108" -toml = "0.8.8" +serde_json = "1.0.125" +toml = "0.8.19" [features] default = [] From ef448ef8d4db711f499ce4b95880ab826d76fa83 Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Tue, 20 Aug 2024 16:19:58 +0200 Subject: [PATCH 06/10] ci: modernize workflows --- .github/workflows/build.yml | 87 ++++++++++------------------ .github/workflows/codecov.yml | 41 +++++++------ .github/workflows/lint.yml | 38 +++++++----- .github/workflows/test.yml | 31 ++++++++-- Cargo.toml | 2 +- Dockerfile | 2 +- cli/Cargo.toml | 2 +- flake.lock | 106 ---------------------------------- flake.nix | 98 ------------------------------- 9 files changed, 105 insertions(+), 302 deletions(-) delete mode 100644 flake.lock delete mode 100644 flake.nix diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e17afd4..ec17ca2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,95 +2,72 @@ name: Build on: push: - branches: [ master ] + branches: + - master + tags: + - 'v[0-9]+\.*' pull_request: - branches: [ master ] + branches: + - master + - develop + - 'v[0-9]+.[0-9]+' env: CARGO_TERM_COLOR: always jobs: - cli: - runs-on: ubuntu-latest - strategy: - fail-fast: false - steps: - - name: checkout - uses: actions/checkout@v4 - - name: Install Nix - uses: cachix/install-nix-action@v26 - - name: Check rgb-wallet - run: nix run .#rgb -- -V | grep rgb-wallet default: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - # NOTE: Dont use nix here everything should be based on the ubuntu-latest - - name: Install rust stable - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - name: Latest Ubuntu build check - uses: actions-rs/cargo@v1 - with: - command: check - args: --workspace + - uses: dtolnay/rust-toolchain@stable + - run: cargo check --workspace no-default: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Install Nix - uses: cachix/install-nix-action@v26 - - name: Latest Ubuntu build check no features - run: nix develop .#stable -c cargo check --workspace --no-default-features + - uses: dtolnay/rust-toolchain@stable + - run: cargo check --workspace --no-default-features features: runs-on: ubuntu-latest strategy: fail-fast: false matrix: feature: + - fs + - cli - esplora_blocking - - log + - electrum_blocking + - mempool_blocking - serde steps: - uses: actions/checkout@v4 - - uses: actions/checkout@v4 - - name: Install Nix - uses: cachix/install-nix-action@v26 - - name: Check feature ${{ matrix.feature }} only - run: nix develop .#stable -c cargo check --no-default-features --features=${{ matrix.feature }} - - name: Check feature ${{ matrix.feature }} with defaults - run: nix develop .#stable -c cargo check --features=${{ matrix.feature }} + - uses: dtolnay/rust-toolchain@stable + - name: Feature ${{matrix.feature}} + run: cargo check --workspace --no-default-features --features=${{matrix.feature}} + - name: Feature ${{matrix.feature}} + run: cargo check --workspace --features=${{matrix.feature}} platforms: runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ ubuntu-20.04, ubuntu-22.04, macos-11, macos-12, windows-2019, windows-2022 ] + os: [ ubuntu-22.04, ubuntu-latest, macos-13, macos-latest, windows-2019, windows-latest ] steps: - uses: actions/checkout@v4 - # NOTE: Dont use nix in platform checks everything should based on the host system - - name: Install rust stable - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - name: Build with all features - uses: actions-rs/cargo@v1 - with: - command: check - args: --workspace --all-targets --all-features + - uses: dtolnay/rust-toolchain@stable + - name: Platform ${{matrix.os}} + run: cargo check --workspace --all-features # we skip test targets here to be sure that the main library can be built toolchains: runs-on: ubuntu-latest strategy: fail-fast: false matrix: - toolchain: [ nightly, beta, stable, msrv ] + toolchain: [ nightly, beta, stable, 1.76.0 ] steps: - - name: checkout - uses: actions/checkout@v4 - - name: Install Nix - uses: cachix/install-nix-action@v26 - - name: Check rgb - run: nix develop ".#${{ matrix.toolchain }}" -c cargo check --workspace --all-targets --all-features + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{matrix.toolchain}} + - name: Toolchain ${{matrix.toolchain}} + run: cargo +${{matrix.toolchain}} check --workspace --all-targets --all-features diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index cbb6d3a..3711d7a 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -2,9 +2,15 @@ name: Codecov on: push: - branches: [ master ] + branches: + - master + tags: + - 'v[0-9]+\.*' pull_request: - branches: [ master ] + branches: + - master + - develop + - 'v[0-9]+.[0-9]+' env: CARGO_TERM_COLOR: always @@ -14,22 +20,21 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Install Nix - uses: cachix/install-nix-action@v26 - - name: Build - run: nix develop .#codecov -c cargo build --release - - name: Test - run: nix develop .#codecov -c cargo test --all-features --no-fail-fast --tests - - name: Install grcov - run: nix develop .#codecov -c cargo install grcov - - name: Generate coverage - run: nix develop .#codecov -c grcov . --binary-path target/debug/deps/ -s . -t lcov --branch --ignore-not-existing --ignore '../**' --ignore '/*' -o coverage.lcov - - name: Upload coverage to Codecov + - uses: dtolnay/rust-toolchain@nightly + with: + components: llvm-tools-preview + - uses: taiki-e/install-action@cargo-llvm-cov + - uses: taiki-e/install-action@nextest + - name: Collect coverage data (including doctests) + run: | + cargo +nightly llvm-cov --no-report nextest --workspace --all-features + cargo +nightly llvm-cov --no-report --doc --workspace --all-features + cargo +nightly llvm-cov report --doctests --lcov --output-path lcov.info + - name: Upload coverage data to codecov uses: codecov/codecov-action@v4 with: - files: ./coverage.lcov flags: rust - # TODO: set true when CODECOV_TOKEN is set - fail_ci_if_error: false - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + files: lcov.info + fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} + verbose: true diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index eabfd50..ab5249d 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,10 +1,11 @@ name: Lints on: - push: - branches: [ master ] pull_request: - branches: [ master ] + branches: + - master + - develop + - 'v[0-9]+.[0-9]+' env: CARGO_TERM_COLOR: always @@ -14,26 +15,31 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/checkout@v4 - - name: Install Nix - uses: cachix/install-nix-action@v26 + - uses: dtolnay/rust-toolchain@nightly + with: + components: rustfmt - name: Formatting - run: nix develop .#nightly -c cargo fmt --all -- --check + run: cargo +nightly fmt --all -- --check clippy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/checkout@v4 - - name: Install Nix - uses: cachix/install-nix-action@v26 - - name: Clippy - run: nix develop .#stable -c cargo clippy --workspace --all-features --all-targets -- -D warnings + - uses: dtolnay/rust-toolchain@stable + with: + components: clippy + - name: Formatting + run: cargo clippy --workspace --all-features --all-targets -- -D warnings doc: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@nightly + with: + components: rust-docs + - name: Formatting + run: cargo +nightly doc --workspace --all-features + typos: + runs-on: ubuntu-latest + steps: - uses: actions/checkout@v4 - - name: Install Nix - uses: cachix/install-nix-action@v26 - - name: Doc - run: nix develop .#nightly -c cargo doc --workspace --all-features + - uses: crate-ci/typos@master diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f642bca..9821d00 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,19 +2,38 @@ name: Tests on: push: - branches: [ master ] + branches: + - master + tags: + - 'v[0-9]+\.*' pull_request: - branches: [ master ] + branches: + - master + - develop + - 'v[0-9]+.[0-9]+' env: CARGO_TERM_COLOR: always jobs: testing: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ ubuntu-latest, macos-13, macos-latest, windows-latest ] + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - name: Test ${{matrix.os}} + run: cargo test --workspace --all-features --no-fail-fast + wasm-testing: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Install Nix - uses: cachix/install-nix-action@v26 - - name: Build & test - run: nix develop .#stable -c cargo test --workspace --all-features --no-fail-fast --tests + - uses: dtolnay/rust-toolchain@nightly + - uses: jetli/wasm-pack-action@v0.4.0 + - name: Add wasm32 target + run: rustup target add wasm32-unknown-unknown + - name: Test in headless Chrome + run: wasm-pack test --headless --chrome diff --git a/Cargo.toml b/Cargo.toml index f56beda..9625f76 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -87,8 +87,8 @@ fs = ["serde", "bp-wallet/fs", "rgb-std/fs"] cli = ["fs", "bp-wallet/cli"] esplora_blocking = ["bp-esplora"] electrum_blocking = ["bp-electrum"] -serde = ["serde_crate", "serde_yaml", "bp-std/serde", "descriptors/serde", "rgb-psbt/serde"] mempool_blocking = ["esplora_blocking"] +serde = ["serde_crate", "serde_yaml", "bp-std/serde", "descriptors/serde", "rgb-psbt/serde"] [package.metadata.docs.rs] features = ["all"] diff --git a/Dockerfile b/Dockerfile index 39cea58..592c468 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,7 @@ ARG SRC_DIR=/usr/local/src/rgb ARG BUILDER_DIR=/srv/rgb # Base image -FROM rust:1.66.0-slim-bullseye as chef +FROM rust:1.76.0-slim-bookworm as chef ARG SRC_DIR ARG BUILDER_DIR diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 1b69954..46cd915 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -27,7 +27,7 @@ bp-wallet = { workspace = true, features = ["cli"] } psbt = { workspace = true } rgb-std = { workspace = true, features = ["serde"] } rgb-interfaces = { workspace = true } -rgb-runtime = { version = "0.11.0-beta.6", path = "..", features = ["electrum_blocking", "esplora_blocking", "log", "serde", "fs", "cli"] } +rgb-runtime = { version = "0.11.0-beta.7", path = "..", features = ["electrum_blocking", "esplora_blocking", "log", "serde", "fs", "cli"] } log = { workspace = true } env_logger = "0.11.5" clap = { version = "4.5.16", features = ["derive", "env"] } diff --git a/flake.lock b/flake.lock deleted file mode 100644 index 5131a9d..0000000 --- a/flake.lock +++ /dev/null @@ -1,106 +0,0 @@ -{ - "nodes": { - "crane": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1713979152, - "narHash": "sha256-apdecPuh8SOQnkEET/kW/UcfjCRb8JbV5BKjoH+DcP4=", - "owner": "ipetkov", - "repo": "crane", - "rev": "a5eca68a2cf11adb32787fc141cddd29ac8eb79c", - "type": "github" - }, - "original": { - "owner": "ipetkov", - "repo": "crane", - "type": "github" - } - }, - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1712439257, - "narHash": "sha256-aSpiNepFOMk9932HOax0XwNxbA38GOUVOiXfUVPOrck=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "ff0dbd94265ac470dda06a657d5fe49de93b4599", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "crane": "crane", - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs", - "rust-overlay": "rust-overlay" - } - }, - "rust-overlay": { - "inputs": { - "flake-utils": [ - "flake-utils" - ], - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1712542394, - "narHash": "sha256-UZebDBECRSrJqw4K+LxZ6qFdYnScu6q1XCwqtsu1cas=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "ece8bdb3c3b58def25f204b9a1261dee55d7c9c0", - "type": "github" - }, - "original": { - "owner": "oxalica", - "repo": "rust-overlay", - "type": "github" - } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/flake.nix b/flake.nix deleted file mode 100644 index 0d8c593..0000000 --- a/flake.nix +++ /dev/null @@ -1,98 +0,0 @@ -{ - inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - rust-overlay = { - url = "github:oxalica/rust-overlay"; - inputs.nixpkgs.follows = "nixpkgs"; - inputs.flake-utils.follows = "flake-utils"; - }; - crane = { - url = "github:ipetkov/crane"; - inputs.nixpkgs.follows = "nixpkgs"; - inputs.flake-utils.follows = "flake-utils"; - }; - - flake-utils.url = "github:numtide/flake-utils"; - }; - - outputs = { self, crane, rust-overlay, nixpkgs, flake-utils }: - flake-utils.lib.eachDefaultSystem (system: - let - overlays = [ (import rust-overlay) ]; - pkgs = import nixpkgs { - inherit system overlays; - }; - - commonPackages = with pkgs; [ - openssl - pkg-config - ]; - workspaceToml = builtins.fromTOML (builtins.readFile ./Cargo.toml); - craneLib = (crane.mkLib pkgs).overrideToolchain pkgs.rust-bin.stable.latest.default; - - stableWithLlvm = pkgs.rust-bin.nightly.latest.default.override { - extensions = [ "rustfmt" "llvm-tools-preview" ]; - targets = [ ]; - }; - in - with pkgs; - { - packages = rec { - default = rgb; - rgb = craneLib.buildPackage rec { - pname = "rgb"; - cargoToml = ./Cargo.toml; - nativeBuildInputs = commonPackages; - cargoExtraArgs = "-p rgb-wallet"; - outputHashes = {}; - src = self; - buildInputs = with pkgs; [ - openssl - ]; - cargoArtifacts = craneLib.buildDepsOnly { - inherit src cargoToml buildInputs nativeBuildInputs cargoExtraArgs outputHashes; - }; - strictDeps = true; - doCheck = false; - }; - }; - - devShells = rec { - default = msrv; - - msrv = mkShell { - buildInputs = commonPackages ++ [ - rust-bin.stable."${workspaceToml.workspace.package."rust-version"}".default - ]; - }; - - stable = mkShell { - buildInputs = commonPackages ++ [ - rust-bin.stable.latest.default - ]; - }; - - beta = mkShell { - buildInputs = commonPackages ++ [ - rust-bin.beta.latest.default - ]; - }; - - nightly = mkShell { - buildInputs = commonPackages ++ [ - rust-bin.nightly.latest.default - ]; - }; - - codecov = mkShell { - buildInputs = commonPackages ++ [ - stableWithLlvm - ]; - CARGO_INCREMENTAL = "0"; - RUSTFLAGS = "-Cinstrument-coverage"; - RUSTDOCFLAGS = "-Cinstrument-coverage"; - }; - }; - } - ); -} From a19011af1237b355ef9966bc460578fc564a6c4e Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Tue, 20 Aug 2024 16:27:37 +0200 Subject: [PATCH 07/10] chore: fix fmt --- cli/src/args.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/src/args.rs b/cli/src/args.rs index 29a47ad..0a600dc 100644 --- a/cli/src/args.rs +++ b/cli/src/args.rs @@ -94,7 +94,7 @@ impl Default for RgbArgs { impl RgbArgs { pub(crate) fn load_stock( &self, - stock_path: impl ToOwned, + stock_path: impl ToOwned, ) -> Result { let stock_path = stock_path.to_owned(); @@ -173,7 +173,7 @@ impl RgbArgs { _ => Err(s!(" - error: no transaction resolver is specified; use either \ --esplora --mempool or --electrum argument")), } - .map_err(WalletError::Resolver)?; + .map_err(WalletError::Resolver)?; resolver.check(self.general.network)?; Ok(resolver) } From 5ef9570c17ca71d870b82516808eae12704b59ac Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Tue, 20 Aug 2024 16:30:32 +0200 Subject: [PATCH 08/10] chore: fix clippy lints --- psbt/src/lib.rs | 2 +- psbt/src/rgb.rs | 13 +++++++------ src/errors.rs | 1 + 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/psbt/src/lib.rs b/psbt/src/lib.rs index c08669c..551ccc9 100644 --- a/psbt/src/lib.rs +++ b/psbt/src/lib.rs @@ -75,7 +75,7 @@ impl RgbPsbt for Psbt { fn rgb_embed(&mut self, batch: Batch) -> Result<(), EmbedError> { for info in batch { let contract_id = info.transition.contract_id; - let mut inputs = info.inputs.into_inner(); + let mut inputs = info.inputs.release(); for input in self.inputs_mut() { if inputs.remove(&XChain::Bitcoin(input.prevout().outpoint())) { input diff --git a/psbt/src/rgb.rs b/psbt/src/rgb.rs index a50a49b..08a4797 100644 --- a/psbt/src/rgb.rs +++ b/psbt/src/rgb.rs @@ -192,10 +192,11 @@ pub trait RgbExt { let known_transitions = known_transitions.remove(&method).unwrap_or_default(); bundles.push(TransitionBundle { close_method: method, - input_map: InputMap::from(Confined::from_collection_unsafe( - input_map.into_inner(), - )), - known_transitions: Confined::try_from(known_transitions.into_inner()) + input_map: InputMap::from( + Confined::try_from(input_map.release()) + .map_err(|_| RgbPsbtError::NoTransitions(contract_id))?, + ), + known_transitions: Confined::try_from(known_transitions.release()) .map_err(|_| RgbPsbtError::NoTransitions(contract_id))?, }); } @@ -296,8 +297,8 @@ impl RgbExt for Psbt { // Since we update transition it's ok to ignore the fact that it previously // existed - let _ = self - .push_proprietary(PropKey::rgb_transition(opid), serialized_transition.into_inner()); + let _ = + self.push_proprietary(PropKey::rgb_transition(opid), serialized_transition.release()); let _ = self.push_proprietary(PropKey::rgb_closing_methods(opid), vec![method as u8]); Ok(prev_transition.is_none()) } diff --git a/src/errors.rs b/src/errors.rs index d2b4d42..2af84a5 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -124,6 +124,7 @@ pub enum HistoryError { NoDefaultAssignment, } +#[allow(clippy::large_enum_variant)] #[derive(Debug, Display, Error, From)] pub enum PayError { #[from] From 828676014a88f47a88957b613d024486dc113cc6 Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Tue, 20 Aug 2024 16:31:44 +0200 Subject: [PATCH 09/10] ci: fix wasm build --- Cargo.lock | 4 ++++ Cargo.toml | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 3d58076..44c2a68 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1460,13 +1460,17 @@ dependencies = [ "chrono", "commit_verify", "descriptors", + "getrandom", "indexmap 2.4.0", "log", + "rand", "rgb-psbt", "rgb-std", "serde", "serde_yaml", "strict_types", + "wasm-bindgen", + "wasm-bindgen-test", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 9625f76..de871cc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -80,6 +80,14 @@ serde_crate = { workspace = true, optional = true } serde_yaml = { workspace = true, optional = true } log = { workspace = true, optional = true } +[target.'cfg(target_arch = "wasm32")'.dependencies] +wasm-bindgen = "0.2" +rand = { version = "0.8.4", optional = true } +getrandom = { version = "0.2", features = ["js"] } + +[target.'cfg(target_arch = "wasm32")'.dev-dependencies] +wasm-bindgen-test = "0.3" + [features] default = ["esplora_blocking", "mempool_blocking"] all = ["esplora_blocking", "electrum_blocking", "mempool_blocking", "serde", "log", "fs", "cli"] From ccfa6ab93b99d307b8a8a13db092d3ca1616165d Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Tue, 20 Aug 2024 16:32:11 +0200 Subject: [PATCH 10/10] chore: add typo exceptions --- _typos.toml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 _typos.toml diff --git a/_typos.toml b/_typos.toml new file mode 100644 index 0000000..0c6e78b --- /dev/null +++ b/_typos.toml @@ -0,0 +1,13 @@ +[files] +# exclude the directory "stl/" +extend-exclude = ["stl/"] + +[default.extend-words] +# Don't correct the name "Jon Atack". +Atack = "Atack" + +[default] +extend-ignore-re = [ + # Don't correct URIs + "([a-z]+:)*[$!0-9A-Za-z-]+", +]