diff --git a/Cargo.lock b/Cargo.lock index da0a0c4..960d04c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,21 +1,21 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" -version = "0.21.0" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ "gimli", ] [[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 = "aead" @@ -113,10 +113,10 @@ dependencies = [ ] [[package]] -name = "arc-swap" -version = "0.4.8" +name = "anyhow" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dabe5a181f83789739c194cbe5a897dde195078fac08568d09221fd6137a7ba8" +checksum = "74f37166d7d48a0284b99dd824694c26119c700b53bf0d1540cdb147dbdaaf13" [[package]] name = "arc-swap" @@ -126,9 +126,9 @@ checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" [[package]] name = "arrayref" -version = "0.3.7" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" [[package]] name = "arrayvec" @@ -147,9 +147,9 @@ checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" [[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 = "atty" @@ -168,28 +168,28 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dde43e75fd43e8a1bf86103336bc699aa8d17ad1be60c76c0bdfd4828e19b78" dependencies = [ - "autocfg 1.3.0", + "autocfg 1.4.0", ] [[package]] name = "autocfg" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "backtrace" -version = "0.3.71" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ "addr2line", - "cc", "cfg-if 1.0.0", "libc", "miniz_oxide", "object", "rustc-demangle", + "windows-targets", ] [[package]] @@ -226,6 +226,15 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" +[[package]] +name = "basic-toml" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "823388e228f614e9558c6804262db37960ec8821856535f5c3f59913140558f8" +dependencies = [ + "serde", +] + [[package]] name = "bech32" version = "0.7.3" @@ -258,9 +267,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "blake2-rfc" @@ -330,9 +339,9 @@ checksum = "476e9cd489f9e121e02ffa6014a8ef220ecb15c05ed23fc34cca13925dc283fb" [[package]] name = "built" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "236e6289eda5a812bc6b53c3b024039382a2895fbbeef2d748b2931546d392c4" +checksum = "c360505aed52b7ec96a3636c3f039d99103c37d1d9b4f7a8c743d3ea9ffcd03b" dependencies = [ "git2", ] @@ -373,19 +382,19 @@ checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" [[package]] name = "bytes" -version = "1.6.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" +checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" [[package]] name = "cc" -version = "1.0.98" +version = "1.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" +checksum = "c2e7962b54006dcfcc61cb72735f4d89bb97061dd6a7ed882ec6b8ee53714c6f" dependencies = [ "jobserver", "libc", - "once_cell", + "shlex", ] [[package]] @@ -462,7 +471,7 @@ dependencies = [ "textwrap", "unicode-width", "vec_map", - "yaml-rust 0.3.5", + "yaml-rust", ] [[package]] @@ -486,7 +495,7 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9885fa71e26b8ab7855e2ec7cae6e9b380edff76cd052e07c683a0319d51b3a2" dependencies = [ - "futures 0.3.30", + "futures 0.3.31", ] [[package]] @@ -505,7 +514,7 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ - "core-foundation-sys 0.8.6", + "core-foundation-sys 0.8.7", "libc", ] @@ -517,15 +526,15 @@ checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" [[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.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" dependencies = [ "libc", ] @@ -551,9 +560,9 @@ dependencies = [ [[package]] name = "croaring-sys" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5260027c04c33d67f405589d9c26e1e991fe062fb165f3094c9836e6c3b17f" +checksum = "3e5fed89265a702f0085844237a7ebbadf8a7c42de6304fddca30a5013f9aecb" dependencies = [ "cc", ] @@ -639,7 +648,7 @@ version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096" dependencies = [ - "quote 1.0.36", + "quote 1.0.37", "syn 1.0.109", ] @@ -687,8 +696,8 @@ checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" dependencies = [ "fnv", "ident_case", - "proc-macro2 1.0.83", - "quote 1.0.36", + "proc-macro2 1.0.89", + "quote 1.0.37", "strsim 0.10.0", "syn 1.0.109", ] @@ -700,7 +709,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" dependencies = [ "darling_core", - "quote 1.0.36", + "quote 1.0.37", "syn 1.0.109", ] @@ -723,6 +732,23 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2 1.0.89", + "quote 1.0.37", + "syn 1.0.109", +] + +[[package]] +name = "destructure_traitobject" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c877555693c14d2f84191cfd3ad8582790fc52b5e2274b40b59cf5f5cea25c7" + [[package]] name = "difference" version = "2.0.0" @@ -815,7 +841,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" dependencies = [ "libc", - "redox_users 0.4.5", + "redox_users 0.4.6", "winapi 0.3.9", ] @@ -826,19 +852,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" dependencies = [ "libc", - "redox_users 0.4.5", + "redox_users 0.4.6", "winapi 0.3.9", ] [[package]] name = "displaydoc" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ - "proc-macro2 1.0.83", - "quote 1.0.36", - "syn 2.0.65", + "proc-macro2 1.0.89", + "quote 1.0.37", + "syn 2.0.86", ] [[package]] @@ -891,9 +917,9 @@ dependencies = [ [[package]] name = "either" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "encode_unicode" @@ -903,9 +929,9 @@ checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" [[package]] name = "encoding_rs" -version = "0.8.34" +version = "0.8.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" dependencies = [ "cfg-if 1.0.0", ] @@ -932,14 +958,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] name = "fastrand" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" +checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" [[package]] name = "find-crate" @@ -947,14 +973,14 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59a98bbaacea1c0eb6a0876280051b892eb73594fd90cf3b20e9c817029c57d2" dependencies = [ - "toml 0.5.11", + "toml", ] [[package]] name = "flate2" -version = "1.0.30" +version = "1.0.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" +checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0" dependencies = [ "crc32fast", "miniz_oxide", @@ -1064,9 +1090,9 @@ checksum = "3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678" [[package]] name = "futures" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", @@ -1079,9 +1105,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", "futures-sink", @@ -1089,15 +1115,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", @@ -1106,38 +1132,38 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-macro" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ - "proc-macro2 1.0.83", - "quote 1.0.36", - "syn 2.0.65", + "proc-macro2 1.0.89", + "quote 1.0.37", + "syn 2.0.86", ] [[package]] name = "futures-sink" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-channel", "futures-core", @@ -1146,7 +1172,7 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project-lite 0.2.14", + "pin-project-lite 0.2.15", "pin-utils", "slab", ] @@ -1200,9 +1226,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.1" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "git2" @@ -1210,7 +1236,7 @@ version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b903b73e45dc0c6c596f2d37eccece7c1c8bb6e4407b001096387c63d0d93724" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "libc", "libgit2-sys", "log", @@ -1219,12 +1245,13 @@ dependencies = [ [[package]] name = "grin_api" -version = "5.4.0-alpha.0" -source = "git+https://github.com/mimblewimble/grin?branch=master#503527c2e7702b0de747ccdbb090cadb7d0a1d64" +version = "5.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6443239e75a15c517ce24fe4dd3ef257898ae0224e6b7c993db28794e13ecf3e" dependencies = [ "bytes 0.5.6", "easy-jsonrpc-mw", - "futures 0.3.30", + "futures 0.3.31", "grin_chain", "grin_core", "grin_p2p", @@ -1251,8 +1278,9 @@ dependencies = [ [[package]] name = "grin_chain" -version = "5.4.0-alpha.0" -source = "git+https://github.com/mimblewimble/grin?branch=master#503527c2e7702b0de747ccdbb090cadb7d0a1d64" +version = "5.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdedcee9e20e0cc8dc1460b37b3951306c774a6aa5788e3f45addc56e60f7fbe" dependencies = [ "bit-vec", "bitflags 1.3.2", @@ -1274,8 +1302,9 @@ dependencies = [ [[package]] name = "grin_core" -version = "5.4.0-alpha.0" -source = "git+https://github.com/mimblewimble/grin?branch=master#503527c2e7702b0de747ccdbb090cadb7d0a1d64" +version = "5.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4fbf242a2a23a6554dd4c430574d2563993cf5f44921f953635e8a177cf2506" dependencies = [ "blake2-rfc", "byteorder", @@ -1300,8 +1329,9 @@ dependencies = [ [[package]] name = "grin_keychain" -version = "5.4.0-alpha.0" -source = "git+https://github.com/mimblewimble/grin?branch=master#503527c2e7702b0de747ccdbb090cadb7d0a1d64" +version = "5.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abeb1c22f48269a0bf463de589f8961d8bbb554def5e5e405710ead9a1b4c71a" dependencies = [ "blake2-rfc", "byteorder", @@ -1322,8 +1352,9 @@ dependencies = [ [[package]] name = "grin_p2p" -version = "5.4.0-alpha.0" -source = "git+https://github.com/mimblewimble/grin?branch=master#503527c2e7702b0de747ccdbb090cadb7d0a1d64" +version = "5.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6b0ecc5597244d698ec4e1ea2e7d04c3b209f496db16731a04f06af41572c54" dependencies = [ "bitflags 1.3.2", "bytes 0.5.6", @@ -1344,8 +1375,9 @@ dependencies = [ [[package]] name = "grin_pool" -version = "5.4.0-alpha.0" -source = "git+https://github.com/mimblewimble/grin?branch=master#503527c2e7702b0de747ccdbb090cadb7d0a1d64" +version = "5.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14b758b202f034a03b894e732c716ddece8994fae5d8da1e074b1a9e07219f2b" dependencies = [ "blake2-rfc", "chrono", @@ -1365,7 +1397,7 @@ version = "0.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06832645c3d28079245827908045946db48e5d62b4c54b40701c7e21327e2571" dependencies = [ - "arrayvec 0.7.4", + "arrayvec 0.7.6", "cc", "libc", "rand 0.5.6", @@ -1376,8 +1408,9 @@ dependencies = [ [[package]] name = "grin_store" -version = "5.4.0-alpha.0" -source = "git+https://github.com/mimblewimble/grin?branch=master#503527c2e7702b0de747ccdbb090cadb7d0a1d64" +version = "5.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "708e53758263fa17dfd3fc46419ded59a84d07818e1ee7526b0d47ba268f1362" dependencies = [ "byteorder", "croaring", @@ -1395,9 +1428,11 @@ dependencies = [ [[package]] name = "grin_util" -version = "5.4.0-alpha.0" -source = "git+https://github.com/mimblewimble/grin?branch=master#503527c2e7702b0de747ccdbb090cadb7d0a1d64" +version = "5.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1433d76d0e95c2ed20e1008e9891adfae64812d1bdc5ec71ed5499dcaca2986" dependencies = [ + "anyhow", "backtrace", "base64 0.12.3", "byteorder", @@ -1416,7 +1451,7 @@ dependencies = [ [[package]] name = "grin_wallet" -version = "5.4.0-contracts.0" +version = "5.4.0-alpha.1" dependencies = [ "built", "clap", @@ -1448,7 +1483,7 @@ dependencies = [ [[package]] name = "grin_wallet_api" -version = "5.4.0-contracts.0" +version = "5.4.0-alpha.1" dependencies = [ "base64 0.12.3", "chrono", @@ -1473,7 +1508,7 @@ dependencies = [ [[package]] name = "grin_wallet_config" -version = "5.4.0-contracts.0" +version = "5.4.0-alpha.1" dependencies = [ "dirs 2.0.2", "grin_core", @@ -1483,17 +1518,17 @@ dependencies = [ "rand 0.6.5", "serde", "serde_derive", - "toml 0.5.11", + "toml", ] [[package]] name = "grin_wallet_controller" -version = "5.4.0-contracts.0" +version = "5.4.0-alpha.1" dependencies = [ "chrono", "easy-jsonrpc-mw", "ed25519-dalek", - "futures 0.3.30", + "futures 0.3.31", "grin_api", "grin_chain", "grin_core", @@ -1524,7 +1559,7 @@ dependencies = [ [[package]] name = "grin_wallet_impls" -version = "5.4.0-contracts.0" +version = "5.4.0-alpha.1" dependencies = [ "base64 0.12.3", "blake2-rfc", @@ -1532,7 +1567,7 @@ dependencies = [ "chrono", "data-encoding", "ed25519-dalek", - "futures 0.3.30", + "futures 0.3.31", "grin_api", "grin_chain", "grin_core", @@ -1563,7 +1598,7 @@ dependencies = [ [[package]] name = "grin_wallet_libwallet" -version = "5.4.0-contracts.0" +version = "5.4.0-alpha.1" dependencies = [ "age", "base64 0.9.3", @@ -1577,7 +1612,6 @@ dependencies = [ "ed25519-dalek", "grin_core", "grin_keychain", - "grin_secp256k1zkp", "grin_store", "grin_util", "grin_wallet_config", @@ -1603,7 +1637,7 @@ dependencies = [ [[package]] name = "grin_wallet_util" -version = "5.4.0-contracts.0" +version = "5.4.0-alpha.1" dependencies = [ "data-encoding", "ed25519-dalek", @@ -1648,6 +1682,12 @@ version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +[[package]] +name = "hashbrown" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" + [[package]] name = "heck" version = "0.3.3" @@ -1672,6 +1712,12 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +[[package]] +name = "hermit-abi" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" + [[package]] name = "hkdf" version = "0.11.0" @@ -1707,7 +1753,7 @@ version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" dependencies = [ - "bytes 1.6.0", + "bytes 1.8.0", "fnv", "itoa 1.0.11", ] @@ -1724,9 +1770,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.8.0" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" [[package]] name = "httpdate" @@ -1736,12 +1782,9 @@ checksum = "494b4d60369511e7dea41cf646832512a94e542f68bb9c49e54518e0f468eb47" [[package]] name = "humantime" -version = "1.3.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" -dependencies = [ - "quick-error", -] +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" @@ -1828,15 +1871,15 @@ dependencies = [ [[package]] name = "i18n-config" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c9ce3c48cbc21fd5b22b9331f32b5b51f6ad85d969b99e793427332e76e7640" +checksum = "8e88074831c0be5b89181b05e6748c4915f77769ecc9a4c372f88b169a8509c9" dependencies = [ + "basic-toml", "log", "serde", "serde_derive", "thiserror", - "toml 0.8.13", "unic-langid", ] @@ -1846,7 +1889,7 @@ version = "0.13.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92a86226a7a16632de6723449ee5fe70bac5af718bc642ee9ca2f0f6e14fa1fa" dependencies = [ - "arc-swap 1.7.1", + "arc-swap", "fluent", "fluent-langneg", "fluent-syntax", @@ -1854,7 +1897,7 @@ dependencies = [ "intl-memoizer", "lazy_static", "log", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "rust-embed", "thiserror", "unic-langid", @@ -1875,34 +1918,34 @@ dependencies = [ "i18n-embed", "lazy_static", "proc-macro-error", - "proc-macro2 1.0.83", - "quote 1.0.36", + "proc-macro2 1.0.89", + "quote 1.0.37", "strsim 0.10.0", - "syn 2.0.65", + "syn 2.0.86", "unic-langid", ] [[package]] name = "i18n-embed-impl" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81093c4701672f59416582fe3145676126fd23ba5db910acad0793c1108aaa58" +checksum = "0f2cc0e0523d1fe6fc2c6f66e5038624ea8091b3e7748b5e8e0c84b1698db6c2" dependencies = [ "find-crate", "i18n-config", - "proc-macro2 1.0.83", - "quote 1.0.36", - "syn 2.0.65", + "proc-macro2 1.0.89", + "quote 1.0.37", + "syn 2.0.86", ] [[package]] name = "iana-time-zone" -version = "0.1.60" +version = "0.1.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" dependencies = [ "android_system_properties", - "core-foundation-sys 0.8.6", + "core-foundation-sys 0.8.7", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", @@ -1940,18 +1983,18 @@ version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ - "autocfg 1.3.0", + "autocfg 1.4.0", "hashbrown 0.12.3", ] [[package]] name = "indexmap" -version = "2.2.6" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", - "hashbrown 0.14.5", + "hashbrown 0.15.0", ] [[package]] @@ -1984,19 +2027,19 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.9.0" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" [[package]] name = "is-terminal" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" +checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" dependencies = [ - "hermit-abi 0.3.9", + "hermit-abi 0.4.0", "libc", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] @@ -2013,18 +2056,18 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jobserver" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.69" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" dependencies = [ "wasm-bindgen", ] @@ -2063,15 +2106,15 @@ dependencies = [ [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.155" +version = "0.2.161" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" [[package]] name = "libgit2-sys" @@ -2101,15 +2144,15 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "libc", ] [[package]] name = "libz-sys" -version = "1.1.16" +version = "1.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e143b5e666b2695d28f6bca6497720813f699c9602dd7f5cac91008b8ada7f9" +checksum = "d2d16453e800a8cf6dd2fc3eb4bc99b786a9b90c663b8559a5b1a041bf89e472" dependencies = [ "cc", "libc", @@ -2167,15 +2210,15 @@ version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ - "autocfg 1.3.0", + "autocfg 1.4.0", "scopeguard", ] [[package]] name = "log" -version = "0.4.21" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" dependencies = [ "serde", ] @@ -2188,26 +2231,30 @@ checksum = "a94d21414c1f4a51209ad204c1776a3d0765002c76c6abcb602a6f09f1e881c7" [[package]] name = "log4rs" -version = "0.12.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4d8e6e1d5f89acca713132acc6034f30bad09b961d1338161bdb71c08f6e4fa" +checksum = "0816135ae15bd0391cf284eab37e6e3ee0a6ee63d2ceeb659862bd8d0a984ca6" dependencies = [ - "arc-swap 0.4.8", + "anyhow", + "arc-swap", "chrono", + "derivative", "flate2", "fnv", "humantime", "libc", "log", "log-mdc", - "parking_lot 0.10.2", + "once_cell", + "parking_lot 0.12.3", + "rand 0.8.5", "serde", "serde-value", - "serde_derive", "serde_json", "serde_yaml", + "thiserror", "thread-id", - "typemap", + "typemap-ors", "winapi 0.3.9", ] @@ -2222,9 +2269,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.2" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memmap" @@ -2244,9 +2291,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "mime_guess" -version = "2.0.4" +version = "2.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" dependencies = [ "mime", "unicase", @@ -2260,11 +2307,11 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.3" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" dependencies = [ - "adler", + "adler2", ] [[package]] @@ -2336,7 +2383,7 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c624fa1b7aab6bd2aff6e9b18565cc0363b6d45cbcd7465c9ed5e3740ebf097" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "libc", "nix 0.26.4", "smallstr", @@ -2348,19 +2395,18 @@ dependencies = [ [[package]] name = "native-tls" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" dependencies = [ - "lazy_static", "libc", "log", "openssl", "openssl-probe", "openssl-sys", "schannel", - "security-framework 2.11.0", - "security-framework-sys 2.11.0", + "security-framework 2.11.1", + "security-framework-sys 2.12.0", "tempfile", ] @@ -2443,7 +2489,7 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304" dependencies = [ - "autocfg 1.3.0", + "autocfg 1.4.0", "num-integer", "num-traits 0.2.19", ] @@ -2454,7 +2500,7 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6b19411a9719e753aff12e5187b74d60d3dc449ec3f4dc21e3989c3f554bc95" dependencies = [ - "autocfg 1.3.0", + "autocfg 1.4.0", "num-traits 0.2.19", ] @@ -2473,7 +2519,7 @@ version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" dependencies = [ - "autocfg 1.3.0", + "autocfg 1.4.0", "num-integer", "num-traits 0.2.19", ] @@ -2484,7 +2530,7 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c000134b5dbf44adc5cb772486d335293351644b801551abe8f75c84cfa4aef" dependencies = [ - "autocfg 1.3.0", + "autocfg 1.4.0", "num-bigint", "num-integer", "num-traits 0.2.19", @@ -2505,7 +2551,7 @@ version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ - "autocfg 1.3.0", + "autocfg 1.4.0", ] [[package]] @@ -2520,18 +2566,18 @@ dependencies = [ [[package]] name = "object" -version = "0.32.2" +version = "0.36.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "opaque-debug" @@ -2547,11 +2593,11 @@ checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" [[package]] name = "openssl" -version = "0.10.64" +version = "0.10.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" +checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "cfg-if 1.0.0", "foreign-types", "libc", @@ -2566,9 +2612,9 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ - "proc-macro2 1.0.83", - "quote 1.0.36", - "syn 2.0.65", + "proc-macro2 1.0.89", + "quote 1.0.37", + "syn 2.0.86", ] [[package]] @@ -2579,9 +2625,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.102" +version = "0.9.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2" +checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" dependencies = [ "cc", "libc", @@ -2591,9 +2637,9 @@ dependencies = [ [[package]] name = "ordered-float" -version = "1.1.1" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3305af35278dd29f46fcdd139e0b1fbfae2153f0e5928b39b035542dd31e37b7" +checksum = "68f19d67e5a2795c94e73e0bb1cc1a7edeb2e28efd39e2e1c9b7a40c1108b11c" dependencies = [ "num-traits 0.2.19", ] @@ -2619,9 +2665,9 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.12.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e4af0ca4f6caed20e900d564c242b8e5d4903fdacf31d3daf527b66fe6f42fb" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api 0.4.12", "parking_lot_core 0.9.10", @@ -2649,7 +2695,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if 1.0.0", "libc", - "redox_syscall 0.5.1", + "redox_syscall 0.5.7", "smallvec", "windows-targets", ] @@ -2733,22 +2779,22 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.5" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +checksum = "be57f64e946e500c8ee36ef6331845d40a93055567ec57e8fae13efd33759b95" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.5" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" dependencies = [ - "proc-macro2 1.0.83", - "quote 1.0.36", - "syn 2.0.65", + "proc-macro2 1.0.89", + "quote 1.0.37", + "syn 2.0.86", ] [[package]] @@ -2759,9 +2805,9 @@ checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" [[package]] name = "pin-project-lite" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" [[package]] name = "pin-utils" @@ -2771,9 +2817,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "poly1305" @@ -2788,9 +2834,12 @@ dependencies = [ [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] [[package]] name = "pretty_assertions" @@ -2825,8 +2874,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", - "proc-macro2 1.0.83", - "quote 1.0.36", + "proc-macro2 1.0.89", + "quote 1.0.37", "syn 1.0.109", "version_check", ] @@ -2837,8 +2886,8 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ - "proc-macro2 1.0.83", - "quote 1.0.36", + "proc-macro2 1.0.89", + "quote 1.0.37", "version_check", ] @@ -2853,9 +2902,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.83" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b33eb56c327dec362a9e55b3ad14f9d2f0904fb5a5b03b513ab5465399e9f43" +checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" dependencies = [ "unicode-ident", ] @@ -2866,12 +2915,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5520fbcd7da152a449261c5a533a1c7fad044e9e8aa9528cfec3f464786c7926" -[[package]] -name = "quick-error" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" - [[package]] name = "quote" version = "0.6.13" @@ -2883,11 +2926,11 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ - "proc-macro2 1.0.83", + "proc-macro2 1.0.89", ] [[package]] @@ -3117,11 +3160,11 @@ checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" [[package]] name = "redox_syscall" -version = "0.5.1" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" +checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", ] [[package]] @@ -3137,9 +3180,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 0.2.15", "libredox", @@ -3148,9 +3191,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.4" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", @@ -3160,9 +3203,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.6" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" dependencies = [ "aho-corasick", "memchr", @@ -3171,9 +3214,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "remove_dir_all" @@ -3212,7 +3255,7 @@ dependencies = [ "mime_guess", "native-tls", "percent-encoding", - "pin-project-lite 0.2.14", + "pin-project-lite 0.2.15", "rustls 0.18.1", "serde", "serde_urlencoded", @@ -3293,10 +3336,10 @@ version = "6.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49b94b81e5b2c284684141a2fb9e2a31be90638caf040bf9afbc5a0416afe1ac" dependencies = [ - "proc-macro2 1.0.83", - "quote 1.0.36", + "proc-macro2 1.0.89", + "quote 1.0.37", "rust-embed-utils", - "syn 2.0.65", + "syn 2.0.86", "walkdir", ] @@ -3324,15 +3367,15 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustix" -version = "0.38.34" +version = "0.38.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "aa260229e6538e52293eeb577aabd09945a09d6d9cc0fc550ed7529056c2e32a" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "errno", "libc", "linux-raw-sys", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] @@ -3375,9 +3418,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" +checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" [[package]] name = "rustyline" @@ -3430,11 +3473,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.23" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" dependencies = [ - "windows-sys", + "windows-sys 0.59.0", ] [[package]] @@ -3498,15 +3541,15 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.11.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "core-foundation 0.9.4", - "core-foundation-sys 0.8.6", + "core-foundation-sys 0.8.7", "libc", - "security-framework-sys 2.11.0", + "security-framework-sys 2.12.0", ] [[package]] @@ -3521,11 +3564,11 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.11.0" +version = "2.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317936bbbd05227752583946b9e66d7ce3b489f84e11a94a510b4437fef407d7" +checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" dependencies = [ - "core-foundation-sys 0.8.6", + "core-foundation-sys 0.8.7", "libc", ] @@ -3561,18 +3604,18 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.202" +version = "1.0.214" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "226b61a0d411b2ba5ff6d7f73a476ac4f8bb900373459cd00fab8512828ba395" +checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5" dependencies = [ "serde_derive", ] [[package]] name = "serde-value" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a65a7291a8a568adcae4c10a677ebcedbc6c9cec91c054dee2ce40b0e3290eb" +checksum = "f3a1a3341211875ef120e117ea7fd5228530ae7e7036a779fdc9117be6b3282c" dependencies = [ "ordered-float", "serde", @@ -3580,35 +3623,27 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.202" +version = "1.0.214" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6048858004bcff69094cd972ed40a32500f153bd3be9f716b2eed2e8217c4838" +checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" dependencies = [ - "proc-macro2 1.0.83", - "quote 1.0.36", - "syn 2.0.65", + "proc-macro2 1.0.89", + "quote 1.0.37", + "syn 2.0.86", ] [[package]] name = "serde_json" -version = "1.0.117" +version = "1.0.132" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" +checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" dependencies = [ "itoa 1.0.11", + "memchr", "ryu", "serde", ] -[[package]] -name = "serde_spanned" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" -dependencies = [ - "serde", -] - [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -3639,21 +3674,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e182d6ec6f05393cc0e5ed1bf81ad6db3a8feedf8ee515ecdd369809bcce8082" dependencies = [ "darling", - "proc-macro2 1.0.83", - "quote 1.0.36", + "proc-macro2 1.0.89", + "quote 1.0.37", "syn 1.0.109", ] [[package]] name = "serde_yaml" -version = "0.8.26" +version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578a7433b776b56a35785ed5ce9a7e777ac0598aac5a6dd1b4b18a307c7fc71b" +checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 1.9.3", + "indexmap 2.6.0", + "itoa 1.0.11", "ryu", "serde", - "yaml-rust 0.4.5", + "unsafe-libyaml", ] [[package]] @@ -3693,6 +3729,12 @@ dependencies = [ "opaque-debug 0.2.3", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "signal-hook-registry" version = "1.4.2" @@ -3720,7 +3762,7 @@ version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ - "autocfg 1.3.0", + "autocfg 1.4.0", ] [[package]] @@ -3780,8 +3822,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87c85aa3f8ea653bfd3ddf25f7ee357ee4d204731f6aa9ad04002306f6e2774c" dependencies = [ "heck", - "proc-macro2 1.0.83", - "quote 1.0.36", + "proc-macro2 1.0.89", + "quote 1.0.37", "syn 1.0.109", ] @@ -3814,19 +3856,19 @@ version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ - "proc-macro2 1.0.83", - "quote 1.0.36", + "proc-macro2 1.0.89", + "quote 1.0.37", "unicode-ident", ] [[package]] name = "syn" -version = "2.0.65" +version = "2.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2863d96a84c6439701d7a38f9de935ec562c8832cc55d1dde0f513b52fad106" +checksum = "e89275301d38033efb81a6e60e3497e734dfcc62571f2854bf4b16690398824c" dependencies = [ - "proc-macro2 1.0.83", - "quote 1.0.36", + "proc-macro2 1.0.89", + "quote 1.0.37", "unicode-ident", ] @@ -3837,7 +3879,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd727fc423c2060f6c92d9534cef765c65a6ed3f428a03d7def74a8c4348e666" dependencies = [ "cfg-if 1.0.0", - "core-foundation-sys 0.8.6", + "core-foundation-sys 0.8.7", "libc", "ntapi", "once_cell", @@ -3847,14 +3889,15 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.10.1" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" dependencies = [ "cfg-if 1.0.0", "fastrand", + "once_cell", "rustix", - "windows-sys", + "windows-sys 0.59.0", ] [[package]] @@ -3902,32 +3945,31 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.61" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +checksum = "5d171f59dbaa811dbbb1aee1e73db92ec2b122911a48e1390dfe327a821ddede" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.61" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +checksum = "b08be0f17bd307950653ce45db00cd31200d82b624b36e181337d9c7d92765b5" dependencies = [ - "proc-macro2 1.0.83", - "quote 1.0.36", - "syn 2.0.65", + "proc-macro2 1.0.89", + "quote 1.0.37", + "syn 2.0.86", ] [[package]] name = "thread-id" -version = "3.3.0" +version = "4.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7fbf4c9d56b320106cd64fd024dadfa0be7cb4706725fc44a7d7ce952d820c1" +checksum = "cfe8f25bbdd100db7e1d34acf7fd2dc59c4bf8f7483f505eaa7d4f12f76cc0ea" dependencies = [ "libc", - "redox_syscall 0.1.57", "winapi 0.3.9", ] @@ -3942,18 +3984,18 @@ dependencies = [ [[package]] name = "tinystr" -version = "0.7.5" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83c02bf3c538ab32ba913408224323915f4ef9a6d61c0e85d493f355921c0ece" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" dependencies = [ "displaydoc", ] [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" dependencies = [ "tinyvec_macros", ] @@ -4004,8 +4046,8 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e44da00bfc73a25f814cd8d7e57a68a5c31b74b3152a0a1d1f590c97ed06265a" dependencies = [ - "proc-macro2 1.0.83", - "quote 1.0.36", + "proc-macro2 1.0.89", + "quote 1.0.37", "syn 1.0.109", ] @@ -4041,7 +4083,7 @@ checksum = "d611fd5d241872372d52a0a3d309c52d0b95a6a67671a6c8f7ab2c4a37fb2539" dependencies = [ "bytes 0.4.12", "either", - "futures 0.3.30", + "futures 0.3.31", "thiserror", "tokio", ] @@ -4079,45 +4121,11 @@ dependencies = [ "serde", ] -[[package]] -name = "toml" -version = "0.8.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4e43f8cc456c9704c851ae29c67e17ef65d2c30017c17a9765b89c382dc8bba" -dependencies = [ - "serde", - "serde_spanned", - "toml_datetime", - "toml_edit", -] - -[[package]] -name = "toml_datetime" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" -dependencies = [ - "serde", -] - -[[package]] -name = "toml_edit" -version = "0.22.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c127785850e8c20836d49732ae6abfa47616e60bf9d9f57c43c250361a9db96c" -dependencies = [ - "indexmap 2.2.6", - "serde", - "serde_spanned", - "toml_datetime", - "winnow", -] - [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" @@ -4126,7 +4134,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ "log", - "pin-project-lite 0.2.14", + "pin-project-lite 0.2.15", "tracing-core", ] @@ -4149,12 +4157,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "traitobject" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079" - [[package]] name = "try-lock" version = "0.2.5" @@ -4171,12 +4173,12 @@ dependencies = [ ] [[package]] -name = "typemap" -version = "0.3.3" +name = "typemap-ors" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "653be63c80a3296da5551e1bfd2cca35227e13cdd08c6668903ae2f4f77aa1f6" +checksum = "a68c24b707f02dd18f1e4ccceb9d49f2058c2fb86384ef9972592904d7a28867" dependencies = [ - "unsafe-any", + "unsafe-any-ors", ] [[package]] @@ -4206,45 +4208,42 @@ dependencies = [ [[package]] name = "unicase" -version = "2.7.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" -dependencies = [ - "version_check", -] +checksum = "7e51b68083f157f853b6379db119d1c1be0e6e4dec98101079dec41f6f5cf6df" [[package]] name = "unicode-bidi" -version = "0.3.15" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" +checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" [[package]] name = "unicode-normalization" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" dependencies = [ "tinyvec", ] [[package]] name = "unicode-segmentation" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" [[package]] name = "unicode-width" -version = "0.1.12" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" [[package]] name = "unicode-xid" @@ -4263,14 +4262,20 @@ dependencies = [ ] [[package]] -name = "unsafe-any" -version = "0.4.2" +name = "unsafe-any-ors" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30360d7979f5e9c6e6cea48af192ea8fab4afb3cf72597154b8f08935bc9c7f" +checksum = "e0a303d30665362d9680d7d91d78b23f5f899504d4f08b3c4cf08d055d87c0ad" dependencies = [ - "traitobject", + "destructure_traitobject", ] +[[package]] +name = "unsafe-libyaml" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" + [[package]] name = "untrusted" version = "0.7.1" @@ -4279,9 +4284,9 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "url" -version = "2.5.0" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna", @@ -4290,9 +4295,9 @@ dependencies = [ [[package]] name = "utf8parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" @@ -4318,9 +4323,9 @@ checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "walkdir" @@ -4355,11 +4360,12 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.92" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" dependencies = [ "cfg-if 1.0.0", + "once_cell", "serde", "serde_json", "wasm-bindgen-macro", @@ -4367,24 +4373,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.92" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" dependencies = [ "bumpalo", "log", "once_cell", - "proc-macro2 1.0.83", - "quote 1.0.36", - "syn 2.0.65", + "proc-macro2 1.0.89", + "quote 1.0.37", + "syn 2.0.86", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.42" +version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -4394,38 +4400,38 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" dependencies = [ - "quote 1.0.36", + "quote 1.0.37", "wasm-bindgen-macro-support", ] [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ - "proc-macro2 1.0.83", - "quote 1.0.36", - "syn 2.0.65", + "proc-macro2 1.0.89", + "quote 1.0.37", + "syn 2.0.86", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" [[package]] name = "web-sys" -version = "0.3.69" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" dependencies = [ "js-sys", "wasm-bindgen", @@ -4480,11 +4486,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys", + "windows-sys 0.59.0", ] [[package]] @@ -4512,10 +4518,19 @@ dependencies = [ ] [[package]] -name = "windows-targets" -version = "0.52.5" +name = "windows-sys" +version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", @@ -4529,60 +4544,51 @@ dependencies = [ [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" - -[[package]] -name = "winnow" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3c52e9c97a68071b23e836c9380edae937f17b9c4667bd021973efc689f618d" -dependencies = [ - "memchr", -] +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winreg" @@ -4632,19 +4638,31 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e66366e18dc58b46801afbf2ca7661a9f59cc8c5962c29892b6039b4f86fa992" [[package]] -name = "yaml-rust" -version = "0.4.5" +name = "zerocopy" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ - "linked-hash-map", + "byteorder", + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2 1.0.89", + "quote 1.0.37", + "syn 2.0.86", ] [[package]] name = "zeroize" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" dependencies = [ "zeroize_derive", ] @@ -4655,9 +4673,9 @@ version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ - "proc-macro2 1.0.83", - "quote 1.0.36", - "syn 2.0.65", + "proc-macro2 1.0.89", + "quote 1.0.37", + "syn 2.0.86", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 2e50aec..a70b09a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "grin_wallet" -version = "5.4.0-contracts.0" +version = "5.4.0-alpha.1" authors = ["Grin Developers "] description = "Simple, private and scalable cryptocurrency implementation based on the MimbleWimble chain format." license = "Apache-2.0" @@ -30,21 +30,21 @@ semver = "0.10" rustyline = "6" lazy_static = "1" -grin_wallet_api = { path = "./api", version = "5.4.0-contracts.0" } -grin_wallet_impls = { path = "./impls", version = "5.4.0-contracts.0" } -grin_wallet_libwallet = { path = "./libwallet", version = "5.4.0-contracts.0" } -grin_wallet_controller = { path = "./controller", version = "5.4.0-contracts.0" } -grin_wallet_config = { path = "./config", version = "5.4.0-contracts.0" } -grin_wallet_util = { path = "./util", version = "5.4.0-contracts.0" } +grin_wallet_api = { path = "./api", version = "5.4.0-alpha.1" } +grin_wallet_impls = { path = "./impls", version = "5.4.0-alpha.1" } +grin_wallet_libwallet = { path = "./libwallet", version = "5.4.0-alpha.1" } +grin_wallet_controller = { path = "./controller", version = "5.4.0-alpha.1" } +grin_wallet_config = { path = "./config", version = "5.4.0-alpha.1" } +grin_wallet_util = { path = "./util", version = "5.4.0-alpha.1" } ##### Grin Imports # For Release -# grin_core = "5.4.0-contracts.0" -# grin_keychain = "5.4.0-contracts.0" -# grin_util = "5.4.0-contracts.0" -# grin_api = "5.4.0-contracts.0" +grin_core = "5.3.3" +grin_keychain = "5.3.3" +grin_util = "5.3.3" +grin_api = "5.3.3" # For beta release @@ -54,10 +54,10 @@ grin_wallet_util = { path = "./util", version = "5.4.0-contracts.0" } # grin_api = { git = "https://github.com/mimblewimble/grin", tag = "v5.2.0-beta.3" } # For bleeding edge -grin_core = { git = "https://github.com/mimblewimble/grin", branch = "master" } -grin_keychain = { git = "https://github.com/mimblewimble/grin", branch = "master" } -grin_util = { git = "https://github.com/mimblewimble/grin", branch = "master" } -grin_api = { git = "https://github.com/mimblewimble/grin", branch = "master" } +# grin_core = { git = "https://github.com/mimblewimble/grin", branch = "master" } +# grin_keychain = { git = "https://github.com/mimblewimble/grin", branch = "master" } +# grin_util = { git = "https://github.com/mimblewimble/grin", branch = "master" } +# grin_api = { git = "https://github.com/mimblewimble/grin", branch = "master" } # For local testing # grin_core = { path = "../grin/core"} diff --git a/api/Cargo.toml b/api/Cargo.toml index 4fcf617..d2f1f2f 100644 --- a/api/Cargo.toml +++ b/api/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "grin_wallet_api" -version = "5.4.0-contracts.0" +version = "5.4.0-alpha.1" authors = ["Grin Developers "] description = "Grin Wallet API" license = "Apache-2.0" @@ -22,17 +22,17 @@ ring = "0.16" base64 = "0.12" ed25519-dalek = "1.0.0-pre.4" -grin_wallet_libwallet = { path = "../libwallet", version = "5.4.0-contracts.0" } -grin_wallet_config = { path = "../config", version = "5.4.0-contracts.0" } -grin_wallet_impls = { path = "../impls", version = "5.4.0-contracts.0" } -grin_wallet_util = { path = "../util", version = "5.4.0-contracts.0" } +grin_wallet_libwallet = { path = "../libwallet", version = "5.4.0-alpha.1" } +grin_wallet_config = { path = "../config", version = "5.4.0-alpha.1" } +grin_wallet_impls = { path = "../impls", version = "5.4.0-alpha.1" } +grin_wallet_util = { path = "../util", version = "5.4.0-alpha.1" } ##### Grin Imports # For Release -# grin_core = "5.4.0-contracts.0" -# grin_keychain = "5.4.0-contracts.0" -# grin_util = "5.4.0-contracts.0" +grin_core = "5.3.3" +grin_keychain = "5.3.3" +grin_util = "5.3.3" # For beta release @@ -41,9 +41,9 @@ grin_wallet_util = { path = "../util", version = "5.4.0-contracts.0" } # grin_util = { git = "https://github.com/mimblewimble/grin", tag = "v5.2.0-beta.3" } # For bleeding edge -grin_core = { git = "https://github.com/mimblewimble/grin", branch = "master" } -grin_keychain = { git = "https://github.com/mimblewimble/grin", branch = "master" } -grin_util = { git = "https://github.com/mimblewimble/grin", branch = "master" } +# grin_core = { git = "https://github.com/mimblewimble/grin", branch = "master" } +# grin_keychain = { git = "https://github.com/mimblewimble/grin", branch = "master" } +# grin_util = { git = "https://github.com/mimblewimble/grin", branch = "master" } # For local testing # grin_core = { path = "../../grin/core"} diff --git a/api/src/owner.rs b/api/src/owner.rs index fa7157d..8d4fee2 100644 --- a/api/src/owner.rs +++ b/api/src/owner.rs @@ -17,6 +17,7 @@ use chrono::prelude::*; use ed25519_dalek::SecretKey as DalekSecretKey; use grin_wallet_libwallet::contract::proofs::InvoiceProof; +use grin_wallet_libwallet::mwixnet::{MixnetReqCreationParams, SwapReq}; use grin_wallet_libwallet::RetrieveTxQueryArgs; use uuid::Uuid; @@ -31,7 +32,6 @@ use crate::libwallet::api_impl::{owner, owner_updater}; use crate::libwallet::contract::types::{ ContractNewArgsAPI, ContractRevokeArgsAPI, ContractSetupArgsAPI, }; -use crate::libwallet::mwixnet::types::{MixnetReqCreationParams, SwapReq}; use crate::libwallet::{ AcctPathMapping, BuiltOutput, Error, InitTxArgs, IssueInvoiceTxArgs, NodeClient, NodeHeightResult, OutputCommitMapping, PaymentProof, Slate, Slatepack, SlatepackAddress, @@ -40,6 +40,7 @@ use crate::libwallet::{ use crate::util::logger::LoggingConfig; use crate::util::secp::key::SecretKey; use crate::util::secp::pedersen; +use crate::util::secp::pedersen::Commitment; use crate::util::{from_hex, static_secp_instance, Mutex, ZeroingString}; use grin_wallet_util::OnionV3Address; use std::convert::TryFrom; @@ -831,19 +832,6 @@ where owner::contract_revoke(&mut **w, keychain_mask, &args) } - /// Create MXMixnet request - pub fn create_mwixnet_req( - &self, - keychain_mask: Option<&SecretKey>, - params: &MixnetReqCreationParams, - commitment: &pedersen::Commitment, - lock_output: bool, // use_test_rng: bool, - ) -> Result { - let mut w_lock = self.wallet_inst.lock(); - let w = w_lock.lc_provider()?.wallet_inst()?; - owner::create_mwixnet_req(&mut **w, keychain_mask, params, commitment, lock_output) - } - /// Processes an invoice tranaction created by another party, essentially /// a `request for payment`. The incoming slate should contain a requested /// amount, an output created by the invoicer convering the amount, and @@ -2527,6 +2515,71 @@ where let w = w_lock.lc_provider()?.wallet_inst()?; owner::build_output(&mut **w, keychain_mask, features, amount) } + + // MWIXNET + + /// Creates an mwixnet request [SwapReq](../grin_wallet_libwallet/api_impl/types/struct.SwapReq.html) + /// from a given output commitment under this wallet's control. + /// + /// # Arguments + /// * `keychain_mask` - Wallet secret mask to XOR against the stored wallet seed before using, if + /// being used. + /// * `params` - A [MixnetReqCreationParams](../grin_wallet_libwallet/api_impl/types/struct.MixnetReqCreationParams.html) + /// struct containing the parameters for the request, which include: + /// `server_keys` - The public keys of the servers participating in the mixnet (each encoded internally as a `SecretKey`) + /// `fee_per_hop` - The fee to be paid to each server for each hop in the mixnet + /// * `commitment` - The commitment of the output to be mixed + /// * `lock_output` - Whether to lock the referenced output after creating the request + /// + /// # Returns + /// * Ok([SwapReq](../grin_wallet_libwallet/api_impl/types/struct.SwapReq.html)) if successful + /// * or [`libwallet::Error`](../grin_wallet_libwallet/struct.Error.html) if an error is encountered + /// + /// # Example + /// Set up as in [`new`](struct.Owner.html#method.new) method above. + /// ``` + /// # grin_wallet_api::doctest_helper_setup_doc_env!(wallet, wallet_config); + /// + /// let api_owner = Owner::new(wallet.clone(), None); + /// let keychain_mask = None; + /// let params = MixnetReqCreationParams { + /// server_keys: vec![], // Public keys here in secret key representation + /// fee_per_hop: 100, + /// }; + /// + /// let commitment = Commitment::from_vec(vec![0; 32]); + /// let lock_output = true; + /// + /// let result = api_owner.create_mwixnet_req( + /// keychain_mask, + /// ¶ms, + /// &commitment, + /// lock_output, + /// ); + /// + /// if let Ok(req) = result { + /// //... + /// } + /// ``` + + pub fn create_mwixnet_req( + &self, + keychain_mask: Option<&SecretKey>, + params: &MixnetReqCreationParams, + commitment: &Commitment, + lock_output: bool, // use_test_rng: bool, + ) -> Result { + let mut w_lock = self.wallet_inst.lock(); + let w = w_lock.lc_provider()?.wallet_inst()?; + owner::create_mwixnet_req( + &mut **w, + keychain_mask, + params, + commitment, + lock_output, + self.doctest_mode, + ) + } } /// attempt to send slate synchronously with TOR @@ -2628,13 +2681,17 @@ macro_rules! doctest_helper_setup_doc_env { use keychain::ExtKeychain; use tempfile::tempdir; + use grin_util::secp::pedersen::Commitment; use std::sync::Arc; use util::{Mutex, ZeroingString}; use api::{Foreign, Owner}; use config::WalletConfig; use impls::{DefaultLCProvider, DefaultWalletImpl, HTTPNodeClient}; - use libwallet::{BlockFees, InitTxArgs, IssueInvoiceTxArgs, Slate, WalletInst}; + use libwallet::{ + mwixnet::MixnetReqCreationParams, BlockFees, InitTxArgs, IssueInvoiceTxArgs, Slate, + WalletInst, + }; use uuid::Uuid; diff --git a/api/src/owner_rpc.rs b/api/src/owner_rpc.rs index 18a25cc..32b0266 100644 --- a/api/src/owner_rpc.rs +++ b/api/src/owner_rpc.rs @@ -14,6 +14,7 @@ //! JSON-RPC Stub generation for the Owner API use grin_wallet_libwallet::RetrieveTxQueryArgs; +use libwallet::mwixnet::SwapReq; use uuid::Uuid; use crate::config::{TorConfig, WalletConfig}; @@ -24,14 +25,15 @@ use crate::libwallet::contract::types::{ ContractNewArgsAPI, ContractRevokeArgsAPI, ContractSetupArgsAPI, }; use crate::libwallet::{ - AcctPathMapping, Amount, BuiltOutput, Error, InitTxArgs, IssueInvoiceTxArgs, NodeClient, - NodeHeightResult, OutputCommitMapping, PaymentProof, Slate, SlateVersion, Slatepack, - SlatepackAddress, StatusMessage, TxLogEntry, VersionedSlate, ViewWallet, WalletInfo, - WalletLCProvider, + mwixnet::MixnetReqCreationParams, AcctPathMapping, Amount, BuiltOutput, Error, InitTxArgs, + IssueInvoiceTxArgs, NodeClient, NodeHeightResult, OutputCommitMapping, PaymentProof, Slate, + SlateVersion, Slatepack, SlatepackAddress, StatusMessage, TxLogEntry, VersionedSlate, + ViewWallet, WalletInfo, WalletLCProvider, }; use crate::util::logger::LoggingConfig; use crate::util::secp::key::{PublicKey, SecretKey}; -use crate::util::{static_secp_instance, Mutex, ZeroingString}; +use crate::util::secp::pedersen::Commitment; +use crate::util::{from_hex, static_secp_instance, Mutex, ZeroingString}; use crate::{ECDHPubkey, Ed25519SecretKey, Owner, Token}; use easy_jsonrpc_mw; use grin_wallet_util::OnionV3Address; @@ -2007,6 +2009,63 @@ pub trait OwnerRpc { features: OutputFeatures, amount: Amount, ) -> Result; + + /** + Networked version of [Owner::build_output](struct.Owner.html#method.create_mwixnet_req). + ``` + # grin_wallet_api::doctest_helper_json_rpc_owner_assert_response!( + # r#" + { + "jsonrpc": "2.0", + "method": "create_mwixnet_req", + "params": { + "token": "d202964900000000d302964900000000d402964900000000d502964900000000", + "commitment": "08e1da9e6dc4d6e808a718b2f110a991dd775d65ce5ae408a4e1f002a4961aa9e7", + "fee_per_hop": "5000000", + "lock_output": true, + "server_keys": [ + "97444ae673bb92c713c1a2f7b8882ffbfc1c67401a280a775dce1a8651584332", + "0c9414341f2140ed34a5a12a6479bf5a6404820d001ab81d9d3e8cc38f049b4e", + "b58ece97d60e71bb7e53218400b0d67bfe6a3cb7d3b4a67a44f8fb7c525cbca5" + ] + }, + "id": 1 + } + # "# + # , + # r#" + { + "id": 1, + "jsonrpc": "2.0", + "result": { + "Ok": { + "comsig": "099561ed0be59f6502ee358ee4f6760cd16d6be04d58d7a2c1bf2fd09dd7fd2d291beaae5483c6f18d1ceaae6321f06f9ba129a1ee9e7d15f152c67397a621538b5c10bbeb95140dee815c02657c91152939afe389458dc59af095e8e8e5c81a08", + "onion": { + "commit": "08e1da9e6dc4d6e808a718b2f110a991dd775d65ce5ae408a4e1f002a4961aa9e7", + "data": [ + "37f68116475e1aa6b58fc911addbd0e04e7aa19ab3e82e7b5cfcaf57d82cf35e7388ce51711cc5ef8cf7630f7dc7229878f91c7ec85991a7fc0051a7bbc66569db3a3aa89ef490055f3c", + "b9ff8c0c1699808efce46d581647c65764a28e813023ae677d688282422a07505ae1a051037d7ba58f3279846d0300800fc1c5bfcc548dab815e9fd2f29df9515170c41fa6e4e44b8bcb", + "62ea6b8369686a0415e1e752b9b4d6e66cf5b6066a2d3c60d8818890a55f3adff4601466f4c6e6b646568b99ae93549a3595b7a7b4be815ced87d9297cabbd69518d7b2ed6edd14007528fd346aaea765a1165fe886666627ebcab9588b8ee1c9e98395ae67913c48eb6e924581b40182fce807f97312fb07fd5e216d99941f2b488babce4078a50cd66b28b30a66c4f54fcc127437408a99b30ffd6c3d0d8c7d39e864fc04e321b8c10138c8852d4cad0a4f2780412b9dadcc6e0f2657b7803a81bccb809ca392464be2e01755be7377d0e815698ad6ea51d4617cc92c3ccf852f038e33cc9c90992438ba5c49cca7cc188b682da684e2f4c9733a84a7b64ac5c2216ebf5926f0ee67b664fb5bab799109cbee755ce1aebc8cd352fea51cd84c333cb958093c53544c3f3ab05dba64d8f041c3b179796b476ec04b11044e39db6994ab767315e52cc0ef023432ec88ade2911612db7e74e0923889f765b58b00e3869c5072a4e882c1b721913f63bda986b8c97b7ae575f0d4be596a1ac3cd0db96ce6074ee000b32018b3bda16d7dba34a13ba9c3ce983946414c16e278351a3411cb8ef2cb8ef5b6e1667c4c58bc797c0324ae4fec8960d684e561c0e833ee4c3331c6c439b59042a62993535e23cc8a8a4cf705c0f9b1d62db4e3d76c22c01138800414b143ddff471e4df4413e842a1b41f43cc9647e47145fd6c86d4d1a34fb2f62f5a55b31c9353ee34743c548eff955f2d2143c1a86cbcb452104f96d0142db31153021bbeed995c71a92de8fb1f97269533a508085c543fcb3ee57000bb265e74187b858403aa97b6c7b085e5d5b6025cbfe5f6926d33c835f90e60fc62013e80bbe0a855da5938b4b8f83ac29c5e8251827795356222079a6d1612e2fdf93bd7836d1613c7a353ada48ce256f880bbbb3108e037e3b5647101bd4d549101b0ee73d2248a932a802a3b1beb0b69d777c4285d57e91d83e96fe2f8a1a2f182fe2c6ca37b18460cf8d7f56c201147b9be19f1d01f8ad305c1e9c4dd79b5d8719d6550432352cf737082b1e9de7a083ffbe1" + ], + "pubkey": "e7ee7d51b11d09f268ade98bc9d7ae9be3c4ac124ce1c3a40e50d34460fa5f08" + } + } + } + } + # "# + # , 5, true, true, false, false); + ``` + * + */ + + fn create_mwixnet_req( + &self, + token: Token, + commitment: String, + fee_per_hop: String, + lock_output: bool, + server_keys: Vec, + ) -> Result; } impl OwnerRpc for Owner @@ -2475,6 +2534,44 @@ where ) -> Result { Owner::build_output(self, (&token.keychain_mask).as_ref(), features, amount.0) } + + fn create_mwixnet_req( + &self, + token: Token, + commitment: String, + fee_per_hop: String, + lock_output: bool, + server_keys: Vec, + ) -> Result { + let commit = + Commitment::from_vec(from_hex(&commitment).map_err(|e| Error::CommitDeser(e))?); + + let secp_inst = static_secp_instance(); + let secp = secp_inst.lock(); + + let mut keys = vec![]; + for key in server_keys { + keys.push(SecretKey::from_slice( + &secp, + &grin_util::from_hex(&key).map_err(|e| Error::ServerKeyDeser(e))?, + )?) + } + + let req_params = MixnetReqCreationParams { + server_keys: keys, + fee_per_hop: fee_per_hop + .parse::() + .map_err(|_| Error::U64Deser(fee_per_hop))?, + }; + + Owner::create_mwixnet_req( + self, + (&token.keychain_mask).as_ref(), + &req_params, + &commit, + lock_output, + ) + } } /// helper to set up a real environment to run integrated doctests diff --git a/config/Cargo.toml b/config/Cargo.toml index 9d956f8..9d329c7 100644 --- a/config/Cargo.toml +++ b/config/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "grin_wallet_config" -version = "5.4.0-contracts.0" +version = "5.4.0-alpha.1" authors = ["Grin Developers "] description = "Configuration for grin wallet , a simple, private and scalable cryptocurrency implementation based on the MimbleWimble chain format." license = "Apache-2.0" @@ -16,13 +16,13 @@ serde_derive = "1" toml = "0.5" dirs = "2.0" -grin_wallet_util = { path = "../util", version = "5.4.0-contracts.0" } +grin_wallet_util = { path = "../util", version = "5.4.0-alpha.1" } ##### Grin Imports # For Release -# grin_core = "5.4.0-contracts.0" -# grin_util = "5.4.0-contracts.0" +grin_core = "5.3.3" +grin_util = "5.3.3" # For beta release @@ -30,8 +30,8 @@ grin_wallet_util = { path = "../util", version = "5.4.0-contracts.0" } #grin_util = { git = "https://github.com/mimblewimble/grin", tag = "v5.2.0-beta.3" } # For bleeding edge -grin_core = { git = "https://github.com/mimblewimble/grin", branch = "master" } -grin_util = { git = "https://github.com/mimblewimble/grin", branch = "master" } +# grin_core = { git = "https://github.com/mimblewimble/grin", branch = "master" } +# grin_util = { git = "https://github.com/mimblewimble/grin", branch = "master" } # For local testing # grin_core = { path = "../../grin/core"} diff --git a/controller/Cargo.toml b/controller/Cargo.toml index 7973f00..33a9172 100644 --- a/controller/Cargo.toml +++ b/controller/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "grin_wallet_controller" -version = "5.4.0-contracts.0" +version = "5.4.0-alpha.1" authors = ["Grin Developers "] description = "Controllers for grin wallet instantiation" license = "Apache-2.0" @@ -30,19 +30,19 @@ lazy_static = "1" thiserror = "1" qr_code = "1.1.0" -grin_wallet_util = { path = "../util", version = "5.4.0-contracts.0" } -grin_wallet_api = { path = "../api", version = "5.4.0-contracts.0" } -grin_wallet_impls = { path = "../impls", version = "5.4.0-contracts.0" } -grin_wallet_libwallet = { path = "../libwallet", version = "5.4.0-contracts.0" } -grin_wallet_config = { path = "../config", version = "5.4.0-contracts.0" } +grin_wallet_util = { path = "../util", version = "5.4.0-alpha.1" } +grin_wallet_api = { path = "../api", version = "5.4.0-alpha.1" } +grin_wallet_impls = { path = "../impls", version = "5.4.0-alpha.1" } +grin_wallet_libwallet = { path = "../libwallet", version = "5.4.0-alpha.1" } +grin_wallet_config = { path = "../config", version = "5.4.0-alpha.1" } ##### Grin Imports # For Release -# grin_core = "5.4.0-contracts.0" -# grin_keychain = "5.4.0-contracts.0" -# grin_util = "5.4.0-contracts.0" -# grin_api = "5.4.0-contracts.0" +grin_core = "5.3.3" +grin_keychain = "5.3.3" +grin_util = "5.3.3" +grin_api = "5.3.3" # For beta release @@ -52,10 +52,10 @@ grin_wallet_config = { path = "../config", version = "5.4.0-contracts.0" } # grin_api = { git = "https://github.com/mimblewimble/grin", tag = "v5.2.0-beta.3" } # For bleeding edge -grin_core = { git = "https://github.com/mimblewimble/grin", branch = "master" } -grin_keychain = { git = "https://github.com/mimblewimble/grin", branch = "master" } -grin_util = { git = "https://github.com/mimblewimble/grin", branch = "master" } -grin_api = { git = "https://github.com/mimblewimble/grin", branch = "master" } +# grin_core = { git = "https://github.com/mimblewimble/grin", branch = "master" } +# grin_keychain = { git = "https://github.com/mimblewimble/grin", branch = "master" } +# grin_util = { git = "https://github.com/mimblewimble/grin", branch = "master" } +# grin_api = { git = "https://github.com/mimblewimble/grin", branch = "master" } # For local testing # grin_core = { path = "../../grin/core"} @@ -72,14 +72,14 @@ remove_dir_all = "0.7" ##### Grin Imports # For Release -# grin_chain = "5.4.0-contracts.0" +grin_chain = "5.3.3" # For beta release # grin_chain = { git = "https://github.com/mimblewimble/grin", tag = "v5.2.0-beta.3" } # For bleeding edge -grin_chain = { git = "https://github.com/mimblewimble/grin", branch = "master" } +# grin_chain = { git = "https://github.com/mimblewimble/grin", branch = "master" } # For local testing # grin_chain = { path = "../../grin/chain"} diff --git a/controller/tests/invoice.rs b/controller/tests/invoice.rs index b1adaa5..2fe7d64 100644 --- a/controller/tests/invoice.rs +++ b/controller/tests/invoice.rs @@ -82,16 +82,16 @@ fn invoice_tx_impl(test_dir: &'static str) -> Result<(), libwallet::Error> { wallet_inst!(wallet1, w); w.set_parent_key_id_by_name("mining")?; } - let mut bh = 10u64; + let mut _bh = 10u64; let _ = - test_framework::award_blocks_to_wallet(&chain, wallet1.clone(), mask1, bh as usize, false); + test_framework::award_blocks_to_wallet(&chain, wallet1.clone(), mask1, _bh as usize, false); // Sanity check wallet 1 contents wallet::controller::owner_single_use(Some(wallet1.clone()), mask1, None, |api, m| { let (wallet1_refreshed, wallet1_info) = api.retrieve_summary_info(m, true, 1)?; assert!(wallet1_refreshed); - assert_eq!(wallet1_info.last_confirmed_height, bh); - assert_eq!(wallet1_info.total, bh * reward); + assert_eq!(wallet1_info.last_confirmed_height, _bh); + assert_eq!(wallet1_info.total, _bh * reward); Ok(()) })?; @@ -138,10 +138,10 @@ fn invoice_tx_impl(test_dir: &'static str) -> Result<(), libwallet::Error> { api.post_tx(m, &slate, false)?; Ok(()) })?; - bh += 1; + _bh += 1; let _ = test_framework::award_blocks_to_wallet(&chain, wallet1.clone(), mask1, 3, false); - bh += 3; + _bh += 3; // Check transaction log for wallet 2 wallet::controller::owner_single_use(Some(wallet2.clone()), mask2, None, |api, m| { @@ -151,7 +151,7 @@ fn invoice_tx_impl(test_dir: &'static str) -> Result<(), libwallet::Error> { assert!(txs.len() == 1); println!( "last confirmed height: {}, bh: {}", - wallet2_info.last_confirmed_height, bh + wallet2_info.last_confirmed_height, _bh ); assert!(refreshed); Ok(()) @@ -163,10 +163,10 @@ fn invoice_tx_impl(test_dir: &'static str) -> Result<(), libwallet::Error> { let (_, wallet1_info) = api.retrieve_summary_info(m, true, 1)?; let (refreshed, txs) = api.retrieve_txs(m, true, None, None, None)?; assert!(refreshed); - assert_eq!(txs.len() as u64, bh + 1); + assert_eq!(txs.len() as u64, _bh + 1); println!( "Wallet 1: last confirmed height: {}, bh: {}", - wallet1_info.last_confirmed_height, bh + wallet1_info.last_confirmed_height, _bh ); Ok(()) })?; @@ -248,7 +248,7 @@ fn invoice_tx_impl(test_dir: &'static str) -> Result<(), libwallet::Error> { // test that payee can only cancel once let _ = test_framework::award_blocks_to_wallet(&chain, wallet1.clone(), mask1, 3, false); - bh += 3; + _bh += 3; wallet::controller::owner_single_use(Some(wallet2.clone()), mask2, None, |api, m| { // Wallet 2 inititates an invoice transaction, requesting payment diff --git a/controller/tests/mwixnet.rs b/controller/tests/mwixnet.rs new file mode 100644 index 0000000..0db537d --- /dev/null +++ b/controller/tests/mwixnet.rs @@ -0,0 +1,190 @@ +// Copyright 2024 The Grin Developers +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Test a wallet sending to self, then creation of comsig request +#[macro_use] +extern crate log; +extern crate grin_wallet_controller as wallet; +extern crate grin_wallet_impls as impls; + +use grin_core as core; +use grin_util as util; +use grin_util::secp::key::SecretKey; + +use grin_wallet_libwallet as libwallet; +use impls::test_framework::{self, LocalWalletClient}; +use libwallet::{mwixnet::MixnetReqCreationParams, InitTxArgs}; +use std::sync::atomic::Ordering; +use std::thread; +use std::time::Duration; + +#[macro_use] +mod common; +use common::{clean_output_dir, create_wallet_proxy, setup}; + +/// self send impl +fn mwixnet_test_impl(test_dir: &'static str) -> Result<(), libwallet::Error> { + // Create a new proxy to simulate server and wallet responses + let mut wallet_proxy = create_wallet_proxy(test_dir); + let chain = wallet_proxy.chain.clone(); + let stopper = wallet_proxy.running.clone(); + + // Create a new wallet test client, and set its queues to communicate with the + // proxy + create_wallet_and_add!( + client1, + wallet1, + mask1_i, + test_dir, + "wallet1", + None, + &mut wallet_proxy, + true + ); + let mask1 = (&mask1_i).as_ref(); + + // Set the wallet proxy listener running + thread::spawn(move || { + if let Err(e) = wallet_proxy.run() { + error!("Wallet Proxy error: {}", e); + } + }); + + // few values to keep things shorter + let reward = core::consensus::REWARD; + + // add some accounts + wallet::controller::owner_single_use(Some(wallet1.clone()), mask1, None, |api, m| { + api.create_account_path(m, "mining")?; + api.create_account_path(m, "listener")?; + Ok(()) + })?; + + // Get some mining done + { + wallet_inst!(wallet1, w); + w.set_parent_key_id_by_name("mining")?; + } + let mut bh = 10u64; + let _ = + test_framework::award_blocks_to_wallet(&chain, wallet1.clone(), mask1, bh as usize, false); + + // Should have 5 in account1 (5 spendable), 5 in account (2 spendable) + wallet::controller::owner_single_use(Some(wallet1.clone()), mask1, None, |api, m| { + let (wallet1_refreshed, wallet1_info) = api.retrieve_summary_info(m, true, 1)?; + assert!(wallet1_refreshed); + assert_eq!(wallet1_info.last_confirmed_height, bh); + assert_eq!(wallet1_info.total, bh * reward); + // send to send + let args = InitTxArgs { + src_acct_name: Some("mining".to_owned()), + amount: reward * 2, + minimum_confirmations: 2, + max_outputs: 500, + num_change_outputs: 1, + selection_strategy_is_use_all: true, + ..Default::default() + }; + let mut slate = api.init_send_tx(m, args)?; + api.tx_lock_outputs(m, &slate)?; + // Send directly to self + wallet::controller::foreign_single_use(wallet1.clone(), mask1_i.clone(), |api| { + slate = api.receive_tx(&slate, Some("listener"), None)?; + Ok(()) + })?; + slate = api.finalize_tx(m, &slate)?; + api.post_tx(m, &slate, false)?; // mines a block + bh += 1; + Ok(()) + })?; + + let _ = test_framework::award_blocks_to_wallet(&chain, wallet1.clone(), mask1, 3, false); + bh += 3; + + // Check total in mining account + wallet::controller::owner_single_use(Some(wallet1.clone()), mask1, None, |api, m| { + let (wallet1_refreshed, wallet1_info) = api.retrieve_summary_info(m, true, 1)?; + assert!(wallet1_refreshed); + assert_eq!(wallet1_info.last_confirmed_height, bh); + assert_eq!(wallet1_info.total, bh * reward - reward * 2); + Ok(()) + })?; + + // Check total in 'listener' account + { + wallet_inst!(wallet1, w); + w.set_parent_key_id_by_name("listener")?; + } + wallet::controller::owner_single_use(Some(wallet1.clone()), mask1, None, |api, m| { + let (wallet1_refreshed, wallet1_info) = api.retrieve_summary_info(m, true, 1)?; + assert!(wallet1_refreshed); + assert_eq!(wallet1_info.last_confirmed_height, bh); + assert_eq!(wallet1_info.total, 2 * reward); + Ok(()) + })?; + + // Recipient wallet creates a mwixnet request from the last output + wallet::controller::owner_single_use(Some(wallet1.clone()), mask1, None, |api, m| { + let secp_locked = util::static_secp_instance(); + let secp = secp_locked.lock(); + let server_pubkey_str_1 = + "97444ae673bb92c713c1a2f7b8882ffbfc1c67401a280a775dce1a8651584332"; + let server_pubkey_str_2 = + "0c9414341f2140ed34a5a12a6479bf5a6404820d001ab81d9d3e8cc38f049b4e"; + let server_pubkey_str_3 = + "b58ece97d60e71bb7e53218400b0d67bfe6a3cb7d3b4a67a44f8fb7c525cbca5"; + let server_key_1 = + SecretKey::from_slice(&secp, &grin_util::from_hex(&server_pubkey_str_1).unwrap()) + .unwrap(); + let server_key_2 = + SecretKey::from_slice(&secp, &grin_util::from_hex(&server_pubkey_str_2).unwrap()) + .unwrap(); + let server_key_3 = + SecretKey::from_slice(&secp, &grin_util::from_hex(&server_pubkey_str_3).unwrap()) + .unwrap(); + let params = MixnetReqCreationParams { + server_keys: vec![server_key_1, server_key_2, server_key_3], + fee_per_hop: 50_000_000, + }; + let outputs = api.retrieve_outputs(mask1, false, false, None)?; + // get last output + let last_output = outputs.1[outputs.1.len() - 1].clone(); + + let mwixnet_req = api.create_mwixnet_req(m, ¶ms, &last_output.commit, true)?; + + println!("MWIXNET REQ: {:?}", mwixnet_req); + + // check output we created comsig for is indeed locked + let outputs = api.retrieve_outputs(mask1, false, false, None)?; + // get last output + let last_output = outputs.1[outputs.1.len() - 1].clone(); + assert!(last_output.output.status == libwallet::OutputStatus::Locked); + + Ok(()) + })?; + + // let logging finish + stopper.store(false, Ordering::Relaxed); + thread::sleep(Duration::from_millis(1000)); + Ok(()) +} + +#[test] +fn mwixnet_comsig_test() { + let test_dir = "test_output/mwixnet"; + setup(test_dir); + if let Err(e) = mwixnet_test_impl(test_dir) { + panic!("Libwallet Error: {}", e); + } + clean_output_dir(test_dir); +} diff --git a/impls/Cargo.toml b/impls/Cargo.toml index b55abbb..7689d61 100644 --- a/impls/Cargo.toml +++ b/impls/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "grin_wallet_impls" -version = "5.4.0-contracts.0" +version = "5.4.0-alpha.1" authors = ["Grin Developers "] description = "Concrete types derived from libwallet traits" license = "Apache-2.0" @@ -36,19 +36,19 @@ sysinfo = "0.29" base64 = "0.12.0" url = "2.1" -grin_wallet_util = { path = "../util", version = "5.4.0-contracts.0" } -grin_wallet_config = { path = "../config", version = "5.4.0-contracts.0" } -grin_wallet_libwallet = { path = "../libwallet", version = "5.4.0-contracts.0" } +grin_wallet_util = { path = "../util", version = "5.4.0-alpha.1" } +grin_wallet_config = { path = "../config", version = "5.4.0-alpha.1" } +grin_wallet_libwallet = { path = "../libwallet", version = "5.4.0-alpha.1" } ##### Grin Imports # For Release -# grin_core = "5.4.0-contracts.0" -# grin_keychain = "5.4.0-contracts.0" -# grin_chain = "5.4.0-contracts.0" -# grin_util = "5.4.0-contracts.0" -# grin_api = "5.4.0-contracts.0" -# grin_store = "5.4.0-contracts.0" +grin_core = "5.3.3" +grin_keychain = "5.3.3" +grin_chain = "5.3.3" +grin_util = "5.3.3" +grin_api = "5.3.3" +grin_store = "5.3.3" # For beta release @@ -60,12 +60,12 @@ grin_wallet_libwallet = { path = "../libwallet", version = "5.4.0-contracts.0" } # grin_store = { git = "https://github.com/mimblewimble/grin", tag = "v5.2.0-beta.3" } # For bleeding edge -grin_core = { git = "https://github.com/mimblewimble/grin", branch = "master" } -grin_keychain = { git = "https://github.com/mimblewimble/grin", branch = "master" } -grin_chain = { git = "https://github.com/mimblewimble/grin", branch = "master" } -grin_util = { git = "https://github.com/mimblewimble/grin", branch = "master" } -grin_api = { git = "https://github.com/mimblewimble/grin", branch = "master" } -grin_store = { git = "https://github.com/mimblewimble/grin", branch = "master" } +# grin_core = { git = "https://github.com/mimblewimble/grin", branch = "master" } +# grin_keychain = { git = "https://github.com/mimblewimble/grin", branch = "master" } +# grin_chain = { git = "https://github.com/mimblewimble/grin", branch = "master" } +# grin_util = { git = "https://github.com/mimblewimble/grin", branch = "master" } +# grin_api = { git = "https://github.com/mimblewimble/grin", branch = "master" } +# grin_store = { git = "https://github.com/mimblewimble/grin", branch = "master" } # For local testing # grin_core = { path = "../../grin/core"} diff --git a/impls/src/adapters/http.rs b/impls/src/adapters/http.rs index ac75915..4c79da7 100644 --- a/impls/src/adapters/http.rs +++ b/impls/src/adapters/http.rs @@ -204,9 +204,10 @@ impl HttpSlateSender { let client = if !self.use_socks { Client::new() } else { - Client::with_socks_proxy( + Client::with_proxy( self.socks_proxy_addr .ok_or_else(|| ClientError::Internal("No socks proxy address set".into()))?, + "socks5h://", ) } .map_err(|_| ClientError::Internal("Unable to create http client".into()))?; diff --git a/impls/src/client_utils/client.rs b/impls/src/client_utils/client.rs index 47f16fb..ec0ee0f 100644 --- a/impls/src/client_utils/client.rs +++ b/impls/src/client_utils/client.rs @@ -65,11 +65,11 @@ impl Client { Self::build(None) } - pub fn with_socks_proxy(socks_proxy_addr: SocketAddr) -> Result { - Self::build(Some(socks_proxy_addr)) + pub fn with_proxy(socks_proxy_addr: SocketAddr, scheme: &'static str) -> Result { + Self::build(Some((socks_proxy_addr, scheme))) } - fn build(socks_proxy_addr: Option) -> Result { + fn build(proxy: Option<(SocketAddr, &str)>) -> Result { let mut headers = HeaderMap::new(); headers.insert(USER_AGENT, HeaderValue::from_static("grin-client")); headers.insert(ACCEPT, HeaderValue::from_static("application/json")); @@ -80,8 +80,9 @@ impl Client { .use_rustls_tls() .default_headers(headers); - if let Some(s) = socks_proxy_addr { - let proxy = Proxy::all(&format!("socks5h://{}:{}", s.ip(), s.port())) + if let Some(p) = proxy { + let (addr, scheme) = p; + let proxy = Proxy::all(&format!("{}{}:{}", scheme, addr.ip(), addr.port())) .map_err(|e| Error::Internal(format!("Unable to create proxy: {}", e)))?; builder = builder.proxy(proxy); } diff --git a/impls/src/node_clients/http.rs b/impls/src/node_clients/http.rs index 83e0488..66efeb7 100644 --- a/impls/src/node_clients/http.rs +++ b/impls/src/node_clients/http.rs @@ -15,17 +15,17 @@ //! Client functions, implementations of the NodeClient trait use crate::api::{self, LocatedTxKernel, OutputListing, OutputPrintable}; +use crate::client_utils::{Client, RUNTIME}; use crate::core::core::{Transaction, TxKernel}; +use crate::libwallet; use crate::libwallet::{NodeClient, NodeVersionInfo}; +use crate::util::secp::pedersen; +use crate::util::ToHex; use futures::stream::FuturesUnordered; use futures::TryStreamExt; use std::collections::HashMap; use std::env; - -use crate::client_utils::{Client, RUNTIME}; -use crate::libwallet; -use crate::util::secp::pedersen; -use crate::util::ToHex; +use std::net::SocketAddr; use super::resp_types::*; use crate::client_utils::json_rpc::*; @@ -46,8 +46,22 @@ impl HTTPNodeClient { node_url: &str, node_api_secret: Option, ) -> Result { + Self::new_proxy(node_url, node_api_secret, None) + } + + /// Create a new client with proxy + pub fn new_proxy( + node_url: &str, + node_api_secret: Option, + proxy: Option<(SocketAddr, &'static str)>, + ) -> Result { + let client = if let Some((a, s)) = proxy { + Client::with_proxy(a, s) + } else { + Client::new() + }; Ok(HTTPNodeClient { - client: Client::new().map_err(|_| libwallet::Error::Node)?, + client: client.map_err(|_| libwallet::Error::Node)?, node_url: node_url.to_owned(), node_api_secret: node_api_secret, node_version_info: None, diff --git a/impls/src/node_clients/resp_types.rs b/impls/src/node_clients/resp_types.rs index 2689382..fc5eda5 100644 --- a/impls/src/node_clients/resp_types.rs +++ b/impls/src/node_clients/resp_types.rs @@ -14,6 +14,7 @@ // Derived from https://github.com/apoelstra/rust-jsonrpc //! JSON RPC Types for V2 node client + #[allow(dead_code)] #[derive(Debug, Deserialize)] pub struct GetTipResp { diff --git a/libwallet/Cargo.toml b/libwallet/Cargo.toml index 31390ca..684ddf2 100644 --- a/libwallet/Cargo.toml +++ b/libwallet/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "grin_wallet_libwallet" -version = "5.4.0-contracts.0" +version = "5.4.0-alpha.1" authors = ["Grin Developers "] description = "Simple, private and scalable cryptocurrency implementation based on the MimbleWimble chain format." license = "Apache-2.0" @@ -15,8 +15,8 @@ blake2-rfc = "0.2" rand = "0.6" serde = "1" serde_derive = "1" -serde_json = "1" serde_with = { version = "1", features = ["chrono"] } +serde_json = "1" log = "0.4" uuid = { version = "0.8", features = ["serde", "v4"] } chrono = { version = "0.4.11", features = ["serde"] } @@ -24,7 +24,7 @@ lazy_static = "1" strum = "0.18" strum_macros = "0.18" thiserror = "1" -ed25519-dalek = "1.0.1" +ed25519-dalek = "1.0.0-pre.4" x25519-dalek = "0.6" base64 = "0.9" regex = "1.3" @@ -37,22 +37,20 @@ bech32 = "0.7" byteorder = "1.3" num-bigint = "0.2" -grin_wallet_util = { path = "../util", version = "5.4.0-contracts.0" } -grin_wallet_config = { path = "../config", version = "5.4.0-contracts.0" } - -grin_secp256k1zkp = { version = "0.7.12", features = ["bullet-proof-sizing"]} - #mwixnet onion chacha20 = "0.8.1" hmac = { version = "0.12.0", features = ["std"]} +grin_wallet_util = { path = "../util", version = "5.4.0-alpha.1" } +grin_wallet_config = { path = "../config", version = "5.4.0-alpha.1" } + ##### Grin Imports # For Release -# grin_core = "5.4.0-contracts.0" -# grin_keychain = "5.4.0-contracts.0" -# grin_util = "5.4.0-contracts.0" -# grin_store = "5.4.0-contracts.0" +grin_core = "5.3.3" +grin_keychain = "5.3.3" +grin_util = "5.3.3" +grin_store = "5.3.3" # For beta release @@ -62,10 +60,10 @@ hmac = { version = "0.12.0", features = ["std"]} # grin_store = { git = "https://github.com/mimblewimble/grin", tag = "v5.2.0-beta.3" } # For bleeding edge -grin_core = { git = "https://github.com/mimblewimble/grin", branch = "master" } -grin_keychain = { git = "https://github.com/mimblewimble/grin", branch = "master" } -grin_util = { git = "https://github.com/mimblewimble/grin", branch = "master" } -grin_store = { git = "https://github.com/mimblewimble/grin", branch = "master" } +# grin_core = { git = "https://github.com/mimblewimble/grin", branch = "master" } +# grin_keychain = { git = "https://github.com/mimblewimble/grin", branch = "master" } +# grin_util = { git = "https://github.com/mimblewimble/grin", branch = "master" } +# grin_store = { git = "https://github.com/mimblewimble/grin", branch = "master" } # For local testing # grin_core = { path = "../../grin/core"} @@ -73,8 +71,4 @@ grin_store = { git = "https://github.com/mimblewimble/grin", branch = "master" } # grin_util = { path = "../../grin/util"} # grin_store = { path = "../../grin/store"} -# mw-mixnet - - - ##### diff --git a/libwallet/src/api_impl/owner.rs b/libwallet/src/api_impl/owner.rs index 962c21d..9eda629 100644 --- a/libwallet/src/api_impl/owner.rs +++ b/libwallet/src/api_impl/owner.rs @@ -24,23 +24,22 @@ use crate::grin_core::libtx::proof; use crate::grin_keychain::ViewKey; use crate::grin_util::secp::key::SecretKey; use crate::grin_util::secp::pedersen; +use crate::grin_util::secp::pedersen::Commitment; use crate::grin_util::{static_secp_instance, Mutex, ToHex}; use crate::util::{OnionV3Address, OnionV3AddressError}; use crate::api_impl::owner_updater::StatusMessage; use crate::contract::types::{ContractNewArgsAPI, ContractRevokeArgsAPI, ContractSetupArgsAPI}; use crate::grin_keychain::{BlindingFactor, Identifier, Keychain, SwitchCommitmentType}; -use crate::mwixnet::onion::create_onion; -use crate::mwixnet::types::{ - add_excess, new_hop, random_secret, ComSignature, Hop, MixnetReqCreationParams, SwapReq, -}; use crate::internal::{keys, scan, selection, tx, updater}; use crate::slate::{PaymentInfo, Slate, SlateState}; use crate::types::{AcctPathMapping, NodeClient, TxLogEntry, WalletBackend, WalletInfo}; use crate::Error; use crate::{ - address, contract, wallet_lock, BuiltOutput, InitTxArgs, IssueInvoiceTxArgs, NodeHeightResult, + address, contract, + mwixnet::{create_onion, ComSignature, Hop, MixnetReqCreationParams, SwapReq}, + wallet_lock, BuiltOutput, InitTxArgs, IssueInvoiceTxArgs, NodeHeightResult, OutputCommitMapping, PaymentProof, RetrieveTxQueryArgs, ScannedBlockInfo, Slatepack, SlatepackAddress, Slatepacker, SlatepackerArgs, TxLogEntryType, ViewWallet, WalletInitStatus, WalletInst, WalletLCProvider, @@ -1609,8 +1608,9 @@ pub fn create_mwixnet_req<'a, T: ?Sized, C, K>( w: &mut T, keychain_mask: Option<&SecretKey>, params: &MixnetReqCreationParams, - commitment: &pedersen::Commitment, + commitment: &Commitment, lock_output: bool, + use_test_rng: bool, ) -> Result where T: WalletBackend<'a, C, K>, @@ -1668,7 +1668,12 @@ where rangeproof: Some(new_output.output.proof.clone()), } } else { - let hop_excess = BlindingFactor::rand(&secp); + let hop_excess; + if use_test_rng { + hop_excess = BlindingFactor::zero(); + } else { + hop_excess = BlindingFactor::rand(&secp); + } blind_sum = blind_sum.split(&hop_excess, &secp).unwrap(); Hop { server_pubkey: p.clone(), @@ -1680,8 +1685,14 @@ where }) .collect(); - let onion = create_onion(&commitment, &hops).unwrap(); - let comsig = ComSignature::sign(amount, &input_blind, &onion.serialize().unwrap()).unwrap(); + let onion = create_onion(&commitment, &hops, use_test_rng).unwrap(); + let comsig = ComSignature::sign( + amount, + &input_blind, + &onion.serialize().unwrap(), + use_test_rng, + ) + .unwrap(); // Lock output if requested if lock_output { diff --git a/libwallet/src/api_impl/types.rs b/libwallet/src/api_impl/types.rs index 61b7b81..e59c515 100644 --- a/libwallet/src/api_impl/types.rs +++ b/libwallet/src/api_impl/types.rs @@ -26,6 +26,8 @@ use crate::SlatepackAddress; use chrono::prelude::*; use ed25519_dalek::Signature as DalekSignature; +pub use crate::mwixnet::{Hop, MixnetReqCreationParams, SwapReq}; + /// Type for storing amounts (in nanogrins). /// Serializes as a string but can deserialize from a string or u64. #[derive(Serialize, Deserialize)] diff --git a/libwallet/src/error.rs b/libwallet/src/error.rs index a3bc15c..7335330 100644 --- a/libwallet/src/error.rs +++ b/libwallet/src/error.rs @@ -67,11 +67,11 @@ pub enum Error { /// Comsig error #[error("Comsig error: {0}")] - ComSig(#[from] crate::mwixnet::onion::crypto::comsig::ComSigError), + ComSig(#[from] crate::mwixnet::ComSigError), /// mwixnet Onion error #[error("Onion error: {0}")] - Onion(#[from] crate::mwixnet::onion::onion::OnionError), + Onion(#[from] crate::mwixnet::OnionError), /// Callback implementation error conversion #[error("Trait Implementation error")] @@ -189,6 +189,18 @@ pub enum Error { #[error("Committed Error: {0}")] Commit(String), + /// Error Deserializing commit + #[error("Commit Deserialize Error: {0}")] + CommitDeser(String), + + /// Error Deserializing key + #[error("Server Key Deserialize Error: {0}")] + ServerKeyDeser(String), + + /// Parsing integert + #[error("Can't parse as u64: {0}")] + U64Deser(String), + /// Can't parse slate version #[error("Can't parse slate version")] SlateVersionParse, diff --git a/libwallet/src/lib.rs b/libwallet/src/lib.rs index eeff705..5f93557 100644 --- a/libwallet/src/lib.rs +++ b/libwallet/src/lib.rs @@ -32,6 +32,8 @@ use grin_wallet_util as util; use blake2_rfc as blake2; +#[macro_use] +extern crate serde_derive; #[macro_use] extern crate serde_with; #[macro_use] @@ -48,11 +50,10 @@ pub mod api_impl; pub mod contract; mod error; mod internal; +pub mod mwixnet; mod slate; pub mod slate_versions; pub mod slatepack; - -pub mod mwixnet; mod types; pub use crate::error::Error; diff --git a/libwallet/src/mwixnet/mod.rs b/libwallet/src/mwixnet/mod.rs index 74597a3..0605265 100644 --- a/libwallet/src/mwixnet/mod.rs +++ b/libwallet/src/mwixnet/mod.rs @@ -13,5 +13,12 @@ // limitations under the License. //! Onion modules for mxmixnet -pub mod onion; -pub mod types; +mod onion; +mod types; + +pub use onion::{ + create_onion, onion::Onion, onion::OnionError, util as onion_util, ComSigError, ComSignature, + MwixnetPublicKey, +}; + +pub use types::{Hop, MixnetReqCreationParams, SwapReq}; diff --git a/libwallet/src/mwixnet/onion/crypto/comsig.rs b/libwallet/src/mwixnet/onion/crypto/comsig.rs index 5073612..bf9e347 100644 --- a/libwallet/src/mwixnet/onion/crypto/comsig.rs +++ b/libwallet/src/mwixnet/onion/crypto/comsig.rs @@ -14,12 +14,14 @@ //! Comsig modules for mxmixnet -use secp256k1zkp::{self, pedersen::Commitment, ContextFlag, Secp256k1, SecretKey}; +use grin_util::secp::{ + self as secp256k1zkp, pedersen::Commitment, rand::thread_rng, ContextFlag, Secp256k1, SecretKey, +}; use blake2_rfc::blake2b::Blake2b; use byteorder::{BigEndian, ByteOrder}; use grin_core::ser::{self, Readable, Reader, Writeable, Writer}; -use secp256k1zkp::rand::thread_rng; +use rand::rngs::mock::StepRng; use thiserror::Error; /// A generalized Schnorr signature with a pedersen commitment value & blinding factors as the keys @@ -33,8 +35,10 @@ pub struct ComSignature { /// Error types for Commitment Signatures #[derive(Error, Debug, Clone, Serialize, Deserialize, Eq, PartialEq)] pub enum ComSigError { + /// Invalid commitment signature #[error("Commitment signature is invalid")] InvalidSig, + /// Secp256k1zkp error #[error("Secp256k1zkp error: {0:?}")] Secp256k1zkp(secp256k1zkp::Error), } @@ -46,6 +50,7 @@ impl From for ComSigError { } impl ComSignature { + /// Create a new ComSignature pub fn new(pub_nonce: &Commitment, s: &SecretKey, t: &SecretKey) -> ComSignature { ComSignature { pub_nonce: pub_nonce.to_owned(), @@ -54,25 +59,41 @@ impl ComSignature { } } - #[allow(dead_code)] + /// Sign commitment with amount, blinding factor, and message pub fn sign( amount: u64, blind: &SecretKey, msg: &Vec, + use_test_rng: bool, ) -> Result { let secp = Secp256k1::with_caps(ContextFlag::Commit); let mut amt_bytes = [0; 32]; BigEndian::write_u64(&mut amt_bytes[24..32], amount); let k_amt = SecretKey::from_slice(&secp, &amt_bytes)?; + let k_1; + let k_2; - let k_1 = SecretKey::new(&secp, &mut thread_rng()); - let k_2 = SecretKey::new(&secp, &mut thread_rng()); + if use_test_rng { + // allow for consistent test results + let mut test_rng = StepRng::new(1_234_567_890_u64, 1); + k_1 = SecretKey::new(&secp, &mut test_rng); + k_2 = SecretKey::new(&secp, &mut test_rng); + } else { + k_1 = SecretKey::new(&secp, &mut thread_rng()); + k_2 = SecretKey::new(&secp, &mut thread_rng()); + } let commitment = secp.commit(amount, blind.clone())?; let nonce_commitment = secp.commit_blind(k_1.clone(), k_2.clone())?; - let e = ComSignature::calc_challenge(&secp, &commitment, &nonce_commitment, &msg)?; + let e = ComSignature::calc_challenge( + &secp, + &commitment, + &nonce_commitment, + &msg, + use_test_rng, + )?; // s = k_1 + (e * amount) let mut s = k_amt.clone(); @@ -87,20 +108,20 @@ impl ComSignature { Ok(ComSignature::new(&nonce_commitment, &s, &t)) } - #[allow(non_snake_case)] + /// Verify the commitment signature pub fn verify(&self, commit: &Commitment, msg: &Vec) -> Result<(), ComSigError> { let secp = Secp256k1::with_caps(ContextFlag::Commit); - let S1 = secp.commit_blind(self.s.clone(), self.t.clone())?; + let s1 = secp.commit_blind(self.s.clone(), self.t.clone())?; - let mut Ce = commit.to_pubkey(&secp)?; - let e = ComSignature::calc_challenge(&secp, &commit, &self.pub_nonce, &msg)?; - Ce.mul_assign(&secp, &e)?; + let mut ce = commit.to_pubkey(&secp)?; + let e = ComSignature::calc_challenge(&secp, &commit, &self.pub_nonce, &msg, false)?; + ce.mul_assign(&secp, &e)?; - let commits = vec![Commitment::from_pubkey(&secp, &Ce)?, self.pub_nonce.clone()]; - let S2 = secp.commit_sum(commits, Vec::new())?; + let commits = vec![Commitment::from_pubkey(&secp, &ce)?, self.pub_nonce.clone()]; + let s2 = secp.commit_sum(commits, Vec::new())?; - if S1 != S2 { + if s1 != s2 { return Err(ComSigError::InvalidSig); } @@ -112,8 +133,12 @@ impl ComSignature { commit: &Commitment, nonce_commit: &Commitment, msg: &Vec, + use_test_rng: bool, ) -> Result { let mut challenge_hasher = Blake2b::new(32); + if use_test_rng { + return Ok(super::secp::random_secret(use_test_rng)); + } challenge_hasher.update(&commit.0); challenge_hasher.update(&nonce_commit.0); challenge_hasher.update(msg); @@ -178,8 +203,8 @@ impl Writeable for ComSignature { mod tests { use super::{ComSigError, ComSignature, ContextFlag, Secp256k1, SecretKey}; + use grin_util::secp::rand::{thread_rng, RngCore}; use rand::Rng; - use secp256k1zkp::rand::{thread_rng, RngCore}; /// Test signing and verification of ComSignatures #[test] @@ -189,7 +214,7 @@ mod tests { let amount = thread_rng().next_u64(); let blind = SecretKey::new(&secp, &mut thread_rng()); let msg: [u8; 16] = rand::thread_rng().gen(); - let comsig = ComSignature::sign(amount, &blind, &msg.to_vec())?; + let comsig = ComSignature::sign(amount, &blind, &msg.to_vec(), false)?; let commit = secp.commit(amount, blind.clone())?; assert!(comsig.verify(&commit, &msg.to_vec()).is_ok()); diff --git a/libwallet/src/mwixnet/onion/crypto/dalek.rs b/libwallet/src/mwixnet/onion/crypto/dalek.rs index 8988157..a10c65b 100644 --- a/libwallet/src/mwixnet/onion/crypto/dalek.rs +++ b/libwallet/src/mwixnet/onion/crypto/dalek.rs @@ -14,9 +14,9 @@ //! Dalek key wrapper for mwixnet primitives -use super::secp::SecretKey; +use grin_util::secp::key::SecretKey; -use ed25519_dalek::{Keypair, PublicKey, Signature, Signer, Verifier}; +use ed25519_dalek::{PublicKey, Signature, Verifier}; use grin_core::ser::{self, Readable, Reader, Writeable, Writer}; use grin_util::ToHex; use thiserror::Error; @@ -68,6 +68,7 @@ impl AsRef for DalekPublicKey { } } +#[cfg(test)] /// Serializes an Option to and from hex pub mod option_dalek_pubkey_serde { use super::DalekPublicKey; @@ -144,6 +145,7 @@ impl AsRef for DalekSignature { } /// Serializes a DalekSignature to and from hex +#[cfg(test)] pub mod dalek_sig_serde { use super::DalekSignature; use grin_util::ToHex; @@ -171,7 +173,9 @@ pub mod dalek_sig_serde { /// Dalek signature sign wrapper // TODO: This is likely duplicated throughout crate, check +#[cfg(test)] pub fn sign(sk: &SecretKey, message: &[u8]) -> Result { + use ed25519_dalek::{Keypair, Signer}; let secret = ed25519_dalek::SecretKey::from_bytes(&sk.0).map_err(|_| DalekError::KeyParseError)?; let public: PublicKey = (&secret).into(); diff --git a/libwallet/src/mwixnet/onion/crypto/mod.rs b/libwallet/src/mwixnet/onion/crypto/mod.rs index 8ae01a9..58544e9 100644 --- a/libwallet/src/mwixnet/onion/crypto/mod.rs +++ b/libwallet/src/mwixnet/onion/crypto/mod.rs @@ -1,4 +1,4 @@ -// Copyright 2023 The Grin Developers +// Copyright 2024 The Grin Developers // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,3 +17,5 @@ pub mod comsig; pub mod dalek; pub mod secp; + +pub use comsig::{comsig_serde, ComSigError, ComSignature}; diff --git a/libwallet/src/mwixnet/onion/crypto/secp.rs b/libwallet/src/mwixnet/onion/crypto/secp.rs index 28872ee..eda6abe 100644 --- a/libwallet/src/mwixnet/onion/crypto/secp.rs +++ b/libwallet/src/mwixnet/onion/crypto/secp.rs @@ -1,4 +1,4 @@ -// Copyright 2023 The Grin Developers +// Copyright 2024 The Grin Developers // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,26 +12,30 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! SECP wrapper functions for onion/comsig -//! TODO: Likely redundant stuff in here, trim +//! SECP operations for comsig -pub use secp256k1zkp::aggsig; -pub use secp256k1zkp::constants::{ - AGG_SIGNATURE_SIZE, COMPRESSED_PUBLIC_KEY_SIZE, MAX_PROOF_SIZE, PEDERSEN_COMMITMENT_SIZE, - SECRET_KEY_SIZE, +pub use grin_util::secp::{ + self as secp256k1zkp, + constants::SECRET_KEY_SIZE, + key::{SecretKey, ZERO_KEY}, + pedersen::Commitment, + rand::thread_rng, + ContextFlag, Secp256k1, }; -pub use secp256k1zkp::ecdh::SharedSecret; -pub use secp256k1zkp::key::{PublicKey, SecretKey, ZERO_KEY}; -pub use secp256k1zkp::pedersen::{Commitment, RangeProof}; -pub use secp256k1zkp::{ContextFlag, Message, Secp256k1, Signature}; use grin_core::ser::{self, Reader}; -use secp256k1zkp::rand::thread_rng; +use rand::rngs::mock::StepRng; /// Generate a random SecretKey. -pub fn random_secret() -> SecretKey { +pub fn random_secret(use_test_rng: bool) -> SecretKey { let secp = Secp256k1::new(); - SecretKey::new(&secp, &mut thread_rng()) + if use_test_rng { + // allow for consistent test results + let mut test_rng = StepRng::new(1_234_567_890_u64, 1); + SecretKey::new(&secp, &mut test_rng) + } else { + SecretKey::new(&secp, &mut thread_rng()) + } } /// Deserialize a SecretKey from a Reader @@ -43,6 +47,7 @@ pub fn read_secret_key(reader: &mut R) -> Result Result { let secp = Secp256k1::with_caps(ContextFlag::Commit); let commit = secp.commit(value, blind.clone())?; @@ -71,9 +76,23 @@ pub fn sub_value(commitment: &Commitment, value: u64) -> Result Result { +#[cfg(test)] +#[allow(dead_code)] +pub fn sign( + sk: &SecretKey, + msg: &grin_util::secp::Message, +) -> Result { let secp = Secp256k1::with_caps(ContextFlag::Full); - let pubkey = PublicKey::from_secret_key(&secp, &sk)?; - let sig = aggsig::sign_single(&secp, &msg, &sk, None, None, None, Some(&pubkey), None)?; + let pubkey = grin_util::secp::PublicKey::from_secret_key(&secp, &sk)?; + let sig = grin_util::secp::aggsig::sign_single( + &secp, + &msg, + &sk, + None, + None, + None, + Some(&pubkey), + None, + )?; Ok(sig) } diff --git a/libwallet/src/mwixnet/onion/mod.rs b/libwallet/src/mwixnet/onion/mod.rs index bcabf8e..d052d1c 100644 --- a/libwallet/src/mwixnet/onion/mod.rs +++ b/libwallet/src/mwixnet/onion/mod.rs @@ -1,4 +1,4 @@ -// Copyright 2023 The Grin Developers +// Copyright 2024 The Grin Developers // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -14,19 +14,26 @@ //! Onion module definition -pub mod crypto; +mod crypto; pub mod onion; pub mod util; -use crypto::secp::{random_secret, Commitment, SecretKey}; -use onion::{new_stream_cipher, Onion, OnionError, Payload, RawBytes}; +pub use crypto::{ + comsig_serde, dalek::DalekPublicKey as MwixnetPublicKey, ComSigError, ComSignature, +}; use chacha20::cipher::StreamCipher; use grin_core::core::FeeFields; -use secp256k1zkp::pedersen::RangeProof; +use grin_util::secp::{ + pedersen::{Commitment, RangeProof}, + SecretKey, +}; use x25519_dalek::PublicKey as xPublicKey; use x25519_dalek::{SharedSecret, StaticSecret}; +use crypto::secp::random_secret; +use onion::{new_stream_cipher, Onion, OnionError, Payload, RawBytes}; + /// Onion hop struct #[derive(Clone)] pub struct Hop { @@ -41,6 +48,7 @@ pub struct Hop { } /// Crate a new hop +#[cfg(test)] pub fn new_hop( server_key: &SecretKey, hop_excess: &SecretKey, @@ -56,7 +64,11 @@ pub fn new_hop( } /// Create an Onion for the Commitment, encrypting the payload for each hop -pub fn create_onion(commitment: &Commitment, hops: &Vec) -> Result { +pub fn create_onion( + commitment: &Commitment, + hops: &Vec, + use_test_rng: bool, +) -> Result { if hops.is_empty() { return Ok(Onion { ephemeral_pubkey: xPublicKey::from([0u8; 32]), @@ -67,14 +79,14 @@ pub fn create_onion(commitment: &Commitment, hops: &Vec) -> Result = Vec::new(); let mut enc_payloads: Vec = Vec::new(); - let mut ephemeral_sk = StaticSecret::from(random_secret().0); + let mut ephemeral_sk = StaticSecret::from(random_secret(use_test_rng).0); let onion_ephemeral_pk = xPublicKey::from(&ephemeral_sk); for i in 0..hops.len() { let hop = &hops[i]; let shared_secret = ephemeral_sk.diffie_hellman(&hop.server_pubkey); shared_secrets.push(shared_secret); - ephemeral_sk = StaticSecret::from(random_secret().0); + ephemeral_sk = StaticSecret::from(random_secret(use_test_rng).0); let next_ephemeral_pk = if i < (hops.len() - 1) { xPublicKey::from(&ephemeral_sk) } else { @@ -106,16 +118,17 @@ pub fn create_onion(commitment: &Commitment, hops: &Vec) -> Result Onion { let commit = rand_commit(); @@ -128,32 +141,32 @@ pub mod test_util { None }; let hop = new_hop( - &random_secret(), - &random_secret(), + &random_secret(false), + &random_secret(false), thread_rng().next_u32(), rangeproof, ); hops.push(hop); } - create_onion(&commit, &hops).unwrap() + create_onion(&commit, &hops, false).unwrap() } pub fn rand_commit() -> Commitment { - secp::commit(rand::thread_rng().next_u64(), &secp::random_secret()).unwrap() + secp::commit(rand::thread_rng().next_u64(), &secp::random_secret(false)).unwrap() } pub fn rand_hash() -> Hash { - Hash::from_hex(secp::random_secret().to_hex().as_str()).unwrap() + Hash::from_hex(secp::random_secret(false).to_hex().as_str()).unwrap() } pub fn rand_proof() -> RangeProof { let secp = Secp256k1::new(); secp.bullet_proof( rand::thread_rng().next_u64(), - secp::random_secret(), - secp::random_secret(), - secp::random_secret(), + secp::random_secret(false), + secp::random_secret(false), + secp::random_secret(false), None, None, ) @@ -177,8 +190,8 @@ pub mod test_util { let rp = secp.bullet_proof( out_value, blind.clone(), - secp::random_secret(), - secp::random_secret(), + secp::random_secret(false), + secp::random_secret(false), None, None, ); @@ -187,7 +200,7 @@ pub mod test_util { } pub fn rand_keypair() -> (SecretKey, DalekPublicKey) { - let sk = random_secret(); + let sk = random_secret(false); let pk = DalekPublicKey::from_secret(&sk); (sk, pk) } diff --git a/libwallet/src/mwixnet/onion/onion.rs b/libwallet/src/mwixnet/onion/onion.rs index 7b921ea..2540dae 100644 --- a/libwallet/src/mwixnet/onion/onion.rs +++ b/libwallet/src/mwixnet/onion/onion.rs @@ -14,7 +14,6 @@ //! Onion defn for mwixnet -use super::crypto::secp::{self, Commitment, RangeProof, SecretKey}; use super::util::{read_optional, vec_to_array, write_optional}; use std::convert::TryFrom; @@ -26,6 +25,11 @@ use chacha20::cipher::{NewCipher, StreamCipher}; use chacha20::{ChaCha20, Key, Nonce}; use grin_core::core::FeeFields; use grin_core::ser::{self, Readable, Reader, Writeable, Writer}; +use grin_util::secp::{ + self as secp256k1zkp, + key::SecretKey, + pedersen::{Commitment, RangeProof}, +}; use grin_util::{self, ToHex}; use hmac::digest::InvalidLength; use hmac::{Hmac, Mac}; @@ -35,6 +39,8 @@ use sha2::Sha256; use thiserror::Error; use x25519_dalek::{PublicKey as xPublicKey, SharedSecret, StaticSecret}; +use super::crypto::secp; + type HmacSha256 = Hmac; /// Raw bytes alias pub type RawBytes = Vec; @@ -374,7 +380,7 @@ pub mod tests { let fee_per_hop: u32 = 2; let in_value: u64 = 1000; let out_value: u64 = in_value - total_fee; - let blind = random_secret(); + let blind = random_secret(false); let commitment = secp::commit(in_value, &blind).unwrap(); let mut hops: Vec = Vec::new(); @@ -382,15 +388,15 @@ pub mod tests { let mut final_commit = secp::commit(out_value, &blind).unwrap(); let mut final_blind = blind.clone(); for i in 0..5 { - keys.push(random_secret()); + keys.push(random_secret(false)); - let excess = random_secret(); + let excess = random_secret(false); let secp = secp256k1zkp::Secp256k1::with_caps(secp256k1zkp::ContextFlag::Commit); final_blind.add_assign(&secp, &excess).unwrap(); final_commit = secp::add_excess(&final_commit, &excess).unwrap(); let proof = if i == 4 { - let n1 = random_secret(); + let n1 = random_secret(false); let rp = secp.bullet_proof( out_value, final_blind.clone(), @@ -409,11 +415,12 @@ pub mod tests { hops.push(hop); } - let mut onion_packet = crate::mwixnet::onion::create_onion(&commitment, &hops).unwrap(); + let mut onion_packet = + crate::mwixnet::onion::create_onion(&commitment, &hops, false).unwrap(); let mut payload = Payload { next_ephemeral_pk: onion_packet.ephemeral_pubkey.clone(), - excess: random_secret(), + excess: random_secret(false), fee: FeeFields::from(fee_per_hop), rangeproof: None, }; diff --git a/libwallet/src/mwixnet/onion/util.rs b/libwallet/src/mwixnet/onion/util.rs index d5bbff0..6661177 100644 --- a/libwallet/src/mwixnet/onion/util.rs +++ b/libwallet/src/mwixnet/onion/util.rs @@ -37,7 +37,7 @@ use std::convert::TryInto; /// # Example /// /// ``` -/// use grin_wallet_libwallet::mwixnet::onion::util::write_optional; +/// use grin_wallet_libwallet::mwixnet::onion_util::write_optional; /// let mut writer:Vec = vec![]; /// let optional_value: Option = Some(10); /// //write_optional(&mut writer, &optional_value); @@ -75,7 +75,7 @@ pub fn write_optional( /// # Example /// /// ``` -/// use grin_wallet_libwallet::mwixnet::onion::util::read_optional; +/// use grin_wallet_libwallet::mwixnet::onion_util::read_optional; /// use grin_core::ser::{BinReader, ProtocolVersion, DeserializationMode}; /// let mut buf: &[u8] = &[1, 0, 0, 0, 10]; /// let mut reader = BinReader::new(&mut buf, ProtocolVersion::local(), DeserializationMode::default()); @@ -106,7 +106,7 @@ pub fn read_optional(reader: &mut R) -> Result /// # Example /// /// ``` -/// use grin_wallet_libwallet::mwixnet::onion::util::vec_to_array; +/// use grin_wallet_libwallet::mwixnet::onion_util::vec_to_array; /// let v = vec![0, 1, 2, 3, 4, 5]; /// let a = vec_to_array::<4>(&v).unwrap(); /// assert_eq!(a, [0, 1, 2, 3]); diff --git a/libwallet/src/mwixnet/types.rs b/libwallet/src/mwixnet/types.rs index 1f36dde..1213f3a 100644 --- a/libwallet/src/mwixnet/types.rs +++ b/libwallet/src/mwixnet/types.rs @@ -1,4 +1,4 @@ -// Copyright 2022 The Grin Developers +// Copyright 2024 The Grin Developers // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -15,28 +15,29 @@ //! Types related to mwixnet requests required by rest of lib crate apis //! Should rexport all needed types here -pub use super::onion::crypto::comsig::{self, ComSignature}; -pub use super::onion::crypto::secp::{add_excess, random_secret}; -pub use super::onion::onion::Onion; -pub use super::onion::{new_hop, Hop}; -use crate::grin_util::secp::key::SecretKey; +use super::onion::comsig_serde; +use grin_core::libtx::secp_ser::string_or_u64; +use grin_util::secp::key::SecretKey; use serde::{Deserialize, Serialize}; +pub use super::onion::{onion::Onion, ComSignature, Hop}; + /// A Swap request #[derive(Serialize, Deserialize, Debug)] pub struct SwapReq { /// Com signature - #[serde(with = "comsig::comsig_serde")] + #[serde(with = "comsig_serde")] pub comsig: ComSignature, /// Onion pub onion: Onion, } /// mwixnetRequest Creation Params - +#[derive(Serialize, Deserialize, Debug)] pub struct MixnetReqCreationParams { /// List of all the server keys pub server_keys: Vec, /// Fees per hop - pub fee_per_hop: u32, + #[serde(with = "string_or_u64")] + pub fee_per_hop: u64, } diff --git a/libwallet/src/slatepack/armor.rs b/libwallet/src/slatepack/armor.rs index f355549..eacdf32 100644 --- a/libwallet/src/slatepack/armor.rs +++ b/libwallet/src/slatepack/armor.rs @@ -188,11 +188,11 @@ fn format_slatepack(slatepack: &str) -> Result { // Returns the first four bytes of a double sha256 hash of some bytes fn generate_check(payload: &[u8]) -> Result, Error> { - let mut first_hash = Sha256::new(); - first_hash.update(payload); - let mut second_hash = Sha256::new(); - second_hash.update(first_hash.finalize()); - let checksum = second_hash.finalize(); + let mut first_hasher = Sha256::new(); + first_hasher.update(payload); + let mut second_hasher = Sha256::new(); + second_hasher.update(first_hasher.finalize()); + let checksum = second_hasher.finalize(); let check_bytes: Vec = checksum[0..4].to_vec(); Ok(check_bytes) } diff --git a/util/Cargo.toml b/util/Cargo.toml index be663ae..879866e 100644 --- a/util/Cargo.toml +++ b/util/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "grin_wallet_util" -version = "5.4.0-contracts.0" +version = "5.4.0-alpha.1" authors = ["Grin Developers "] description = "Util, for generic utilities and to re-export grin crates" license = "Apache-2.0" @@ -21,14 +21,14 @@ thiserror = "1" ##### Grin Imports # For Release -# grin_util = "5.4.0-contracts.0" +grin_util = "5.3.3" # For beta release # grin_util = { git = "https://github.com/mimblewimble/grin", tag = "v5.2.0-beta.3" } # For bleeding edge -grin_util = { git = "https://github.com/mimblewimble/grin", branch = "master" } +# grin_util = { git = "https://github.com/mimblewimble/grin", branch = "master" } # For local testing