From 5b73efeb284136f1bebdf29a7cda4257fe1acb2a Mon Sep 17 00:00:00 2001 From: Mikhael Skvortsov Date: Mon, 23 Jan 2023 19:11:51 +0300 Subject: [PATCH 1/2] Update dependencies --- Cargo.lock | 355 ++++++++++++++++++----------------------- Cargo.toml | 12 +- src/disasm/commands.rs | 12 +- src/disasm/loader.rs | 10 +- src/disasm/tests.rs | 4 +- src/main.rs | 15 +- src/methdict.rs | 6 +- src/parser.rs | 14 +- src/program.rs | 31 ++-- src/testcall.rs | 20 +-- 10 files changed, 216 insertions(+), 263 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bfe62f4f..4971c4cc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.17.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" +checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" dependencies = [ "gimli", ] @@ -19,9 +19,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aho-corasick" -version = "0.7.19" +version = "0.7.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4f55bd91a0978cbfd91c457a164bab8b4001c833b7f323132c0a4e1922dd44e" +checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" dependencies = [ "memchr", ] @@ -58,11 +58,11 @@ checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" [[package]] name = "assert_cmd" -version = "2.0.5" +version = "2.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5c2ca00549910ec251e3bd15f87aeeb206c9456b9a77b43ff6c97c54042a472" +checksum = "9834fcc22e0874394a010230586367d4a3e9f11b560f469262678547e1d2575e" dependencies = [ - "bstr", + "bstr 1.1.0", "doc-comment", "predicates", "predicates-core", @@ -76,7 +76,7 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "hermit-abi", + "hermit-abi 0.1.19", "libc", "winapi", ] @@ -89,9 +89,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.66" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cab84319d616cfb654d03394f38ab7e6f0919e181b1b57e1fd15e7fb4077d9a7" +checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca" dependencies = [ "addr2line", "cc", @@ -113,9 +113,9 @@ dependencies = [ [[package]] name = "base64" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "bitflags" @@ -134,25 +134,13 @@ dependencies = [ "constant_time_eq", ] -[[package]] -name = "block-buffer" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" -dependencies = [ - "block-padding", - "byte-tools", - "byteorder", - "generic-array 0.12.4", -] - [[package]] name = "block-buffer" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" dependencies = [ - "generic-array 0.14.6", + "generic-array", ] [[package]] @@ -161,27 +149,28 @@ version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" dependencies = [ - "generic-array 0.14.6", + "generic-array", ] [[package]] -name = "block-padding" -version = "0.1.5" +name = "bstr" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" +checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" dependencies = [ - "byte-tools", + "memchr", ] [[package]] name = "bstr" -version = "0.2.17" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" +checksum = "b45ea9b00a7b3f2988e9a65ad3917e62123c38dba709b666506207be96d1790b" dependencies = [ - "lazy_static", "memchr", + "once_cell", "regex-automata", + "serde", ] [[package]] @@ -192,15 +181,9 @@ checksum = "b4ae4235e6dac0694637c763029ecea1a2ec9e4e06ec2729bd21ba4d9c863eb7" [[package]] name = "bumpalo" -version = "3.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" - -[[package]] -name = "byte-tools" -version = "0.3.1" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" +checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" [[package]] name = "byteorder" @@ -210,9 +193,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "cc" -version = "1.0.73" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" +checksum = "a20104e2335ce8a659d6dd92a51a767a0c062599c73b343fd152cb401e828c3d" dependencies = [ "jobserver", ] @@ -225,9 +208,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.22" +version = "0.4.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfd4d1b31faaa3a89d7934dbded3111da0d2ef28e3ebccdb4f0179f5929d1ef1" +checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f" dependencies = [ "iana-time-zone", "js-sys", @@ -304,9 +287,9 @@ dependencies = [ [[package]] name = "crc-catalog" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d0165d2900ae6778e36e80bbc4da3b5eefccee9ba939761f9c2882a5d9af3ff" +checksum = "9cace84e55f07e7301bae1c519df89cdad8cc3cd868413d3fdbdeca9ff3db484" [[package]] name = "crossbeam-channel" @@ -331,9 +314,9 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.11" +version = "0.9.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f916dfc5d356b0ed9dae65f1db9fc9770aa2851d2662b988ccf4fe3516e86348" +checksum = "01a9af1f4c2ef74bb8aa1f7e19706bc72d03598c8a570bb5de72243c7a9d9d5a" dependencies = [ "autocfg", "cfg-if", @@ -344,9 +327,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.12" +version = "0.8.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edbafec5fa1f196ca66527c1b12c2ec4745ca14b50f1ad8f9f6f720b55d11fac" +checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f" dependencies = [ "cfg-if", ] @@ -357,7 +340,7 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "generic-array 0.14.6", + "generic-array", "typenum", ] @@ -376,9 +359,9 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.79" +version = "1.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f83d0ebf42c6eafb8d7c52f7e5f2d3003b89c7aa4fd2b79229209459a849af8" +checksum = "b61a7545f753a88bcbe0a70de1fcc0221e10bfc752f576754fa91e663db1622e" dependencies = [ "cc", "cxxbridge-flags", @@ -388,9 +371,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.79" +version = "1.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07d050484b55975889284352b0ffc2ecbda25c0c55978017c132b29ba0818a86" +checksum = "f464457d494b5ed6905c63b0c4704842aba319084a0a3561cdc1359536b53200" dependencies = [ "cc", "codespan-reporting", @@ -403,15 +386,15 @@ dependencies = [ [[package]] name = "cxxbridge-flags" -version = "1.0.79" +version = "1.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99d2199b00553eda8012dfec8d3b1c75fce747cf27c169a270b3b99e3448ab78" +checksum = "43c7119ce3a3701ed81aca8410b9acf6fc399d2629d057b87e2efa4e63a3aaea" [[package]] name = "cxxbridge-macro" -version = "1.0.79" +version = "1.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcb67a6de1f602736dd7eaead0080cf3435df806c61b24b13328db128c58868f" +checksum = "65e07508b90551e610910fa648a1878991d367064997a596135b86df30daf07e" dependencies = [ "proc-macro2", "quote", @@ -433,29 +416,20 @@ dependencies = [ "ansi_term", ] -[[package]] -name = "digest" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" -dependencies = [ - "generic-array 0.12.4", -] - [[package]] name = "digest" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" dependencies = [ - "generic-array 0.14.6", + "generic-array", ] [[package]] name = "digest" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adfbc57365a37acbd2ebf2b64d7e69bb766e2fea813521ed536f5d0520dcf86c" +checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" dependencies = [ "block-buffer 0.10.3", "crypto-common", @@ -480,9 +454,9 @@ checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" [[package]] name = "ed25519" -version = "1.5.2" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9c280362032ea4203659fc489832d0204ef09f247a0506f170dafcac08c369" +checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" dependencies = [ "signature", ] @@ -529,12 +503,6 @@ dependencies = [ "synstructure", ] -[[package]] -name = "fake-simd" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" - [[package]] name = "float-cmp" version = "0.9.0" @@ -544,15 +512,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "generic-array" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" -dependencies = [ - "typenum", -] - [[package]] name = "generic-array" version = "0.14.6" @@ -587,9 +546,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.26.2" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" +checksum = "221996f774192f0f718773def8201c4ae31f02616a54ccfc2d358bb0e5cefdec" [[package]] name = "hermit-abi" @@ -600,6 +559,15 @@ dependencies = [ "libc", ] +[[package]] +name = "hermit-abi" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" +dependencies = [ + "libc", +] + [[package]] name = "hex" version = "0.3.2" @@ -614,9 +582,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "iana-time-zone" -version = "0.1.51" +version = "0.1.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5a6ef98976b22b3b7f2f3a806f858cb862044cfa66805aa3ad84cb3d3b785ed" +checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -647,9 +615,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" +checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" [[package]] name = "jobserver" @@ -677,15 +645,15 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.135" +version = "0.2.139" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68783febc7782c6c5cb401fbda4de5a9898be1762314da0bb2c10ced61f18b0c" +checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" [[package]] name = "link-cplusplus" -version = "1.0.7" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9272ab7b96c9046fbc5bc56c06c117cb639fe2d509df0c421cad82d2915cf369" +checksum = "ecd207c9c713c34f95a097a5b029ac2ce6010530c7b49d7fea24d977dede04f5" dependencies = [ "cc", ] @@ -715,18 +683,18 @@ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "memoffset" -version = "0.6.5" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" dependencies = [ "autocfg", ] [[package]] name = "miniz_oxide" -version = "0.5.4" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96590ba8f175222643a85693f33d26e9c8a015f599c216509b1a6894af675d34" +checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" dependencies = [ "adler", ] @@ -764,9 +732,9 @@ dependencies = [ [[package]] name = "num-complex" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ae39348c8bc5fbd7f40c727a9925f03517afd2ab27d46702108b6a7e5414c19" +checksum = "02e0d21255c828d6f128a1e41534206671e8c3ea0c62f32291e808dc82cff17d" dependencies = [ "num-traits", ] @@ -826,34 +794,28 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.13.1" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" +checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" dependencies = [ - "hermit-abi", + "hermit-abi 0.2.6", "libc", ] [[package]] name = "object" -version = "0.29.0" +version = "0.30.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" +checksum = "ea86265d3d3dcb6a27fc51bd29a4bf387fae9d2986b823079d4986af253eb439" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.15.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1" - -[[package]] -name = "opaque-debug" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" +checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" [[package]] name = "opaque-debug" @@ -867,17 +829,23 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "30fceb411f9a12ff9222c5f824026be368ff15dc2f13468d850c7d3f502205d6" +[[package]] +name = "pkg-config" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" + [[package]] name = "ppv-lite86" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "predicates" -version = "2.1.1" +version = "2.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5aab5be6e4732b473071984b3164dbbfb7a3674d30ea5ff44410b6bcd960c3c" +checksum = "59230a63c37f3e18569bdb90e4a89cbf5bf8b06fea0b84e65ea10cc4df47addd" dependencies = [ "difflib", "float-cmp", @@ -889,15 +857,15 @@ dependencies = [ [[package]] name = "predicates-core" -version = "1.0.3" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da1c2388b1513e1b605fcec39a95e0a9e8ef088f71443ef37099fa9ae6673fcb" +checksum = "72f883590242d3c6fc5bf50299011695fa6590c2c70eac95ee1bdb9a733ad1a2" [[package]] name = "predicates-tree" -version = "1.0.5" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d86de6de25020a36c6d3643a86d9a6a9f552107c0559c60ea03551b5e16c032" +checksum = "54ff541861505aabf6ea722d2131ee980b8276e10a1297b94e896dd8b621850d" dependencies = [ "predicates-core", "termtree", @@ -905,18 +873,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.47" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" +checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.21" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" +checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" dependencies = [ "proc-macro2", ] @@ -994,21 +962,19 @@ dependencies = [ [[package]] name = "rayon" -version = "1.5.3" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd99e5772ead8baa5215278c9b15bf92087709e9c1b2d1f97cdb5a183c933a7d" +checksum = "6db3a213adf02b3bcfd2d3846bb41cb22857d131789e01df434fb7e7bc0759b7" dependencies = [ - "autocfg", - "crossbeam-deque", "either", "rayon-core", ] [[package]] name = "rayon-core" -version = "1.9.3" +version = "1.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "258bcdb5ac6dad48491bb2992db6b7cf74878b0384908af124823d118c99683f" +checksum = "356a0625f1954f730c0201cdab48611198dc6ce21f4acff55089b5a78e6e835b" dependencies = [ "crossbeam-channel", "crossbeam-deque", @@ -1035,9 +1001,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.6.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" +checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" dependencies = [ "aho-corasick", "memchr", @@ -1052,9 +1018,9 @@ checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" [[package]] name = "regex-syntax" -version = "0.6.27" +version = "0.6.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" +checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" [[package]] name = "rust-argon2" @@ -1062,7 +1028,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b18820d944b33caa75a71378964ac46f58517c92b6ae5f762636247c09e78fb" dependencies = [ - "base64 0.13.0", + "base64 0.13.1", "blake2b_simd", "constant_time_eq", "crossbeam-utils", @@ -1076,9 +1042,9 @@ checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" [[package]] name = "ryu" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" +checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" [[package]] name = "scopeguard" @@ -1088,24 +1054,24 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "scratch" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898" +checksum = "ddccb15bcce173023b3fedd9436f882a0739b8dfb45e4f6b6002bee5929f61b2" [[package]] name = "serde" -version = "1.0.146" +version = "1.0.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6df50b7a60a0ad48e1b42eb38373eac8ff785d619fb14db917b4e63d5439361f" +checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.146" +version = "1.0.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a714fd32ba1d66047ce7d53dabd809e9922d538f9047de13cc4cffca47b36205" +checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" dependencies = [ "proc-macro2", "quote", @@ -1114,27 +1080,15 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.87" +version = "1.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce777b7b150d76b9cf60d28b55f5847135a003f7d7350c6be7a773508ce7d45" +checksum = "877c235533714907a8c2464236f5c4b2a17262ef1bd71f38f35ea592c8da6883" dependencies = [ "itoa", "ryu", "serde", ] -[[package]] -name = "sha2" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69" -dependencies = [ - "block-buffer 0.7.3", - "digest 0.8.1", - "fake-simd", - "opaque-debug 0.2.3", -] - [[package]] name = "sha2" version = "0.9.9" @@ -1145,7 +1099,7 @@ dependencies = [ "cfg-if", "cpufeatures", "digest 0.9.0", - "opaque-debug 0.3.0", + "opaque-debug", ] [[package]] @@ -1156,7 +1110,7 @@ checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.5", + "digest 0.10.6", ] [[package]] @@ -1167,11 +1121,11 @@ checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" [[package]] name = "similar" -version = "2.2.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62ac7f900db32bf3fd12e0117dd3dc4da74bc52ebaac97f39668446d89694803" +checksum = "420acb44afdae038210c99e69aae24109f32f15500aa708e81d46c9f29d55fcf" dependencies = [ - "bstr", + "bstr 0.2.17", ] [[package]] @@ -1205,9 +1159,9 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.103" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a864042229133ada95abf3b54fdc62ef5ccabe9515b64717bcb9a1919e59445d" +checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" dependencies = [ "proc-macro2", "quote", @@ -1239,18 +1193,18 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.1.3" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" dependencies = [ "winapi-util", ] [[package]] name = "termtree" -version = "0.2.4" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "507e9898683b6c43a9aa55b64259b721b52ba226e0f3779137e50ad114a4c90b" +checksum = "95059e91184749cb66be6dc994f67f182b6d897cb3df74a5bf66b5e709295fd8" [[package]] name = "textwrap" @@ -1263,9 +1217,9 @@ dependencies = [ [[package]] name = "time" -version = "0.1.44" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" +checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" dependencies = [ "libc", "wasi 0.10.0+wasi-snapshot-preview1", @@ -1274,8 +1228,8 @@ dependencies = [ [[package]] name = "ton_abi" -version = "2.3.7" -source = "git+https://github.com/tonlabs/ton-labs-abi.git?tag=2.3.7#958fba895b3a7c4f255d89a0f292e2136350022c" +version = "2.3.54" +source = "git+https://github.com/tonlabs/ton-labs-abi.git?tag=2.3.54#9f74516f372373a1800e164e42b6912ee0d411e5" dependencies = [ "base64 0.10.1", "byteorder", @@ -1289,17 +1243,17 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "sha2 0.8.2", + "sha2 0.10.6", "ton_block", "ton_types", ] [[package]] name = "ton_block" -version = "1.8.3" -source = "git+https://github.com/tonlabs/ton-labs-block.git?tag=1.8.3#19a77eb0cccf6dc097ac934458976e1e91402ade" +version = "1.9.18" +source = "git+https://github.com/tonlabs/ton-labs-block.git?tag=1.9.18#92e30b957192b566b81f622da337f0705a5fc65a" dependencies = [ - "base64 0.13.0", + "base64 0.13.1", "crc 3.0.0", "ed25519", "ed25519-dalek", @@ -1314,8 +1268,8 @@ dependencies = [ [[package]] name = "ton_labs_assembler" -version = "1.2.49" -source = "git+https://github.com/tonlabs/ton-labs-assembler.git?tag=1.2.49#3402cd94fe15dfc249acbf891d40a41fface87c3" +version = "1.2.76" +source = "git+https://github.com/tonlabs/ton-labs-assembler.git?tag=1.2.76#ce41171a8c61fc3b917e50c3e864c1aeff4a0880" dependencies = [ "failure", "hex 0.4.3", @@ -1329,10 +1283,10 @@ dependencies = [ [[package]] name = "ton_types" -version = "1.11.4" -source = "git+https://github.com/tonlabs/ton-labs-types.git?tag=1.11.4#7f0063faa486298ba57ceb97e1d6e38447d6e0e3" +version = "1.12.6" +source = "git+https://github.com/tonlabs/ton-labs-types.git?tag=1.12.6#8e218813db6bacc138dbbec7ab4ccbf84220da31" dependencies = [ - "base64 0.13.0", + "base64 0.13.1", "crc 1.8.1", "failure", "hex 0.4.3", @@ -1349,8 +1303,8 @@ dependencies = [ [[package]] name = "ton_vm" -version = "1.8.44" -source = "git+https://github.com/tonlabs/ton-labs-vm.git?tag=1.8.44#5a83076b448cb35d2da7611552f76dea5cffc9db" +version = "1.8.96" +source = "git+https://github.com/tonlabs/ton-labs-vm.git?tag=1.8.96#f95aa63eac1e1682dcc81fcdabe352415ffdfde7" dependencies = [ "diffy", "ed25519", @@ -1362,7 +1316,7 @@ dependencies = [ "num", "num-traits", "rand 0.7.3", - "sha2 0.9.9", + "sha2 0.10.6", "similar", "ton_block", "ton_types", @@ -1371,10 +1325,10 @@ dependencies = [ [[package]] name = "tvm_linker" -version = "0.18.4" +version = "0.19.0" dependencies = [ "assert_cmd", - "base64 0.13.0", + "base64 0.13.1", "clap", "crc 3.0.0", "ed25519", @@ -1403,15 +1357,15 @@ dependencies = [ [[package]] name = "typenum" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" [[package]] name = "unicode-ident" -version = "1.0.5" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" +checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" [[package]] name = "unicode-width" @@ -1560,9 +1514,9 @@ dependencies = [ [[package]] name = "zeroize_derive" -version = "1.3.2" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f8f187641dad4f680d25c4bfc4225b418165984179f26ca76ec4fb6441d3a17" +checksum = "44bf07cb3e50ea2003396695d58bf46bc9887a1f362260446fad6bc4e79bd36c" dependencies = [ "proc-macro2", "quote", @@ -1591,10 +1545,11 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.1+zstd.1.5.2" +version = "2.0.5+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fd07cbbc53846d9145dbffdf6dd09a7a0aa52be46741825f5c97bdd4f73f12b" +checksum = "edc50ffce891ad571e9f9afe5039c4837bede781ac4bb13052ed7ae695518596" dependencies = [ "cc", "libc", + "pkg-config", ] diff --git a/Cargo.toml b/Cargo.toml index 5509d6cd..da322d98 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ license-file = 'LICENSE.md' name = 'tvm_linker' readme = 'README.md' repository = 'https://github.com/tonlabs/TVM-linker' -version = '0.18.4' +version = '0.19.0' [[bin]] name = 'tvm_linker' @@ -33,11 +33,11 @@ serde_json = '1.0.41' sha2 = '0.10' simplelog = '0.5.3' serde = { features = [ 'derive' ], version = '1.0.100' } -ton_abi = { git = 'https://github.com/tonlabs/ton-labs-abi.git', tag = '2.3.7' } -ton_block = { features = [ 'gosh' ], git = 'https://github.com/tonlabs/ton-labs-block.git', tag = '1.8.3' } -ton_labs_assembler = { features = [ 'gosh' ], git = 'https://github.com/tonlabs/ton-labs-assembler.git', tag = '1.2.49' } -ton_types = { git = 'https://github.com/tonlabs/ton-labs-types.git', tag = '1.11.4' } -ton_vm = { features = [ 'gosh' ], git = 'https://github.com/tonlabs/ton-labs-vm.git', tag = '1.8.44' } +ton_abi = { git = 'https://github.com/tonlabs/ton-labs-abi.git', tag = '2.3.54' } +ton_block = { features = [ 'gosh' ], git = 'https://github.com/tonlabs/ton-labs-block.git', tag = '1.9.18' } +ton_labs_assembler = { features = [ 'gosh' ], git = 'https://github.com/tonlabs/ton-labs-assembler.git', tag = '1.2.76' } +ton_types = { git = 'https://github.com/tonlabs/ton-labs-types.git', tag = '1.12.6' } +ton_vm = { features = [ 'gosh' ], git = 'https://github.com/tonlabs/ton-labs-vm.git', tag = '1.8.96' } [dev-dependencies] assert_cmd = '2.0.5' diff --git a/src/disasm/commands.rs b/src/disasm/commands.rs index 5b433c3b..2a54b6d2 100644 --- a/src/disasm/commands.rs +++ b/src/disasm/commands.rs @@ -58,7 +58,7 @@ fn disasm_graphviz_command(m: &ArgMatches) -> Status { if dict.len().is_err() { bail!("empty internal methods dictionary") } - let key = method_id.serialize().unwrap().into(); + let key = SliceData::load_cell(method_id.serialize()?)?; let data = dict.get(key).map_err(|e| format_err!("{}", e))? .ok_or_else(|| format_err!("internal method {} not found", method_id))?; let cell = data.into_cell(); @@ -193,7 +193,7 @@ fn print_code_dict(cell: &Cell, key_size: usize) { } for (key, slice) in dict.iter().map(|r| r.unwrap()) { let cell = key.into_cell().unwrap(); - let id = SliceData::from(cell).get_next_int(key_size).unwrap(); + let id = SliceData::load_cell(cell).unwrap().get_next_int(key_size).unwrap(); println!(); print_entrypoint(id as i32, None); println!("{}", disasm(&mut slice.clone())); @@ -223,7 +223,7 @@ fn disasm_text_command(m: &ArgMatches) -> Status { let mut roots = deserialize_cells_tree(&mut csor).map_err(|e| format_err!("{}", e))?; if m.is_present("RAW") { - println!("{}", disasm_ex(&mut SliceData::from(roots.get(0).unwrap()), true)); + println!("{}", disasm_ex(&mut SliceData::load_cell_ref(roots.get(0).unwrap())?, true)); return Ok(()) } @@ -276,13 +276,13 @@ fn disasm_text_command(m: &ArgMatches) -> Status { print_code_dict(&assigned["dict-c3"], 32); println!(";; internal transaction entry point"); print_entrypoint(0, Some("internal")); - println!("{}", disasm(&mut SliceData::from(&assigned["internal"]))); + println!("{}", disasm(&mut SliceData::load_cell_ref(&assigned["internal"])?)); println!(";; external transaction entry point"); print_entrypoint(-1, Some("external")); - println!("{}", disasm(&mut SliceData::from(&assigned["external"]))); + println!("{}", disasm(&mut SliceData::load_cell_ref(&assigned["external"])?)); println!(";; ticktock transaction entry point"); print_entrypoint(-2, Some("ticktock")); - println!("{}", disasm(&mut SliceData::from(&assigned["ticktock"]))); + println!("{}", disasm(&mut SliceData::load_cell_ref(&assigned["ticktock"])?)); } else if let Ok(assigned) = shape_fun_c.captures(&code) { println!(";; fun-c selector detected"); println!(";; internal functions dictionary"); diff --git a/src/disasm/loader.rs b/src/disasm/loader.rs index e203b15c..e45f8286 100644 --- a/src/disasm/loader.rs +++ b/src/disasm/loader.rs @@ -188,7 +188,7 @@ impl Loader { Ok(code.clone()) } } else { - let code = self.load(&mut SliceData::from(cell), false).unwrap_or_else(|_| { + let code = self.load(&mut SliceData::load_cell_ref(cell)?, false).unwrap_or_else(|_| { // failed to load the cell - emit it as-is vec!(Instruction::new(".cell").with_param(InstructionParameter::Cell { cell: cell.clone(), collapsed: false })) }); @@ -1824,7 +1824,7 @@ impl DelimitedHashmapE { } } for i in 0..slice.remaining_references() { - let child = SliceData::from(slice.reference(i).unwrap()); + let child = SliceData::load_cell(slice.reference(i)?)?; let mut next = path.clone(); next.push(i as u8); if let Ok(v) = Self::locate(child, target, next) { @@ -1834,10 +1834,10 @@ impl DelimitedHashmapE { fail!("not found") } pub fn mark(&mut self) -> Result<()> { - let dict_slice = SliceData::from(self.dict.data().unwrap()); + let dict_slice = SliceData::load_cell_ref(self.dict.data().unwrap())?; for entry in self.dict.iter() { let (key, mut slice) = entry?; - let id = SliceData::from(key).get_next_int(self.dict.bit_len())?; + let id = SliceData::load_builder(key)?.get_next_int(self.dict.bit_len())?; let loc = Self::locate(dict_slice.clone(), &slice, vec!())?; let mut loader = Loader::new(false); let code = loader.load(&mut slice, true)?; @@ -1852,7 +1852,7 @@ impl DelimitedHashmapE { text += &format!("{}.cell ", indent); text += &format!("{{ ;; #{}\n", cell.repr_hash().to_hex_string()); let inner_indent = String::from(" ") + indent; - let mut slice = SliceData::from(cell); + let mut slice = SliceData::load_cell_ref(cell).unwrap(); if let Some((id, offset, code)) = self.map.get(&path) { let aux = slice.get_next_slice(*offset).unwrap(); text += &format!("{}.blob x{}\n", inner_indent, aux.to_hex_string()); diff --git a/src/disasm/tests.rs b/src/disasm/tests.rs index c64e2806..dd1edeac 100644 --- a/src/disasm/tests.rs +++ b/src/disasm/tests.rs @@ -33,9 +33,9 @@ fn round_trip_test(filename: &str, check_bin: bool) { let raw0 = &std::fs::read_to_string(filename).unwrap(); let bin0 = base64::decode(raw0).unwrap(); let toc0 = ton_types::deserialize_tree_of_cells(&mut std::io::Cursor::new(bin0)).unwrap(); - let mut asm0 = disasm(&mut SliceData::from(toc0.clone())); + let mut asm0 = disasm(&mut SliceData::load_cell(toc0.clone()).unwrap()); let toc1 = ton_labs_assembler::compile_code_to_cell(&asm0.clone()).unwrap(); - let mut asm1 = disasm(&mut SliceData::from(toc1.clone())); + let mut asm1 = disasm(&mut SliceData::load_cell(toc1.clone()).unwrap()); if !check_bin { asm0 = cut_asm_hashes(asm0); diff --git a/src/main.rs b/src/main.rs index 1ac1a8ad..c7688d2d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -57,7 +57,7 @@ use ton_block::{Deserializable, Message, StateInit, Serializable, Account, MsgAd use std::io::Write; use std::{path::Path}; use testcall::{call_contract, MsgInfo, TestCallParams, TraceLevel}; -use ton_types::{BuilderData, SliceData, Result, Status, AccountId, BagOfCells, BocSerialiseMode, UInt256}; +use ton_types::{SliceData, Result, Status, AccountId, BagOfCells, BocSerialiseMode, UInt256}; use std::env; use disasm::commands::disasm_command; use ton_labs_assembler::{Line, compile_code_to_cell}; @@ -223,7 +223,7 @@ fn linker_main() -> Status { Some(data) => { let buf = hex::decode(data).map_err(|e| format_err!("data argument has invalid format: {}", e))?; let len = buf.len() * 8; - let body: SliceData = BuilderData::with_raw(buf, len)?.into_cell()?.into(); + let body = SliceData::from_raw(buf, len); Some(body) }, None => { @@ -502,11 +502,7 @@ fn run_test_subcmd(matches: &ArgMatches) -> Status { .map_err(|e| format_err!("failed to resolve body {}: {}", hex_str, e))?; let (buf, buf_bits) = decode_hex_string(resolved.text)?; - let body: SliceData = BuilderData::with_raw(buf, buf_bits) - .map_err(|e| format_err!("failed to pack body in cell: {}", e))? - .into_cell() - .map_err(|e| format_err!("failed to pack body in cell: {}", e))? - .into(); + let body = SliceData::from_raw(buf, buf_bits); (Some(body), Some(matches.value_of("SIGN"))) }, None => (build_body(matches, Some(address.to_string()))?, None), @@ -647,7 +643,7 @@ fn build_body(matches: &ArgMatches, address: Option) -> Result) -> Result( where T: Clone + Default + Eq + std::fmt::Display + Serializable + std::hash::Hash, { - let bit_len = SliceData::from(T::default().serialize().unwrap()).remaining_bits(); + let bit_len = SliceData::load_cell(T::default().serialize().unwrap()).unwrap().remaining_bits(); let mut map = HashmapE::with_bit_len(bit_len); let mut dbg = DbgInfo::default(); insert_methods(&mut map, &mut dbg, methods, adjust_entry_points)?; @@ -39,8 +39,8 @@ where T: Clone + Default + Eq + std::fmt::Display + Serializable + std::hash::Hash, { for pair in methods.iter() { - let key: SliceData = pair.0.clone().serialize() - .map_err(|e| (pair.0.clone(), format!("Failed to serialize data: {}", e)))?.into(); + let key: SliceData = SliceData::load_cell(pair.0.clone().serialize() + .map_err(|e| (pair.0.clone(), format!("Failed to serialize data: {}", e)))?).unwrap(); let mut val = compile_code_debuggable(pair.1.clone()).map_err(|e| { (pair.0.clone(), e.to_string()) })?; diff --git a/src/parser.rs b/src/parser.rs index 1acf02a3..ba401fcc 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -935,7 +935,10 @@ impl ParseEngine { for item in data_vec { let mut ptr = *item.0; for subitem in item.1 { - dict.set(ptr_to_builder(ptr).unwrap().into_cell().unwrap().into(), &subitem.write().unwrap_or_default().into_cell().unwrap().into()).unwrap(); + dict.set( + SliceData::load_builder(ptr_to_builder(ptr).unwrap()).unwrap(), + &SliceData::load_builder(subitem.write().unwrap_or_default()).unwrap() + ).unwrap(); ptr += subitem.size(); } } @@ -954,15 +957,15 @@ impl ParseEngine { globl_cell.append_bit_zero().unwrap(); } pers_dict.set( - ptr_to_builder(self.persistent_base + OFFSET_GLOBL_DATA).unwrap().into_cell().unwrap().into(), - &globl_cell.into_cell().unwrap().into() + SliceData::load_builder(ptr_to_builder(self.persistent_base + OFFSET_GLOBL_DATA).unwrap()).unwrap(), + &SliceData::load_builder(globl_cell).unwrap() ).unwrap(); pers_dict.data().cloned() } fn encode_computed_cell(&self, cell: &Cell, toplevel: bool) -> Lines { - let slice = SliceData::from(cell); + let slice = SliceData::load_cell(cell.clone()).unwrap(); let mut lines = vec!(); let opening = if toplevel { "{\n" } else { ".cell {\n" }; lines.push(Line::new(opening, "", 0)); @@ -1142,7 +1145,6 @@ mod tests { use ton_vm::executor::Engine; use ton_labs_assembler::compile_code; use ton_vm::stack::{Stack, StackItem}; - use std::sync::Arc; #[test] fn test_parser_testlib() { @@ -1233,7 +1235,7 @@ mod tests { )).expect("Couldn't compile code"); let mut stack = Stack::new(); - stack.push(StackItem::Slice(data_dict.into_cell().unwrap().into())); + stack.push(StackItem::Slice(SliceData::load_builder(data_dict).unwrap())); let mut engine = Engine::with_capabilities(0).setup_with_libraries( code, None, Some(stack), None, vec![] diff --git a/src/program.rs b/src/program.rs index f65f9f4a..4e95eac7 100644 --- a/src/program.rs +++ b/src/program.rs @@ -81,14 +81,14 @@ impl Program { data_dict = HashmapE::with_hashmap(64, persistent_data) } } - let key = ptr_to_builder(persistent_base)?.into_cell()?.into(); + let key = SliceData::load_builder(ptr_to_builder(persistent_base)?)?; let data = BuilderData::with_raw(bytes.to_vec(), PUBLIC_KEY_LENGTH * 8)?; - data_dict.set(key, &data.into_cell()?.into()) + data_dict.set(key, &SliceData::load_builder(data)?) .map_err(|e| format_err!("failed to pack pubkey to data dictionary: {}", e))?; let mut builder = BuilderData::new(); builder - .append_bit_one().unwrap() - .checked_append_reference(data_dict.data().unwrap().clone()).unwrap(); + .append_bit_one()? + .checked_append_reference(data_dict.data().unwrap().clone())?; builder.into_cell() } @@ -166,7 +166,7 @@ impl Program { ]; let mut internal_selector = compile_code_debuggable(internal_selector_text) .map_err(|e| format_err!("unexpected error while compiling internal selector: {}", e))?; - internal_selector.0.append_reference(self.internal_method_dict()?.unwrap_or_default().into()); + internal_selector.0.append_reference(SliceData::load_cell(self.internal_method_dict()?.unwrap_or_default())?); // adjust hash of internal_selector cell let hash = internal_selector.0.cell().repr_hash(); @@ -176,7 +176,7 @@ impl Program { let (mut main_selector, main_selector_dbg) = compile_code_debuggable(self.entry()) .map_err(|e| format_err!("unexpected error while compiling main selector: {}", e))?; - main_selector.append_reference(self.public_method_dict(remove_ctor)?.unwrap_or_default().into()); + main_selector.append_reference(SliceData::load_cell(self.public_method_dict(remove_ctor)?.unwrap_or_default())?); main_selector.append_reference(internal_selector.0); // adjust hash of main_selector cell @@ -215,13 +215,12 @@ impl Program { let mut entry_points = vec![]; for id in -2..1i32 { - let key = id.serialize()? - .into(); - let value = dict.0.remove(key).unwrap(); + let key = SliceData::load_cell(id.serialize()?)?; + let value = dict.0.remove(key)?; entry_points.push(value.unwrap_or_default()); } - internal_selector.0.append_reference(SliceData::from(dict.0.data().unwrap_or(&Cell::default()))); + internal_selector.0.append_reference(SliceData::load_cell(dict.0.data().cloned().unwrap_or_default())?); self.dbgmap.append(&mut dict.1); let version = self.engine.version(); @@ -356,7 +355,7 @@ pub fn load_from_file(contract_file: &str) -> Result { // try appending a dummy library cell if there is no such cell in the tvc file if cell.references_count() == 2 { let mut adjusted_cell = BuilderData::from(cell); - adjusted_cell.append_reference(BuilderData::default()); + adjusted_cell.checked_append_reference(Cell::default())?; cell = adjusted_cell.into_cell()?; } StateInit::construct_from_cell(cell) @@ -372,10 +371,10 @@ pub fn load_stateinit(file_name: &str) -> Result<(SliceData, Vec)> { let mut root = root_cells[0].clone(); if root.references_count() == 2 { // append empty library cell let mut adjusted_cell = BuilderData::from(root); - adjusted_cell.append_reference(BuilderData::default()); + adjusted_cell.checked_append_reference(Cell::default())?; root = adjusted_cell.into_cell()?; } - Ok((SliceData::from(root), orig_bytes)) + Ok((SliceData::load_cell(root)?, orig_bytes)) } pub fn get_now() -> u32 { @@ -528,7 +527,7 @@ mod tests { src: None, now: 1, bounced: false, - body: Some(body.into_cell().unwrap().into()) + body: Some(SliceData::load_builder(body).unwrap()) }, None, None, @@ -574,7 +573,7 @@ mod tests { src: None, now: 1, bounced: false, - body: Some(body.into_cell().unwrap().into()) + body: Some(SliceData::load_builder(body).unwrap()) }, None, None, @@ -633,7 +632,7 @@ mod tests { src: None, now: 1, bounced: false, - body: Some(body.into_cell().unwrap().into()) + body: Some(SliceData::load_builder(body).unwrap()) }, None, None, diff --git a/src/testcall.rs b/src/testcall.rs index 70759a27..adaac38e 100644 --- a/src/testcall.rs +++ b/src/testcall.rs @@ -86,8 +86,8 @@ fn sign_body(body: &mut SliceData, key_file: Option<&str>) -> Status { sign_builder.append_raw(&signature, signature.len() * 8)?; sign_builder.append_raw(&pub_key, pub_key.len() * 8)?; } - signed_body.prepend_reference(sign_builder); - *body = signed_body.into_cell()?.into(); + signed_body.checked_prepend_reference(sign_builder.into_cell()?)?; + *body = SliceData::load_cell(signed_body.into_cell()?)?; Ok(()) } @@ -104,7 +104,7 @@ fn initialize_registers( let info = SmartContractInfo { capabilities, balance, - myself: myself.serialize()?.into(), + myself: SliceData::load_cell(myself.serialize()?).unwrap(), mycode, unix_time, config_params, @@ -152,7 +152,7 @@ fn create_inbound_msg( Some(s) => MsgAddressExt::from_str(s)?, None => { MsgAddressExt::with_extern( - BuilderData::with_raw(vec![0x55; 8], 64)?.into_cell()?.into() + SliceData::from_raw(vec![0x55; 8], 64) ).map_err(|e| format_err!("Failed to create address: {}", e))? }, }; @@ -171,7 +171,7 @@ fn decode_actions(actions: StackItem, state: &mut StateInit, action_decoder: where F: Fn(SliceData, bool) { if let StackItem::Cell(cell) = actions { - let actions: OutActions = OutActions::construct_from(&mut cell.into())?; + let actions: OutActions = OutActions::construct_from(&mut SliceData::load_cell(cell)?)?; println!("Output actions:\n----------------"); for act in actions { match act { @@ -199,8 +199,8 @@ fn decode_actions(actions: StackItem, state: &mut StateInit, action_decoder: } pub fn load_code_and_data(state_init: &StateInit) -> (SliceData, SliceData) { - let code: SliceData = state_init.code.clone().unwrap_or_default().into(); - let data = state_init.data.clone().unwrap_or_default().into(); + let code: SliceData = SliceData::load_cell(state_init.code.clone().unwrap_or_default()).unwrap(); + let data = SliceData::load_cell(state_init.data.clone().unwrap_or_default()).unwrap(); (code, data) } @@ -369,7 +369,7 @@ pub fn call_contract( let mut body = match params.msg_info.body { Some(b) => b, - None => Cell::default().into(), + None => SliceData::default(), }; if func_selector == -1 { @@ -472,10 +472,10 @@ mod tests { fn test_msg_print() { let msg = create_external_inbound_msg( MsgAddressExt::with_extern( - BuilderData::with_raw(vec![0x55; 8], 64).unwrap().into_cell().unwrap().into() + SliceData::from_raw(vec![0x55; 8], 64) ).unwrap(), MsgAddressInt::with_standart(None, 0, [0x11; 32].into()).unwrap(), - Some(create_inbound_body(10, 20, 0x11223344).unwrap().into()), + Some(SliceData::load_cell(create_inbound_body(10, 20, 0x11223344).unwrap()).unwrap()), ); let _msg2 = create_internal_msg( From 7d345d8091ecdb479a4beabe3e235ceb19c65546 Mon Sep 17 00:00:00 2001 From: tonjen Date: Mon, 23 Jan 2023 16:27:15 +0000 Subject: [PATCH 2/2] Preparing to merge with the master --- Cargo.lock | 12 ++++++------ Cargo.toml | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4971c4cc..6b792ab7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1228,8 +1228,8 @@ dependencies = [ [[package]] name = "ton_abi" -version = "2.3.54" -source = "git+https://github.com/tonlabs/ton-labs-abi.git?tag=2.3.54#9f74516f372373a1800e164e42b6912ee0d411e5" +version = "2.3.56" +source = "git+https://github.com/tonlabs/ton-labs-abi.git?tag=2.3.56#4650ec840b143b6158f32048bbfa2a847574c733" dependencies = [ "base64 0.10.1", "byteorder", @@ -1250,8 +1250,8 @@ dependencies = [ [[package]] name = "ton_block" -version = "1.9.18" -source = "git+https://github.com/tonlabs/ton-labs-block.git?tag=1.9.18#92e30b957192b566b81f622da337f0705a5fc65a" +version = "1.9.20" +source = "git+https://github.com/tonlabs/ton-labs-block.git?tag=1.9.20#7714c0f8bcaa105f1b12755183f5a3bba19dd73d" dependencies = [ "base64 0.13.1", "crc 3.0.0", @@ -1303,8 +1303,8 @@ dependencies = [ [[package]] name = "ton_vm" -version = "1.8.96" -source = "git+https://github.com/tonlabs/ton-labs-vm.git?tag=1.8.96#f95aa63eac1e1682dcc81fcdabe352415ffdfde7" +version = "1.8.100" +source = "git+https://github.com/tonlabs/ton-labs-vm.git?tag=1.8.100#4ae66b88f6ee8ac96aa0cbfaef0bfb78fdc4f3de" dependencies = [ "diffy", "ed25519", diff --git a/Cargo.toml b/Cargo.toml index da322d98..0c400412 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,11 +33,11 @@ serde_json = '1.0.41' sha2 = '0.10' simplelog = '0.5.3' serde = { features = [ 'derive' ], version = '1.0.100' } -ton_abi = { git = 'https://github.com/tonlabs/ton-labs-abi.git', tag = '2.3.54' } -ton_block = { features = [ 'gosh' ], git = 'https://github.com/tonlabs/ton-labs-block.git', tag = '1.9.18' } +ton_abi = { git = 'https://github.com/tonlabs/ton-labs-abi.git', tag = '2.3.56' } +ton_block = { features = [ 'gosh' ], git = 'https://github.com/tonlabs/ton-labs-block.git', tag = '1.9.20' } ton_labs_assembler = { features = [ 'gosh' ], git = 'https://github.com/tonlabs/ton-labs-assembler.git', tag = '1.2.76' } ton_types = { git = 'https://github.com/tonlabs/ton-labs-types.git', tag = '1.12.6' } -ton_vm = { features = [ 'gosh' ], git = 'https://github.com/tonlabs/ton-labs-vm.git', tag = '1.8.96' } +ton_vm = { features = [ 'gosh' ], git = 'https://github.com/tonlabs/ton-labs-vm.git', tag = '1.8.100' } [dev-dependencies] assert_cmd = '2.0.5'