diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index b8979f05..3f51bde0 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -39,7 +39,7 @@ jobs: name: Clippy with: command: clippy - args: --workspace --all-features --all-targets + args: --workspace --all-features --all-targets -- -D warnings doc: runs-on: ubuntu-latest steps: diff --git a/Cargo.lock b/Cargo.lock index ea38968f..866fbcb4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,21 +4,21 @@ version = 3 [[package]] name = "aho-corasick" -version = "1.0.2" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" +checksum = "ea5d730647d4fadd988536d06fecce94b7b4f2a7efdae548f1cf4b63205518ab" dependencies = [ "memchr", ] [[package]] name = "amplify" -version = "4.0.0" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26966af46e0d200e8bf2b7f16230997c1c3f2d141bc27ccc091c012ed527b58" +checksum = "8629db306c0bbeb0a402e2918bdcf0026b5ddb24c46460f3bf5410b350d98710" dependencies = [ "amplify_apfloat", - "amplify_derive 3.0.1", + "amplify_derive", "amplify_num", "amplify_syn", "ascii", @@ -42,21 +42,9 @@ dependencies = [ [[package]] name = "amplify_derive" -version = "3.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c87df0f28e6eb1f2d355f29ba6793fa9ca643967528609608d5cbd70bd68f9d1" -dependencies = [ - "amplify_syn", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "amplify_derive" -version = "4.0.0-alpha.6" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01c4835e964725149d7961ec5af2ca1302f6f68c8c738b4acb06185f596c3333" +checksum = "759dcbfaf94d838367a86d493ec34ccc8aa6fe365cb7880d6bf89006de24d9c1" dependencies = [ "amplify_syn", "proc-macro2", @@ -86,9 +74,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.72" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b13c32d80ecc7ab747b80c3784bce54ee8a7a0cc4fbda9bf4cda2cf6fe90854" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" [[package]] name = "arrayref" @@ -113,13 +101,13 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.72" +version = "0.1.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc6dde6e4ed435a4c1ee4e73592f5ba9da2151af10076cc04858746af9352d09" +checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.38", ] [[package]] @@ -130,9 +118,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "baid58" -version = "0.4.1" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "052064cc0caa02b62c88f06a7237304fb297873c78b6e95addecc3c5ddfce4ae" +checksum = "bc0585242d87ed976e05db6ae86a0f771f140104a4b6c91b4c3e43b9b2357486" dependencies = [ "base58", "blake3", @@ -148,9 +136,9 @@ checksum = "6107fe1be6682a68940da878d9e9f5e90ca5745b3dec9fd1bb393c8777d4f581" [[package]] name = "base64" -version = "0.21.2" +version = "0.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" +checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" [[package]] name = "bitflags" @@ -160,16 +148,15 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "blake3" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "199c42ab6972d92c9f8995f086273d25c42fc0f7b2a1fcefba465c1352d25ba5" +checksum = "0231f06152bf547e9c2b5194f247cd97aacf6dcd8b15d8e5ec0663f64580da87" dependencies = [ "arrayref", "arrayvec", "cc", "cfg-if", "constant_time_eq", - "digest", ] [[package]] @@ -183,21 +170,24 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.13.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "cc" -version = "1.0.79" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] [[package]] name = "cfg-if" @@ -207,7 +197,7 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "client_side_validation" -version = "0.10.5" +version = "0.10.6" dependencies = [ "commit_verify", "serde", @@ -230,11 +220,12 @@ dependencies = [ [[package]] name = "commit_verify" -version = "0.10.5" +version = "0.10.6" dependencies = [ "amplify", "commit_encoding_derive", "rand", + "ripemd", "serde", "sha2", "strict_encoding", @@ -308,7 +299,6 @@ checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", "crypto-common", - "subtle", ] [[package]] @@ -340,13 +330,13 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "filetime" -version = "0.2.21" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cbc844cecaee9d4443931972e1289c8ff485cb4cc2767cb03ca139ed6885153" +checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.3.5", "windows-sys", ] @@ -397,9 +387,9 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.14.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" +checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12" [[package]] name = "heck" @@ -409,9 +399,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" [[package]] name = "indexmap" @@ -425,12 +415,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.0.0" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" dependencies = [ "equivalent", - "hashbrown 0.14.0", + "hashbrown 0.14.1", ] [[package]] @@ -447,21 +437,21 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.147" +version = "0.2.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" [[package]] name = "log" -version = "0.4.19" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "memchr" -version = "2.5.0" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] name = "miow" @@ -512,18 +502,18 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro2" -version = "1.0.66" +version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +checksum = "5b1106fec09662ec6dd98ccac0f81cef56984d0b49f75c92d8cbad76e20c005c" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.32" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -567,6 +557,15 @@ dependencies = [ "bitflags", ] +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags", +] + [[package]] name = "redox_users" version = "0.4.3" @@ -574,15 +573,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" dependencies = [ "getrandom", - "redox_syscall", + "redox_syscall 0.2.16", "thiserror", ] [[package]] name = "regex" -version = "1.9.1" +version = "1.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2eae68fc220f7cf2532e4494aded17545fce192d59cd996e0fe7887f4ceb575" +checksum = "ebee201405406dbf528b8b672104ae6d6d63e6d118cb10e4d51abbc7b58044ff" dependencies = [ "aho-corasick", "memchr", @@ -592,9 +591,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.3" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39354c10dd07468c2e73926b23bb9c2caca74c5501e38a35da70406f1d923310" +checksum = "59b23e92ee4318893fa3fe3e6fb365258efbfe6ac6ab30f090cdcbb7aa37efa9" dependencies = [ "aho-corasick", "memchr", @@ -603,9 +602,18 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" + +[[package]] +name = "ripemd" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f" +dependencies = [ + "digest", +] [[package]] name = "rustfix" @@ -633,35 +641,44 @@ checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] name = "serde" -version = "1.0.174" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b88756493a5bd5e5395d53baa70b194b05764ab85b59e43e4b8f4e1192fa9b1" +checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.174" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e5c3a298c7f978e53536f95a63bdc4c4a64550582f31a0359a9afda6aede62e" +checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.38", ] [[package]] name = "serde_json" -version = "1.0.103" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d03b412469450d4404fe8499a268edd7f8b79fecb074b0d812ad64ca21f4031b" +checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" dependencies = [ "itoa", "ryu", "serde", ] +[[package]] +name = "serde_spanned" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96426c9936fd7a0124915f9185ea1d20aa9445cc9821142f0a73bc9207a2e186" +dependencies = [ + "serde", +] + [[package]] name = "serde_str_helpers" version = "0.1.2" @@ -678,7 +695,7 @@ version = "0.9.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a49e178e4452f45cb61d0cd8cebc1b0fafd3e41929e996cef79aa3aca91f574" dependencies = [ - "indexmap 2.0.0", + "indexmap 2.0.2", "itoa", "ryu", "serde", @@ -687,9 +704,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.7" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", @@ -698,17 +715,17 @@ dependencies = [ [[package]] name = "single_use_seals" -version = "0.10.0" +version = "0.10.1" dependencies = [ - "amplify_derive 4.0.0-alpha.6", + "amplify_derive", "async-trait", ] [[package]] name = "strict_encoding" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b1c91b79e62afc09025d828fa0b8dbf4105513de38f126a017919c09bca472" +checksum = "7c5667c167479cd4abf9f4e02a86fcc45b0d59cd1dbef97f341ecd31b7bcd320" dependencies = [ "amplify", "half", @@ -730,9 +747,9 @@ dependencies = [ [[package]] name = "strict_types" -version = "1.6.0" +version = "1.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8a6654c43ed02891b249730856ad6b866fd85d1008aad51b30bd68812798427" +checksum = "c41eb7f3d2da6b413204be9605fd27de10a440875695246cf5e000eecf6d08ed" dependencies = [ "amplify", "baid58", @@ -753,12 +770,6 @@ dependencies = [ "serde_str_helpers", ] -[[package]] -name = "subtle" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" - [[package]] name = "syn" version = "1.0.109" @@ -772,9 +783,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.27" +version = "2.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b60f673f44a8255b9c8c657daf66a596d435f2da81a555b06dc644d080ba45e0" +checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" dependencies = [ "proc-macro2", "quote", @@ -807,50 +818,75 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.44" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "611040a08a0439f8248d1990b111c95baa9c704c805fa1f62104b39655fd7f90" +checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.44" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "090198534930841fab3a5d1bb637cde49e339654e606195f8d9c76eeb081dc96" +checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.38", ] [[package]] name = "toml" -version = "0.5.11" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "185d8ab0dfbb35cf1399a6344d8484209c088f75f8f68230da55d48d95d43e3d" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" dependencies = [ + "indexmap 2.0.2", "serde", + "serde_spanned", + "toml_datetime", + "winnow", ] [[package]] name = "typenum" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "unicode-ident" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-width" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" [[package]] name = "unsafe-libyaml" @@ -891,7 +927,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.38", "wasm-bindgen-shared", ] @@ -913,7 +949,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.38", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -957,9 +993,9 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", @@ -972,42 +1008,51 @@ dependencies = [ [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_i686_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "winnow" +version = "0.5.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "037711d82167854aff2018dfd193aa0fef5370f456732f0d5a0c59b0f1b4b907" +dependencies = [ + "memchr", +] diff --git a/Cargo.toml b/Cargo.toml index fb3dd0d5..a017d2e8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,7 @@ license = "Apache-2.0" [package] name = "client_side_validation" -version = "0.10.5" +version = "0.10.6" description = "Client-side validation foundation library" keywords = ["lnp-bp", "smart-contracts", "blockchain"] categories = ["cryptography"] @@ -40,8 +40,8 @@ name = "client_side_validation" path = "src/lib.rs" [dependencies] -commit_verify = { version = "0.10.5", path = "./commit_verify", default-features = false } -single_use_seals = { version = "0.10.0", path = "./single_use_seals" } +commit_verify = { version = "0.10.6", path = "./commit_verify", default-features = false } +single_use_seals = { version = "0.10.1", path = "./single_use_seals" } serde_crate = { package = "serde", version = "1", features = ["derive"], optional = true } [features] diff --git a/commit_verify/Cargo.toml b/commit_verify/Cargo.toml index d6f9f19f..62c4e8e3 100644 --- a/commit_verify/Cargo.toml +++ b/commit_verify/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "commit_verify" -version = "0.10.5" +version = "0.10.6" description = "Commit-verify API for client-side validation" keywords = ["lnp-bp", "smart-contracts", "blockchain", "commitments"] categories = ["cryptography"] @@ -22,11 +22,12 @@ name = "commit-stl" required-features = ["stl"] [dependencies] -amplify = { version = "4.0.0", features = ["hex", "apfloat"] } +amplify = { version = "4.5.0", features = ["hex", "apfloat"] } commit_encoding_derive = { version = "0.10.0", path = "derive" } -strict_encoding = "2.5.0" -strict_types = { version = "1.6.0", optional = true } -sha2 = "0.10.6" +strict_encoding = "2.6.0" +strict_types = { version = "1.6.2", optional = true } +sha2 = "0.10.8" +ripemd = "0.1.3" rand = { version = "0.8.5", optional = true } serde_crate = { version = "1.0", package = "serde", optional = true } diff --git a/commit_verify/src/digest.rs b/commit_verify/src/digest.rs index e4f409b7..e1d1d14f 100644 --- a/commit_verify/src/digest.rs +++ b/commit_verify/src/digest.rs @@ -20,9 +20,10 @@ // limitations under the License. use amplify::num::u24; +pub use ripemd::Ripemd160; pub use sha2::{Digest, Sha256}; -pub trait DigestExt: Digest { +pub trait DigestExt: Digest { fn from_tag(tag: impl AsRef<[u8]>) -> Self; fn input_raw(&mut self, data: &[u8]); fn input_with_len(&mut self, data: &[u8]) { @@ -36,7 +37,7 @@ pub trait DigestExt: Digest { } self.input_raw(data); } - fn finish(self) -> [u8; 32]; + fn finish(self) -> [u8; BYTE_LEN]; } impl DigestExt for Sha256 { @@ -55,3 +56,20 @@ impl DigestExt for Sha256 { fn finish(self) -> [u8; 32] { self.finalize().into() } } + +impl DigestExt<20> for Ripemd160 { + fn from_tag(tag: impl AsRef<[u8]>) -> Self { + let mut tagger = Ripemd160::default(); + tagger.update(tag); + let tag = tagger.finalize(); + + let mut engine = Ripemd160::default(); + engine.update(tag); + engine.update(tag); + engine + } + + fn input_raw(&mut self, data: &[u8]) { self.update(data); } + + fn finish(self) -> [u8; 20] { self.finalize().into() } +} diff --git a/commit_verify/src/lib.rs b/commit_verify/src/lib.rs index 251e87ef..fc5e50f0 100644 --- a/commit_verify/src/lib.rs +++ b/commit_verify/src/lib.rs @@ -45,10 +45,10 @@ extern crate core; #[cfg(feature = "derive")] pub use commit_encoding_derive::CommitEncode; -pub(self) mod commit; +mod commit; mod conceal; mod convolve; -pub(self) mod embed; +mod embed; mod encode; mod id; #[cfg(feature = "stl")] @@ -61,7 +61,7 @@ mod digest; pub use commit::{CommitVerify, StrictEncodedProtocol, TryCommitVerify}; pub use conceal::Conceal; pub use convolve::{ConvolveCommit, ConvolveCommitProof}; -pub use digest::{Digest, DigestExt, Sha256}; +pub use digest::{Digest, DigestExt, Ripemd160, Sha256}; pub use embed::{EmbedCommitProof, EmbedCommitVerify, VerifyEq}; pub use encode::{strategies, CommitEncode, CommitStrategy}; pub use id::CommitmentId; diff --git a/commit_verify/src/mpc/atoms.rs b/commit_verify/src/mpc/atoms.rs index c6aae141..cabd371d 100644 --- a/commit_verify/src/mpc/atoms.rs +++ b/commit_verify/src/mpc/atoms.rs @@ -23,7 +23,7 @@ use std::io::Write; use amplify::confinement::MediumOrdMap; use amplify::num::u5; -use amplify::{Bytes32, Wrapper}; +use amplify::{Bytes32, FromSliceError, Wrapper}; use crate::id::CommitmentId; use crate::merkle::MerkleNode; @@ -56,7 +56,13 @@ impl CommitStrategy for ProtocolId { } impl ProtocolId { - pub fn from_slice(slice: &[u8]) -> Option { Bytes32::from_slice(slice).map(Self) } + #[deprecated(since = "0.10.6", note = "use copy_from_slice")] + pub fn from_slice(slice: &[u8]) -> Option { + Bytes32::copy_from_slice(slice).ok().map(Self) + } + pub fn copy_from_slice(slice: &[u8]) -> Result { + Bytes32::copy_from_slice(slice).map(Self) + } } /// Original message participating in multi-message commitment. @@ -80,7 +86,13 @@ pub struct Message( ); impl Message { - pub fn from_slice(slice: &[u8]) -> Option { Bytes32::from_slice(slice).map(Self) } + #[deprecated(since = "0.10.6", note = "use copy_from_slice")] + pub fn from_slice(slice: &[u8]) -> Option { + Bytes32::copy_from_slice(slice).ok().map(Self) + } + pub fn copy_from_slice(slice: &[u8]) -> Result { + Bytes32::copy_from_slice(slice).map(Self) + } } #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug, From)] @@ -149,7 +161,13 @@ impl CommitStrategy for Commitment { } impl Commitment { - pub fn from_slice(slice: &[u8]) -> Option { Bytes32::from_slice(slice).map(Self) } + #[deprecated(since = "0.10.6", note = "use copy_from_slice")] + pub fn from_slice(slice: &[u8]) -> Option { + Bytes32::copy_from_slice(slice).ok().map(Self) + } + pub fn copy_from_slice(slice: &[u8]) -> Result { + Bytes32::copy_from_slice(slice).map(Self) + } } // TODO: Either this type or [`MerkleTree`] should remain diff --git a/commit_verify/src/mpc/block.rs b/commit_verify/src/mpc/block.rs index 887dee6c..7cce1487 100644 --- a/commit_verify/src/mpc/block.rs +++ b/commit_verify/src/mpc/block.rs @@ -120,6 +120,8 @@ impl TreeNode { pub fn is_leaf(&self) -> bool { matches!(self, TreeNode::CommitmentLeaf { .. }) } + // TODO: Remove in v0.11 and change the function signature + #[allow(clippy::wrong_self_convention)] pub fn to_merkle_node(&self) -> MerkleNode { match self { TreeNode::ConcealedNode { hash, .. } => *hash, diff --git a/single_use_seals/Cargo.toml b/single_use_seals/Cargo.toml index a929a5dd..52c9b693 100644 --- a/single_use_seals/Cargo.toml +++ b/single_use_seals/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "single_use_seals" -version = "0.10.0" +version = "0.10.1" description = "Single-use-seals foundation API" keywords = ["lnp-bp", "smart-contracts", "blockchain", "single-use-seals"] categories = ["cryptography"] @@ -17,8 +17,8 @@ name = "single_use_seals" path = "src/lib.rs" [dependencies] -amplify_derive = "4.0.0-alpha.6" -async-trait = { version = "0.1.64", optional = true } +amplify_derive = "4.0.0" +async-trait = { version = "0.1.73", optional = true } [features] default = []