From 1db01385b617063604b43ee5f31a407cb1bd6f9e Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Mon, 11 Mar 2024 22:18:13 +0100 Subject: [PATCH] chore: update to use new ASCII armor --- Cargo.lock | 261 +++++++++++++++++++++++---------------------- Cargo.toml | 12 ++- cli/src/command.rs | 97 ++++++++++------- src/pay.rs | 8 +- 4 files changed, 206 insertions(+), 172 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 613d946..5e21e23 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -29,9 +29,10 @@ dependencies = [ [[package]] name = "aluvm" version = "0.11.0-beta.4" -source = "git+https://github.com/AluVM/rust-aluvm?branch=master#48e2f6bc2965feb7f65a9b8514595daf5a1b1eb8" +source = "git+https://github.com/AluVM/rust-aluvm?branch=armor#3bf009122c09a90df495049e0182712c675c2b26" dependencies = [ "amplify", + "ascii-armor", "baid58", "getrandom", "half", @@ -189,6 +190,19 @@ dependencies = [ "serde", ] +[[package]] +name = "ascii-armor" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "743d90b41a39d6e3920eef64a70f6411097cbb47141606a45b2a96533ec7111c" +dependencies = [ + "amplify", + "baid58", + "base85", + "sha2", + "strict_encoding", +] + [[package]] name = "autocfg" version = "1.1.0" @@ -333,8 +347,7 @@ dependencies = [ [[package]] name = "bp-consensus" version = "0.11.0-beta.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4455276e0c26bc4a742b8cf2a2a8fe1a42b06f15873dd6145c32af9a7a387a94" +source = "git+https://github.com/BP-WG/bp-core?branch=armor#628854dff6f82f873d6389e1ec8c7ec0b7d00c2d" dependencies = [ "amplify", "chrono", @@ -348,8 +361,7 @@ dependencies = [ [[package]] name = "bp-core" version = "0.11.0-beta.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83c1a3c6505e4fbf81d3f7ba5b79c789336e7b959d6b87ff3f37e0b70df68a51" +source = "git+https://github.com/BP-WG/bp-core?branch=armor#628854dff6f82f873d6389e1ec8c7ec0b7d00c2d" dependencies = [ "amplify", "bp-consensus", @@ -367,8 +379,7 @@ dependencies = [ [[package]] name = "bp-dbc" version = "0.11.0-beta.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9efc8f72528ae16a84aeac95657f326268289bb5b5b64c24309c1a6bc0b97caa" +source = "git+https://github.com/BP-WG/bp-core?branch=armor#628854dff6f82f873d6389e1ec8c7ec0b7d00c2d" dependencies = [ "amplify", "base85", @@ -390,7 +401,7 @@ dependencies = [ "bp-consensus", "bp-invoice", "commit_verify", - "indexmap 2.2.3", + "indexmap 2.2.5", "serde", ] @@ -426,8 +437,7 @@ dependencies = [ [[package]] name = "bp-seals" version = "0.11.0-beta.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a54af971320d2b3358eb7b4380d0dda72810b8f8b417790f38e2a8f28a10cad" +source = "git+https://github.com/BP-WG/bp-core?branch=armor#628854dff6f82f873d6389e1ec8c7ec0b7d00c2d" dependencies = [ "amplify", "baid58", @@ -458,7 +468,7 @@ dependencies = [ [[package]] name = "bp-util" version = "0.11.0-beta.4" -source = "git+https://github.com/BP-WG/bp-wallet?branch=master#54c39fb8d794b7e3a02348433b5cdce2f107528e" +source = "git+https://github.com/BP-WG/bp-wallet?branch=master#8552e161d4b0f1115df4b5cd14e69257e7efead7" dependencies = [ "amplify", "base64", @@ -480,7 +490,7 @@ dependencies = [ [[package]] name = "bp-wallet" version = "0.11.0-beta.4" -source = "git+https://github.com/BP-WG/bp-wallet?branch=master#54c39fb8d794b7e3a02348433b5cdce2f107528e" +source = "git+https://github.com/BP-WG/bp-wallet?branch=master#8552e161d4b0f1115df4b5cd14e69257e7efead7" dependencies = [ "amplify", "bp-esplora", @@ -496,9 +506,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.15.3" +version = "3.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea184aa71bb362a1157c896979544cc23974e08fd265f29ea96b59f0b4a555b" +checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa" [[package]] name = "byteorder" @@ -514,9 +524,9 @@ checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "cc" -version = "1.0.88" +version = "1.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02f341c093d19155a6e41631ce5971aac4e9a868262212153124c15fa22d1cdc" +checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" [[package]] name = "cfg-if" @@ -532,14 +542,14 @@ checksum = "45565fc9416b9896014f5732ac776f810ee53a66730c17e4020c3ec064a8f88f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] name = "chrono" -version = "0.4.34" +version = "0.4.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bc015644b92d5890fab7489e49d21f879d5c990186827d42ec511919404f38b" +checksum = "8eaf5903dcbc0a39312feb77df2ff4c76387d591b9fc7b04a238dcf8bb62639a" dependencies = [ "android-tzdata", "iana-time-zone", @@ -547,14 +557,14 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", - "windows-targets 0.52.3", + "windows-targets 0.52.4", ] [[package]] name = "clap" -version = "4.5.1" +version = "4.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c918d541ef2913577a0f9566e9ce27cb35b6df072075769e0b26cb5a554520da" +checksum = "b230ab84b0ffdf890d5a10abdbc8b83ae1c4918275daea1ab8801f71536b2651" dependencies = [ "clap_builder", "clap_derive", @@ -562,9 +572,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.1" +version = "4.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f3e7391dad68afb0c2ede1bf619f579a3dc9c2ec67f089baa397123a2f3d1eb" +checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" dependencies = [ "anstream", "anstyle", @@ -581,7 +591,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -599,8 +609,7 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "commit_encoding_derive" version = "0.11.0-beta.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d25b4b09de08ea8530138fb8a7ca45d90b53fef8d582a944a1b08eedf3f2583e" +source = "git+https://github.com/LNP-BP/client_side_validation?branch=armor#78f22a51b87115869f454ed0516a1bcdd8994db4" dependencies = [ "amplify", "amplify_syn", @@ -612,8 +621,7 @@ dependencies = [ [[package]] name = "commit_verify" version = "0.11.0-beta.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00351b49be0ce72775b37cca336c3c10e958d810ca097f0712d95a63684b4f99" +source = "git+https://github.com/LNP-BP/client_side_validation?branch=armor#78f22a51b87115869f454ed0516a1bcdd8994db4" dependencies = [ "amplify", "commit_encoding_derive", @@ -713,7 +721,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.10.0", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -724,7 +732,7 @@ checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" dependencies = [ "darling_core", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -745,7 +753,7 @@ checksum = "e1a6582232f545897fce642bd22299b9bf22ac56838c060f9e7de2be57b1419b" dependencies = [ "amplify", "bp-derive", - "indexmap 2.2.3", + "indexmap 2.2.5", "serde", ] @@ -976,7 +984,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 2.2.3", + "indexmap 2.2.5", "slab", "tokio", "tokio-util", @@ -1012,9 +1020,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "379dada1584ad501b383485dd706b8afb7a70fcbc7f4da7d780638a5a6124a60" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hex" @@ -1036,9 +1044,9 @@ checksum = "3011d1213f159867b13cfd6ac92d2cd5f1345762c63be3554e84092d85a50bbd" [[package]] name = "http" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" dependencies = [ "bytes", "fnv", @@ -1163,9 +1171,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.3" +version = "2.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" +checksum = "7b0b929d511467233429c45a44ac1dcaa21ba0f5ba11e4879e6ed28ddb4f9df4" dependencies = [ "equivalent", "hashbrown 0.14.3", @@ -1197,9 +1205,9 @@ checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "js-sys" -version = "0.3.68" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] @@ -1235,9 +1243,9 @@ checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "log" -version = "0.4.20" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "memchr" @@ -1262,9 +1270,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "wasi", @@ -1352,7 +1360,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -1443,7 +1451,7 @@ dependencies = [ "chrono", "commit_verify", "descriptors", - "indexmap 2.2.3", + "indexmap 2.2.5", "serde", "strict_encoding", ] @@ -1521,9 +1529,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ "aho-corasick", "memchr", @@ -1538,9 +1546,9 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "reqwest" -version = "0.11.24" +version = "0.11.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6920094eb85afde5e4a138be3f2de8bbdf28000f0029e72c45025a56b042251" +checksum = "0eea5a9eb898d3783f17c6407670e3592fd174cb81a10e51d4c37f49450b9946" dependencies = [ "base64", "bytes", @@ -1580,10 +1588,11 @@ dependencies = [ [[package]] name = "rgb-core" version = "0.11.0-beta.4" -source = "git+https://github.com/RGB-WG/rgb-core?branch=serde_fix#644c1e49e25ee115c2cdcb260a72aaf97443d662" +source = "git+https://github.com/RGB-WG/rgb-core?branch=armor#be751660fb5408c6df0ff0ac10e9d15f362f2f9b" dependencies = [ "aluvm", "amplify", + "ascii-armor", "baid58", "bp-core", "chrono", @@ -1601,14 +1610,14 @@ dependencies = [ [[package]] name = "rgb-invoice" version = "0.11.0-beta.4" -source = "git+https://github.com/RGB-WG/rgb-std?branch=serde#dffaf9c06c098264d22f70fe5a5fd662c7604c2f" +source = "git+https://github.com/RGB-WG/rgb-std?branch=armor#2e8e754e6b6ac565041151693e8b57dc5520a065" dependencies = [ "amplify", "baid58", "bp-core", "bp-invoice", "fluent-uri", - "indexmap 2.2.3", + "indexmap 2.2.5", "percent-encoding", "rgb-core", "serde", @@ -1658,7 +1667,7 @@ dependencies = [ "commit_verify", "descriptors", "electrum-client", - "indexmap 2.2.3", + "indexmap 2.2.5", "log", "rgb-persist-fs", "rgb-psbt", @@ -1672,16 +1681,17 @@ dependencies = [ [[package]] name = "rgb-std" version = "0.11.0-beta.4" -source = "git+https://github.com/RGB-WG/rgb-std?branch=serde#dffaf9c06c098264d22f70fe5a5fd662c7604c2f" +source = "git+https://github.com/RGB-WG/rgb-std?branch=armor#2e8e754e6b6ac565041151693e8b57dc5520a065" dependencies = [ "amplify", + "ascii-armor", "baid58", "base85", "bp-core", "chrono", "commit_verify", "getrandom", - "indexmap 2.2.3", + "indexmap 2.2.5", "rand", "rgb-core", "rgb-invoice", @@ -1936,7 +1946,7 @@ checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -1991,7 +2001,7 @@ dependencies = [ "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.2.3", + "indexmap 2.2.5", "serde", "serde_derive", "serde_json", @@ -2008,7 +2018,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -2017,7 +2027,7 @@ version = "0.9.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fd075d994154d4a774f95b51fb96bdc2832b0ea48425c92546073816cda1f2f" dependencies = [ - "indexmap 2.2.3", + "indexmap 2.2.5", "itoa", "ryu", "serde", @@ -2117,14 +2127,13 @@ dependencies = [ [[package]] name = "strict_types" version = "2.7.0-beta.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d66de5cdf197b68e13fcac9fad7ed288f44052a319a3df3abbaba9c6e52f735b" +source = "git+https://github.com/strict-types/strict-types?branch=armor#00741ba09189536d8cdaf048a7f17795393ee382" dependencies = [ "amplify", + "ascii-armor", "baid58", - "base85", "half", - "indexmap 2.2.3", + "indexmap 2.2.5", "serde", "serde_json", "serde_yaml", @@ -2175,9 +2184,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.51" +version = "2.0.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ab617d94515e94ae53b8406c628598680aa0c9587474ecbe58188f7b345d66c" +checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07" dependencies = [ "proc-macro2", "quote", @@ -2192,20 +2201,20 @@ checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" [[package]] name = "system-configuration" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +checksum = "658bc6ee10a9b4fcf576e9b0819d95ec16f4d2c02d39fd83ac1c8789785c4a42" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.2", "core-foundation", "system-configuration-sys", ] [[package]] name = "system-configuration-sys" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" dependencies = [ "core-foundation-sys", "libc", @@ -2249,7 +2258,7 @@ checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -2351,9 +2360,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a9aad4a3066010876e8dcf5a8a06e70a558751117a145c6ce2b82c2e2054290" +checksum = "af06656561d28735e9c1cd63dfd57132c8155426aa6af24f36a00a351f88c48e" dependencies = [ "serde", "serde_spanned", @@ -2372,11 +2381,11 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.6" +version = "0.22.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c1b5fd4128cc8d3e0cb74d4ed9a9cc7c7284becd4df68f5f940e1ad123606f6" +checksum = "18769cd1cec395d70860ceb4d932812a0b4d06b1a4bb336745a4d21b9496e992" dependencies = [ - "indexmap 2.2.3", + "indexmap 2.2.5", "serde", "serde_spanned", "toml_datetime", @@ -2529,9 +2538,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -2539,24 +2548,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.41" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877b9c3f61ceea0e56331985743b13f3d25c406a7098d45180fb5f09bc19ed97" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" dependencies = [ "cfg-if", "js-sys", @@ -2566,9 +2575,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2576,28 +2585,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "wasm-bindgen-test" -version = "0.3.41" +version = "0.3.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143ddeb4f833e2ed0d252e618986e18bfc7b0e52f2d28d77d05b2f045dd8eb61" +checksum = "d9bf62a58e0780af3e852044583deee40983e5886da43a271dd772379987667b" dependencies = [ "console_error_panic_hook", "js-sys", @@ -2609,20 +2618,20 @@ dependencies = [ [[package]] name = "wasm-bindgen-test-macro" -version = "0.3.41" +version = "0.3.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5211b7550606857312bba1d978a8ec75692eae187becc5e680444fffc5e6f89" +checksum = "b7f89739351a2e03cb94beb799d47fb2cac01759b40ec441f7de39b00cbf7ef0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] name = "web-sys" -version = "0.3.68" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96565907687f7aceb35bc5fc03770a8a0471d82e479f25832f54a0e3f4b28446" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" dependencies = [ "js-sys", "wasm-bindgen", @@ -2680,7 +2689,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.3", + "windows-targets 0.52.4", ] [[package]] @@ -2698,7 +2707,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.3", + "windows-targets 0.52.4", ] [[package]] @@ -2718,17 +2727,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d380ba1dc7187569a8a9e91ed34b8ccfc33123bbacb8c0aed2d1ad7f3ef2dc5f" +checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" dependencies = [ - "windows_aarch64_gnullvm 0.52.3", - "windows_aarch64_msvc 0.52.3", - "windows_i686_gnu 0.52.3", - "windows_i686_msvc 0.52.3", - "windows_x86_64_gnu 0.52.3", - "windows_x86_64_gnullvm 0.52.3", - "windows_x86_64_msvc 0.52.3", + "windows_aarch64_gnullvm 0.52.4", + "windows_aarch64_msvc 0.52.4", + "windows_i686_gnu 0.52.4", + "windows_i686_msvc 0.52.4", + "windows_x86_64_gnu 0.52.4", + "windows_x86_64_gnullvm 0.52.4", + "windows_x86_64_msvc 0.52.4", ] [[package]] @@ -2739,9 +2748,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68e5dcfb9413f53afd9c8f86e56a7b4d86d9a2fa26090ea2dc9e40fba56c6ec6" +checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" [[package]] name = "windows_aarch64_msvc" @@ -2751,9 +2760,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dab469ebbc45798319e69eebf92308e541ce46760b49b18c6b3fe5e8965b30f" +checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" [[package]] name = "windows_i686_gnu" @@ -2763,9 +2772,9 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a4e9b6a7cac734a8b4138a4e1044eac3404d8326b6c0f939276560687a033fb" +checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" [[package]] name = "windows_i686_msvc" @@ -2775,9 +2784,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b0ec9c422ca95ff34a78755cfa6ad4a51371da2a5ace67500cf7ca5f232c58" +checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" [[package]] name = "windows_x86_64_gnu" @@ -2787,9 +2796,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "704131571ba93e89d7cd43482277d6632589b18ecf4468f591fbae0a8b101614" +checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" [[package]] name = "windows_x86_64_gnullvm" @@ -2799,9 +2808,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42079295511643151e98d61c38c0acc444e52dd42ab456f7ccfd5152e8ecf21c" +checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" [[package]] name = "windows_x86_64_msvc" @@ -2811,15 +2820,15 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0770833d60a970638e989b3fa9fd2bb1aaadcf88963d1659fd7d9990196ed2d6" +checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" [[package]] name = "winnow" -version = "0.6.2" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a4191c47f15cc3ec71fcb4913cb83d58def65dd3787610213c649283b5ce178" +checksum = "dffa400e67ed5a4dd237983829e66475f0a4a26938c4b04c21baede6262215b8" dependencies = [ "memchr", ] diff --git a/Cargo.toml b/Cargo.toml index e500ede..143d563 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -98,8 +98,14 @@ serde = ["serde_crate", "serde_with", "serde_yaml", "bp-std/serde", "bp-wallet/s features = ["all"] [patch.crates-io] +strict_types = { git = "https://github.com/strict-types/strict-types", branch = "armor" } +aluvm = { git = "https://github.com/AluVM/rust-aluvm", branch = "armor" } +commit_verify = { git = "https://github.com/LNP-BP/client_side_validation", branch = "armor" } +bp-consensus = { git = "https://github.com/BP-WG/bp-core", branch = "armor" } +bp-dbc = { git = "https://github.com/BP-WG/bp-core", branch = "armor" } +bp-seals = { git = "https://github.com/BP-WG/bp-core", branch = "armor" } +bp-core = { git = "https://github.com/BP-WG/bp-core", branch = "armor" } bp-util = { git = "https://github.com/BP-WG/bp-wallet", 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 = "serde_fix" } -rgb-std = { git = "https://github.com/RGB-WG/rgb-std", branch = "serde" } -aluvm = { git = "https://github.com/AluVM/rust-aluvm", branch = "master" } +rgb-core = { git = "https://github.com/RGB-WG/rgb-core", branch = "armor" } +rgb-std = { git = "https://github.com/RGB-WG/rgb-std", branch = "armor" } diff --git a/cli/src/command.rs b/cli/src/command.rs index aa97551..d43e666 100644 --- a/cli/src/command.rs +++ b/cli/src/command.rs @@ -24,14 +24,15 @@ use std::fs::File; use std::path::PathBuf; use std::str::FromStr; -use amplify::confinement::{SmallOrdMap, TinyOrdMap, TinyOrdSet, U16 as MAX16, U32 as MAX32}; +use amplify::confinement::{SmallOrdMap, TinyOrdMap, TinyOrdSet, U16 as MAX16}; use baid58::ToBaid58; use bp_util::{BpCommand, Config, Exec}; use bpstd::Sats; use psbt::{Psbt, PsbtVer}; use rgb_rt::{DescriptorRgb, RgbKeychain, RuntimeError, TransferParams}; use rgbstd::containers::{ - Bindle, BuilderSeal, ContainerVer, ContentId, ContentSigs, Terminal, Transfer, UniversalBindle, + BuilderSeal, ContainerVer, ContentId, ContentSigs, Contract, FileContent, Terminal, Transfer, + UniversalFile, }; use rgbstd::contract::{ContractId, GenesisSeal, GraphSeal, StateType}; use rgbstd::interface::{ @@ -45,7 +46,7 @@ use rgbstd::vm::RgbIsa; use rgbstd::{AssetTag, AssignmentType, BundleId, OutputSeal, XChain, XOutputSeal}; use seals::txout::CloseMethod; use serde_crate::{Deserialize, Serialize}; -use strict_types::encoding::{FieldName, StrictSerialize, TypeName}; +use strict_types::encoding::{FieldName, TypeName}; use strict_types::StrictVal; use crate::RgbArgs; @@ -251,6 +252,9 @@ pub enum Command { #[display("reconstruct")] #[clap(hide = true)] Reconstruct { + #[clap(long)] + contract: bool, + /// RGB file with the consignment YAML data src: PathBuf, @@ -380,34 +384,33 @@ impl Exec for RgbArgs { if *armored { todo!() } else { - let bindle = UniversalBindle::load_file(file)?; - match bindle { - UniversalBindle::Iface(iface) => { - let id = iface.id(); + let content = UniversalFile::load_file(file)?; + match content { + UniversalFile::Iface(iface) => { + let id = iface.iface_id(); let name = iface.name.clone(); runtime.import_iface(iface)?; eprintln!("Interface {id} with name {name} imported to the stash"); } - UniversalBindle::Schema(schema) => { - let id = schema.id(); + UniversalFile::Schema(schema) => { + let id = schema.schema_id(); runtime.import_schema(schema)?; eprintln!("Schema {id} imported to the stash"); } - UniversalBindle::Impl(iimpl) => { + UniversalFile::Impl(iimpl) => { let iface_id = iimpl.iface_id; let schema_id = iimpl.schema_id; - let id = iimpl.id(); + let id = iimpl.impl_id(); runtime.import_iface_impl(iimpl)?; eprintln!( "Implementation {id} of interface {iface_id} for schema \ {schema_id} imported to the stash" ); } - UniversalBindle::Contract(bindle) => { + UniversalFile::Contract(contract) => { let mut resolver = self.resolver()?; - let id = bindle.id(); - let contract = bindle - .unbindle() + let id = contract.consignment_id(); + let contract = contract .validate(&mut resolver, self.general.network.is_testnet()) .map_err(|c| { c.validation_status().expect("just validated").to_string() @@ -415,11 +418,14 @@ impl Exec for RgbArgs { runtime.import_contract(contract, &mut resolver)?; eprintln!("Contract {id} imported to the stash"); } - UniversalBindle::Transfer(_) => { + UniversalFile::Transfer(_) => { return Err(s!("use `validate` and `accept` commands to work with \ transfer consignments") .into()); } + UniversalFile::Suppl(_suppl) => { + todo!() + } }; } Some(runtime) @@ -435,7 +441,7 @@ impl Exec for RgbArgs { .map_err(|err| err.to_string())?; if let Some(file) = file { // TODO: handle armored flag - bindle.save(file)?; + bindle.save_file(file)?; eprintln!("Contract {contract} exported to '{}'", file.display()); } else { println!("{bindle}"); @@ -444,8 +450,8 @@ impl Exec for RgbArgs { } Command::Armor { file } => { - let bindle = UniversalBindle::load_file(file)?; - println!("{bindle}"); + let content = UniversalFile::load_file(file)?; + println!("{content}"); None } @@ -752,7 +758,7 @@ impl Exec for RgbArgs { .map_err(|err| err.to_string())?; let mut psbt_file = File::create(psbt_name)?; psbt.encode(psbt.version, &mut psbt_file)?; - transfer.save(out_file)?; + transfer.save_file(out_file)?; Some(runtime) } Command::Transfer { @@ -772,7 +778,7 @@ impl Exec for RgbArgs { .pay(invoice, *method, params) .map_err(|err| err.to_string())?; - transfer.save(out_file)?; + transfer.save_file(out_file)?; let ver = if *v2 { PsbtVer::V2 } else { PsbtVer::V0 }; match psbt_file { @@ -800,15 +806,12 @@ impl Exec for RgbArgs { signatures: TinyOrdMap, } - let bindle = UniversalBindle::load_file(file)?; - let contract = match bindle { - UniversalBindle::Contract(contract) if *dir => Some(contract.into_split()), - UniversalBindle::Transfer(transfer) if *dir => { - let (transfer, sigs) = transfer.into_split(); - Some((transfer.into_contract(), sigs)) - } - bindle => { - let s = serde_yaml::to_string(&bindle).expect("unable to present as YAML"); + let content = UniversalFile::load_file(file)?; + let contract = match content { + UniversalFile::Contract(contract) if *dir => Some(contract), + UniversalFile::Transfer(transfer) if *dir => Some(transfer.into_contract()), + content => { + let s = serde_yaml::to_string(&content).expect("unable to present as YAML"); match path { None => println!("{s}"), Some(path) => fs::write(path, s)?, @@ -816,13 +819,12 @@ impl Exec for RgbArgs { None } }; - if let Some((contract, sigs)) = contract { + if let Some(contract) = contract { let mut map = map![ s!("genesis.yaml") => serde_yaml::to_string(&contract.genesis)?, s!("schema.yaml") => serde_yaml::to_string(&contract.schema)?, s!("bundles.yaml") => serde_yaml::to_string(&contract.bundles)?, s!("extensions.yaml") => serde_yaml::to_string(&contract.extensions)?, - s!("sigs.yaml") => serde_yaml::to_string(&sigs)?, s!("schema-types.sty") => contract.schema.types.to_string(), ]; for (id, lib) in &contract.schema.script.as_alu_script().libs { @@ -866,13 +868,32 @@ impl Exec for RgbArgs { } None } - Command::Reconstruct { src, dst } => { + Command::Reconstruct { + contract: false, + src, + dst, + } => { let file = File::open(src)?; - let transfer: Bindle = serde_yaml::from_reader(&file)?; + let transfer: Transfer = serde_yaml::from_reader(&file)?; match dst { None => println!("{transfer}"), Some(dst) => { - transfer.strict_serialize_to_file::(dst)?; + transfer.save_file(dst)?; + } + } + None + } + Command::Reconstruct { + contract: true, + src, + dst, + } => { + let file = File::open(src)?; + let contract: Contract = serde_yaml::from_reader(&file)?; + match dst { + None => println!("{contract}"), + Some(dst) => { + contract.save_file(dst)?; } } None @@ -979,8 +1000,7 @@ impl Exec for RgbArgs { } Command::Validate { file } => { let mut resolver = self.resolver()?; - let bindle = Bindle::::load_file(file)?; - let consignment = bindle.unbindle(); + let consignment = Transfer::load_file(file)?; resolver.add_terminals(&consignment); let status = match consignment.validate(&mut resolver, self.general.network.is_testnet()) { @@ -998,8 +1018,7 @@ impl Exec for RgbArgs { Command::Accept { force, file } => { let mut runtime = self.rgb_runtime(&config)?; let mut resolver = self.resolver()?; - let bindle = Bindle::::load_file(file)?; - let consignment = bindle.unbindle(); + let consignment = Transfer::load_file(file)?; resolver.add_terminals(&consignment); let transfer = consignment .validate(&mut resolver, self.general.network.is_testnet()) diff --git a/src/pay.rs b/src/pay.rs index f5517e5..8cfde6a 100644 --- a/src/pay.rs +++ b/src/pay.rs @@ -28,7 +28,7 @@ use bp::{Outpoint, Sats, ScriptPubkey, Vout}; use bpstd::Address; use bpwallet::{Beneficiary as BpBeneficiary, ConstructionError, PsbtMeta, TxParams}; use psbt::{CommitError, EmbedError, Psbt, RgbPsbt, TapretKeyError}; -use rgbstd::containers::{Bindle, Transfer}; +use rgbstd::containers::Transfer; use rgbstd::interface::ContractError; use rgbstd::invoice::{Amount, Beneficiary, InvoiceState, RgbInvoice}; use rgbstd::persistence::{ @@ -162,7 +162,7 @@ impl Runtime { invoice: &RgbInvoice, method: CloseMethod, params: TransferParams, - ) -> Result<(Psbt, PsbtMeta, Bindle), PayError> { + ) -> Result<(Psbt, PsbtMeta, Transfer), PayError> { let (mut psbt, meta) = self.construct_psbt(invoice, method, params)?; // ... here we pass PSBT around signers, if necessary let transfer = self.transfer(invoice, &mut psbt)?; @@ -303,7 +303,7 @@ impl Runtime { &mut self, invoice: &RgbInvoice, psbt: &mut Psbt, - ) -> Result, CompletionError> { + ) -> Result { let contract_id = invoice.contract.ok_or(CompletionError::NoContract)?; let fascia = psbt.rgb_commit()?; @@ -349,6 +349,6 @@ impl Runtime { } transfer.terminals = Confined::from_collection_unsafe(terminals); - Ok(self.stock().bindle(transfer)) + Ok(transfer) } }