diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d1f82675..f7420a6d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -90,7 +90,7 @@ jobs: uses: actions-rs/cargo@v1 with: command: test - args: test_cmd_dove_build_without_arguments + args: test_cmd_dove_run_with_params # Test All - name: Test All diff --git a/Cargo.lock b/Cargo.lock index 370a25f3..9e20b6d3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8,27 +8,10 @@ version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" dependencies = [ - "lazy_static", + "lazy_static 1.4.0", "regex", ] -[[package]] -name = "abigen" -version = "0.1.0" -source = "git+https://github.com/pontem-network/diem.git?branch=v1.5-pre#2312f95e36d931814a88378c7117d3a6bb1f3809" -dependencies = [ - "anyhow", - "bcs", - "bytecode-verifier", - "diem-workspace-hack", - "heck", - "log", - "move-command-line-common", - "move-core-types", - "move-model", - "serde", -] - [[package]] name = "addr2line" version = "0.14.1" @@ -196,7 +179,7 @@ dependencies = [ "miniz_oxide", "object", "rustc-demangle", - "serde", + "serde 1.0.133", ] [[package]] @@ -211,7 +194,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "510fd83e3eaf7263b06182f3550b4c0af2af42cb36ab8024969ff5ea7fcb2833" dependencies = [ - "serde", + "serde 1.0.133", "thiserror", ] @@ -221,6 +204,21 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2dabbe35f96fb9507f7330793dc490461b2962659ac5d427181e451a623751d1" +[[package]] +name = "bit-set" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e11e16035ea35e4e5997b393eacbf6f63983188f7a2ad25bfb13465f5ad59de" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" + [[package]] name = "bitflags" version = "1.3.2" @@ -295,54 +293,16 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" -[[package]] -name = "boogie-backend" -version = "0.1.0" -source = "git+https://github.com/pontem-network/diem.git?branch=v1.5-pre#2312f95e36d931814a88378c7117d3a6bb1f3809" -dependencies = [ - "anyhow", - "async-trait", - "bytecode", - "codespan", - "codespan-reporting", - "diem-workspace-hack", - "futures", - "itertools 0.10.3", - "log", - "move-binary-format", - "move-command-line-common", - "move-core-types", - "move-model", - "num", - "once_cell", - "pretty", - "rand 0.8.4", - "regex", - "serde", - "serde_json", - "tera", - "tokio 1.15.0", -] - -[[package]] -name = "borrow-graph" -version = "0.0.1" -source = "git+https://github.com/pontem-network/diem.git?branch=v1.5-pre#2312f95e36d931814a88378c7117d3a6bb1f3809" -dependencies = [ - "diem-workspace-hack", - "mirai-annotations", -] - [[package]] name = "bstr" version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" dependencies = [ - "lazy_static", + "lazy_static 1.4.0", "memchr", "regex-automata", - "serde", + "serde 1.0.133", ] [[package]] @@ -367,57 +327,10 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" -[[package]] -name = "bytecode" -version = "0.1.0" -source = "git+https://github.com/pontem-network/diem.git?branch=v1.5-pre#2312f95e36d931814a88378c7117d3a6bb1f3809" -dependencies = [ - "borrow-graph", - "bytecode-verifier", - "codespan", - "codespan-reporting", - "diem-workspace-hack", - "im", - "ir-to-bytecode", - "itertools 0.10.3", - "log", - "move-binary-format", - "move-command-line-common", - "move-core-types", - "move-model", - "num", - "once_cell", - "paste", - "petgraph", - "read-write-set-types", - "serde", - "serde_json", -] - -[[package]] -name = "bytecode-interpreter" -version = "0.1.0" -source = "git+https://github.com/pontem-network/diem.git?branch=v1.5-pre#2312f95e36d931814a88378c7117d3a6bb1f3809" -dependencies = [ - "anyhow", - "bytecode", - "bytecode-interpreter-crypto", - "codespan-reporting", - "diem-workspace-hack", - "itertools 0.10.3", - "move-binary-format", - "move-core-types", - "move-model", - "move-vm-runtime", - "num", - "serde", - "structopt", -] - [[package]] name = "bytecode-interpreter-crypto" version = "0.1.0" -source = "git+https://github.com/pontem-network/diem.git?branch=v1.5-pre#2312f95e36d931814a88378c7117d3a6bb1f3809" +source = "git+https://github.com/pontem-network/diem.git?branch=v1.5.1-pre#661c17af25be967c937048aa4f3d3c241ae03b93" dependencies = [ "anyhow", "curve25519-dalek-fiat", @@ -427,36 +340,6 @@ dependencies = [ "sha3", ] -[[package]] -name = "bytecode-source-map" -version = "0.1.0" -source = "git+https://github.com/pontem-network/diem.git?branch=v1.5-pre#2312f95e36d931814a88378c7117d3a6bb1f3809" -dependencies = [ - "anyhow", - "bcs", - "codespan-reporting", - "diem-workspace-hack", - "move-binary-format", - "move-core-types", - "move-ir-types", - "move-symbol-pool", - "serde", -] - -[[package]] -name = "bytecode-verifier" -version = "0.1.0" -source = "git+https://github.com/pontem-network/diem.git?branch=v1.5-pre#2312f95e36d931814a88378c7117d3a6bb1f3809" -dependencies = [ - "anyhow", - "borrow-graph", - "diem-workspace-hack", - "mirai-annotations", - "move-binary-format", - "move-core-types", - "petgraph", -] - [[package]] name = "byteorder" version = "1.4.3" @@ -475,9 +358,15 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" dependencies = [ - "serde", + "serde 1.0.133", ] +[[package]] +name = "cassowary" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df8670b8c7b9dae1793364eafadf7239c40d669904660c5960d74cfd80b46a53" + [[package]] name = "cc" version = "1.0.72" @@ -507,8 +396,8 @@ checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" dependencies = [ "libc", "num-integer", - "num-traits", - "serde", + "num-traits 0.2.14", + "serde 1.0.133", "time", "winapi 0.3.9", ] @@ -566,7 +455,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3362992a0d9f1dd7c3d0e89e0ab2bb540b7a95fea8cd798090e758fda2899b5e" dependencies = [ "codespan-reporting", - "serde", + "serde 1.0.133", ] [[package]] @@ -575,7 +464,7 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" dependencies = [ - "serde", + "serde 1.0.133", "termcolor", "unicode-width", ] @@ -587,10 +476,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3616f750b84d8f0de8a58bda93e08e2a81ad3f523089b05f1dffecab48c6cbd" dependencies = [ "atty", - "lazy_static", + "lazy_static 1.4.0", "winapi 0.3.9", ] +[[package]] +name = "config" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1b9d958c2b1368a663f05538fc1b5975adce1e19f435acceae987aceeeb369" +dependencies = [ + "lazy_static 1.4.0", + "nom", + "rust-ini", + "serde 1.0.133", + "serde-hjson", + "serde_json", + "toml", + "yaml-rust", +] + [[package]] name = "const-random" version = "0.1.13" @@ -607,8 +512,8 @@ version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "615f6e27d000a2bffbc7f2f6a8669179378fa27ee4d0a509e985dfc0a7defb40" dependencies = [ - "getrandom 0.2.3", - "lazy_static", + "getrandom 0.2.4", + "lazy_static 1.4.0", "proc-macro-hack", "tiny-keccak", ] @@ -679,7 +584,7 @@ checksum = "97242a70df9b89a65d0b6df3c4bf5b9ce03c5b7309019777fbde37e7537f8762" dependencies = [ "cfg-if 1.0.0", "crossbeam-utils", - "lazy_static", + "lazy_static 1.4.0", "memoffset", "scopeguard", ] @@ -701,7 +606,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfcae03edb34f947e64acdb1c33ec169824e20657e9ecb61cef6c8c74dcb8120" dependencies = [ "cfg-if 1.0.0", - "lazy_static", + "lazy_static 1.4.0", ] [[package]] @@ -762,12 +667,11 @@ checksum = "850878694b7933ca4c9569d30a34b55031b9b139ee1fc7b94a527c4ef960d690" [[package]] name = "dialect" version = "0.1.0" -source = "git+https://github.com/pontem-network/diem.git?branch=v1.5-pre#2312f95e36d931814a88378c7117d3a6bb1f3809" +source = "git+https://github.com/pontem-network/diem.git?branch=v1.5.1-pre#661c17af25be967c937048aa4f3d3c241ae03b93" dependencies = [ "anyhow", "bech32", "blake2-rfc", - "diem-workspace-hack", "move-binary-format", "move-core-types", "once_cell", @@ -778,7 +682,7 @@ dependencies = [ [[package]] name = "diem-crypto" version = "0.0.3" -source = "git+https://github.com/pontem-network/diem.git?branch=v1.5-pre#2312f95e36d931814a88378c7117d3a6bb1f3809" +source = "git+https://github.com/pontem-network/diem.git?branch=v1.5.1-pre#661c17af25be967c937048aa4f3d3c241ae03b93" dependencies = [ "aes-gcm", "anyhow", @@ -786,6 +690,7 @@ dependencies = [ "bytes 1.1.0", "curve25519-dalek-fiat", "diem-crypto-derive", + "diem-workspace-hack", "digest 0.9.0", "ed25519-dalek-fiat", "hex", @@ -794,7 +699,7 @@ dependencies = [ "once_cell", "rand 0.8.4", "rand_core 0.6.3", - "serde", + "serde 1.0.133", "serde-name", "serde_bytes", "sha2", @@ -807,8 +712,9 @@ dependencies = [ [[package]] name = "diem-crypto-derive" version = "0.0.3" -source = "git+https://github.com/pontem-network/diem.git?branch=v1.5-pre#2312f95e36d931814a88378c7117d3a6bb1f3809" +source = "git+https://github.com/pontem-network/diem.git?branch=v1.5.1-pre#661c17af25be967c937048aa4f3d3c241ae03b93" dependencies = [ + "diem-workspace-hack", "proc-macro2 1.0.36", "quote 1.0.14", "syn 1.0.85", @@ -817,7 +723,7 @@ dependencies = [ [[package]] name = "diem-types" version = "0.0.3" -source = "git+https://github.com/pontem-network/diem.git?branch=v1.5-pre#2312f95e36d931814a88378c7117d3a6bb1f3809" +source = "git+https://github.com/pontem-network/diem.git?branch=v1.5.1-pre#661c17af25be967c937048aa4f3d3c241ae03b93" dependencies = [ "aes-gcm", "anyhow", @@ -826,13 +732,15 @@ dependencies = [ "chrono", "diem-crypto", "diem-crypto-derive", + "diem-workspace-hack", "hex", "itertools 0.10.3", "mirai-annotations", "move-core-types", + "move-read-write-set-types", "once_cell", "rand 0.8.4", - "serde", + "serde 1.0.133", "serde_bytes", "serde_json", "thiserror", @@ -842,10 +750,11 @@ dependencies = [ [[package]] name = "diem-workspace-hack" version = "0.1.0" -source = "git+https://github.com/pontem-network/diem.git?branch=v1.5-pre#2312f95e36d931814a88378c7117d3a6bb1f3809" +source = "git+https://github.com/pontem-network/diem.git?branch=v1.5.1-pre#661c17af25be967c937048aa4f3d3c241ae03b93" dependencies = [ "Inflector", "anyhow", + "arrayvec 0.5.2", "backtrace", "bitvec", "block-buffer 0.9.0", @@ -867,7 +776,7 @@ dependencies = [ "futures-io", "futures-sink", "futures-util", - "getrandom 0.2.3", + "getrandom 0.2.4", "hyper 0.14.16", "indexmap", "itertools 0.10.3", @@ -876,10 +785,11 @@ dependencies = [ "log", "memchr", "num-integer", - "num-traits", - "petgraph", + "num-traits 0.2.14", + "petgraph 0.5.1", "plotters", "proc-macro2 0.4.30", + "proptest", "prost", "quote 0.6.13", "rand 0.8.4", @@ -889,10 +799,9 @@ dependencies = [ "regex-syntax", "reqwest 0.11.9", "rusty-fork", - "serde", + "serde 1.0.133", "serde_json", "standback", - "subtle", "syn 0.15.44", "syn 1.0.85", "tiny-keccak", @@ -901,9 +810,9 @@ dependencies = [ "toml", "tracing", "tracing-core", + "tracing-subscriber", "url", "warp", - "zeroize", ] [[package]] @@ -931,40 +840,23 @@ dependencies = [ ] [[package]] -name = "disassembler" -version = "0.1.0" -source = "git+https://github.com/pontem-network/diem.git?branch=v1.5-pre#2312f95e36d931814a88378c7117d3a6bb1f3809" +name = "directories" +version = "4.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f51c5d4ddabd36886dd3e1438cb358cdcb0d7c499cb99cb4ac2e38e18b5cb210" dependencies = [ - "anyhow", - "bytecode-source-map", - "bytecode-verifier", - "colored", - "diem-workspace-hack", - "move-binary-format", - "move-command-line-common", - "move-core-types", - "move-coverage", - "move-ir-types", - "structopt", + "dirs-sys", ] [[package]] -name = "docgen" -version = "0.1.0" -source = "git+https://github.com/pontem-network/diem.git?branch=v1.5-pre#2312f95e36d931814a88378c7117d3a6bb1f3809" +name = "dirs-sys" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03d86534ed367a67548dc68113a0f5db55432fdfbb6e6f9d77704397d95d5780" dependencies = [ - "anyhow", - "bytecode", - "codespan", - "codespan-reporting", - "diem-workspace-hack", - "itertools 0.10.3", - "log", - "move-model", - "num", - "once_cell", - "regex", - "serde", + "libc", + "redox_users", + "winapi 0.3.9", ] [[package]] @@ -974,8 +866,6 @@ dependencies = [ "anyhow", "atty", "bcs", - "boogie-backend", - "bytecode-source-map", "codespan-reporting", "dialect", "diem-types", @@ -983,14 +873,17 @@ dependencies = [ "hex", "itertools 0.9.0", "lang", - "lazy_static", + "lazy_static 1.4.0", "log", "move-binary-format", + "move-bytecode-source-map", "move-cli", + "move-command-line-common", + "move-compiler", "move-core-types", - "move-lang", "move-package", "move-prover", + "move-prover-boogie-backend", "move-stdlib", "move-symbol-pool", "move-vm-runtime", @@ -999,7 +892,7 @@ dependencies = [ "regex", "reqwest 0.10.10", "semver", - "serde", + "serde 1.0.133", "structopt", "termcolor", "toml", @@ -1012,7 +905,7 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74e1069e39f1454367eb2de793ed062fac4c35c2934b76a81d90dd9abcd28816" dependencies = [ - "serde", + "serde 1.0.133", "signature", ] @@ -1025,7 +918,7 @@ dependencies = [ "curve25519-dalek-fiat", "ed25519", "rand 0.8.4", - "serde", + "serde 1.0.133", "serde_bytes", "sha2", "zeroize", @@ -1046,28 +939,13 @@ dependencies = [ "cfg-if 1.0.0", ] -[[package]] -name = "errmapgen" -version = "0.1.0" -source = "git+https://github.com/pontem-network/diem.git?branch=v1.5-pre#2312f95e36d931814a88378c7117d3a6bb1f3809" -dependencies = [ - "anyhow", - "bcs", - "diem-workspace-hack", - "log", - "move-command-line-common", - "move-core-types", - "move-model", - "serde", -] - [[package]] name = "fail" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3be3c61c59fdc91f5dbc3ea31ee8623122ce80057058be560654c5d410d181a6" dependencies = [ - "lazy_static", + "lazy_static 1.4.0", "log", "rand 0.7.3", ] @@ -1099,6 +977,12 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d" +[[package]] +name = "fixedbitset" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "279fb028e20b3c4c320317955b77c5e0c9701f05a1d309905d6fc702cdc5053e" + [[package]] name = "fnv" version = "1.0.7" @@ -1278,9 +1162,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" +checksum = "418d37c8b1d42553c93648be529cb70f920d3baf8ef469b74b9638df426e0b4c" dependencies = [ "cfg-if 1.0.0", "libc", @@ -1609,7 +1493,7 @@ checksum = "713f1b139373f96a2e0ce3ac931cd01ee973c3c5dd7c40c0c2efe96ad2b6751d" dependencies = [ "crossbeam-utils", "globset", - "lazy_static", + "lazy_static 1.4.0", "log", "memchr", "regex", @@ -1704,39 +1588,6 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68f2d64f2edebec4ce84ad108148e67e1064789bee435edc5b60ad398714a3a9" -[[package]] -name = "ir-to-bytecode" -version = "0.1.0" -source = "git+https://github.com/pontem-network/diem.git?branch=v1.5-pre#2312f95e36d931814a88378c7117d3a6bb1f3809" -dependencies = [ - "anyhow", - "bytecode-source-map", - "codespan-reporting", - "diem-workspace-hack", - "ir-to-bytecode-syntax", - "log", - "move-binary-format", - "move-command-line-common", - "move-core-types", - "move-ir-types", - "move-symbol-pool", - "ouroboros", - "thiserror", -] - -[[package]] -name = "ir-to-bytecode-syntax" -version = "0.1.0" -source = "git+https://github.com/pontem-network/diem.git?branch=v1.5-pre#2312f95e36d931814a88378c7117d3a6bb1f3809" -dependencies = [ - "anyhow", - "diem-workspace-hack", - "hex", - "move-core-types", - "move-ir-types", - "move-symbol-pool", -] - [[package]] name = "itertools" version = "0.9.0" @@ -1809,21 +1660,41 @@ dependencies = [ "codespan-reporting", "include_dir", "move-binary-format", + "move-command-line-common", + "move-compiler", "move-core-types", "move-ir-types", - "move-lang", "move-symbol-pool", - "serde", + "serde 1.0.133", "tempfile", "walkdir", ] +[[package]] +name = "lazy_static" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73" + [[package]] name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +[[package]] +name = "lexical-core" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6607c62aa161d23d17a9072cc5da0be67cdfc89d3afb1e8d9c842bebc2525ffe" +dependencies = [ + "arrayvec 0.5.2", + "bitflags", + "cfg-if 1.0.0", + "ryu", + "static_assertions", +] + [[package]] name = "libc" version = "0.2.112" @@ -1852,7 +1723,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" dependencies = [ "cfg-if 1.0.0", - "serde", + "serde 1.0.133", ] [[package]] @@ -1861,6 +1732,15 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata", +] + [[package]] name = "matches" version = "0.1.9" @@ -1968,9 +1848,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c9be0862c1b3f26a88803c4a49de6889c10e608b3ee9344e6ef5b45fb37ad3d1" [[package]] -name = "move-binary-format" +name = "move-abigen" version = "0.1.0" -source = "git+https://github.com/pontem-network/diem.git?branch=v1.5-pre#2312f95e36d931814a88378c7117d3a6bb1f3809" +source = "git+https://github.com/pontem-network/diem.git?branch=v1.5.1-pre#661c17af25be967c937048aa4f3d3c241ae03b93" +dependencies = [ + "anyhow", + "bcs", + "diem-workspace-hack", + "heck", + "log", + "move-bytecode-verifier", + "move-command-line-common", + "move-core-types", + "move-model", + "serde 1.0.133", +] + +[[package]] +name = "move-binary-format" +version = "0.0.3" +source = "git+https://github.com/pontem-network/diem.git?branch=v1.5.1-pre#661c17af25be967c937048aa4f3d3c241ae03b93" dependencies = [ "anyhow", "diem-workspace-hack", @@ -1978,45 +1875,109 @@ dependencies = [ "move-core-types", "once_cell", "ref-cast", + "serde 1.0.133", "variant_count", ] +[[package]] +name = "move-borrow-graph" +version = "0.0.1" +source = "git+https://github.com/pontem-network/diem.git?branch=v1.5.1-pre#661c17af25be967c937048aa4f3d3c241ae03b93" +dependencies = [ + "diem-workspace-hack", + "mirai-annotations", +] + +[[package]] +name = "move-bytecode-source-map" +version = "0.1.0" +source = "git+https://github.com/pontem-network/diem.git?branch=v1.5.1-pre#661c17af25be967c937048aa4f3d3c241ae03b93" +dependencies = [ + "anyhow", + "bcs", + "codespan-reporting", + "diem-workspace-hack", + "move-binary-format", + "move-command-line-common", + "move-core-types", + "move-ir-types", + "move-symbol-pool", + "serde 1.0.133", +] + [[package]] name = "move-bytecode-utils" version = "0.1.0" -source = "git+https://github.com/pontem-network/diem.git?branch=v1.5-pre#2312f95e36d931814a88378c7117d3a6bb1f3809" +source = "git+https://github.com/pontem-network/diem.git?branch=v1.5.1-pre#661c17af25be967c937048aa4f3d3c241ae03b93" +dependencies = [ + "anyhow", + "diem-workspace-hack", + "move-binary-format", + "move-core-types", + "petgraph 0.5.1", +] + +[[package]] +name = "move-bytecode-verifier" +version = "0.1.0" +source = "git+https://github.com/pontem-network/diem.git?branch=v1.5.1-pre#661c17af25be967c937048aa4f3d3c241ae03b93" dependencies = [ "anyhow", "diem-workspace-hack", + "mirai-annotations", "move-binary-format", + "move-borrow-graph", "move-core-types", - "petgraph", + "petgraph 0.5.1", +] + +[[package]] +name = "move-bytecode-viewer" +version = "0.1.0" +source = "git+https://github.com/pontem-network/diem.git?branch=v1.5.1-pre#661c17af25be967c937048aa4f3d3c241ae03b93" +dependencies = [ + "anyhow", + "diem-workspace-hack", + "move-binary-format", + "move-bytecode-source-map", + "move-command-line-common", + "move-disassembler", + "move-ir-types", + "regex", + "structopt", + "termion", + "tui", ] [[package]] name = "move-cli" version = "0.1.0" -source = "git+https://github.com/pontem-network/diem.git?branch=v1.5-pre#2312f95e36d931814a88378c7117d3a6bb1f3809" +source = "git+https://github.com/pontem-network/diem.git?branch=v1.5.1-pre#661c17af25be967c937048aa4f3d3c241ae03b93" dependencies = [ "anyhow", "bcs", - "bytecode-verifier", "codespan-reporting", + "colored", "dialect", "diem-workspace-hack", "difference", - "disassembler", - "errmapgen", "include_dir", + "itertools 0.10.3", "move-binary-format", + "move-bytecode-source-map", "move-bytecode-utils", + "move-bytecode-verifier", + "move-bytecode-viewer", "move-command-line-common", + "move-compiler", "move-core-types", "move-coverage", + "move-disassembler", + "move-errmapgen", "move-ir-types", - "move-lang", "move-package", "move-prover", + "move-resource-viewer", "move-stdlib", "move-symbol-pool", "move-unit-test", @@ -2025,8 +1986,7 @@ dependencies = [ "once_cell", "read-write-set", "read-write-set-dynamic", - "resource-viewer", - "serde", + "serde 1.0.133", "serde_yaml", "structopt", "tempfile", @@ -2036,147 +1996,241 @@ dependencies = [ [[package]] name = "move-command-line-common" version = "0.1.0" -source = "git+https://github.com/pontem-network/diem.git?branch=v1.5-pre#2312f95e36d931814a88378c7117d3a6bb1f3809" +source = "git+https://github.com/pontem-network/diem.git?branch=v1.5.1-pre#661c17af25be967c937048aa4f3d3c241ae03b93" +dependencies = [ + "anyhow", + "diem-workspace-hack", + "difference", + "hex", + "serde 1.0.133", + "sha2", + "walkdir", +] + +[[package]] +name = "move-compiler" +version = "0.0.1" +source = "git+https://github.com/pontem-network/diem.git?branch=v1.5.1-pre#661c17af25be967c937048aa4f3d3c241ae03b93" dependencies = [ "anyhow", + "bcs", + "codespan-reporting", + "dialect", "diem-workspace-hack", "difference", + "hex", + "move-binary-format", + "move-borrow-graph", + "move-bytecode-source-map", + "move-bytecode-verifier", + "move-command-line-common", + "move-core-types", + "move-ir-to-bytecode", + "move-ir-types", + "move-symbol-pool", + "once_cell", + "petgraph 0.5.1", + "regex", + "structopt", + "tempfile", + "uint", "walkdir", ] [[package]] name = "move-core-types" version = "0.0.3" -source = "git+https://github.com/pontem-network/diem.git?branch=v1.5-pre#2312f95e36d931814a88378c7117d3a6bb1f3809" +source = "git+https://github.com/pontem-network/diem.git?branch=v1.5.1-pre#661c17af25be967c937048aa4f3d3c241ae03b93" dependencies = [ "anyhow", "bcs", + "diem-workspace-hack", "hex", "mirai-annotations", "once_cell", "rand 0.8.4", "ref-cast", - "serde", + "serde 1.0.133", "serde_bytes", ] [[package]] name = "move-coverage" version = "0.1.0" -source = "git+https://github.com/pontem-network/diem.git?branch=v1.5-pre#2312f95e36d931814a88378c7117d3a6bb1f3809" +source = "git+https://github.com/pontem-network/diem.git?branch=v1.5.1-pre#661c17af25be967c937048aa4f3d3c241ae03b93" dependencies = [ "anyhow", "bcs", - "bytecode-source-map", - "bytecode-verifier", "codespan", "colored", "diem-workspace-hack", "move-binary-format", + "move-bytecode-source-map", + "move-bytecode-verifier", "move-command-line-common", "move-core-types", "move-ir-types", "once_cell", - "petgraph", - "serde", + "petgraph 0.5.1", + "serde 1.0.133", "structopt", ] [[package]] -name = "move-ir-types" +name = "move-disassembler" version = "0.1.0" -source = "git+https://github.com/pontem-network/diem.git?branch=v1.5-pre#2312f95e36d931814a88378c7117d3a6bb1f3809" +source = "git+https://github.com/pontem-network/diem.git?branch=v1.5.1-pre#661c17af25be967c937048aa4f3d3c241ae03b93" dependencies = [ "anyhow", + "colored", "diem-workspace-hack", - "hex", + "move-binary-format", + "move-bytecode-source-map", + "move-bytecode-verifier", + "move-command-line-common", + "move-compiler", "move-core-types", - "move-symbol-pool", + "move-coverage", + "move-ir-types", + "structopt", +] + +[[package]] +name = "move-docgen" +version = "0.1.0" +source = "git+https://github.com/pontem-network/diem.git?branch=v1.5.1-pre#661c17af25be967c937048aa4f3d3c241ae03b93" +dependencies = [ + "anyhow", + "codespan", + "codespan-reporting", + "diem-workspace-hack", + "itertools 0.10.3", + "log", + "move-compiler", + "move-model", + "move-stackless-bytecode", + "num", "once_cell", - "serde", + "regex", + "serde 1.0.133", ] [[package]] -name = "move-lang" -version = "0.0.1" -source = "git+https://github.com/pontem-network/diem.git?branch=v1.5-pre#2312f95e36d931814a88378c7117d3a6bb1f3809" +name = "move-errmapgen" +version = "0.1.0" +source = "git+https://github.com/pontem-network/diem.git?branch=v1.5.1-pre#661c17af25be967c937048aa4f3d3c241ae03b93" dependencies = [ "anyhow", "bcs", - "borrow-graph", - "bytecode-source-map", - "bytecode-verifier", + "diem-workspace-hack", + "log", + "move-command-line-common", + "move-core-types", + "move-model", + "serde 1.0.133", +] + +[[package]] +name = "move-ir-to-bytecode" +version = "0.1.0" +source = "git+https://github.com/pontem-network/diem.git?branch=v1.5.1-pre#661c17af25be967c937048aa4f3d3c241ae03b93" +dependencies = [ + "anyhow", "codespan-reporting", - "dialect", "diem-workspace-hack", - "difference", - "hex", - "ir-to-bytecode", + "log", "move-binary-format", + "move-bytecode-source-map", "move-command-line-common", "move-core-types", + "move-ir-to-bytecode-syntax", "move-ir-types", "move-symbol-pool", - "once_cell", - "petgraph", - "regex", - "structopt", - "tempfile", - "uint", - "walkdir", + "ouroboros", + "thiserror", +] + +[[package]] +name = "move-ir-to-bytecode-syntax" +version = "0.1.0" +source = "git+https://github.com/pontem-network/diem.git?branch=v1.5.1-pre#661c17af25be967c937048aa4f3d3c241ae03b93" +dependencies = [ + "anyhow", + "diem-workspace-hack", + "hex", + "move-command-line-common", + "move-core-types", + "move-ir-types", + "move-symbol-pool", +] + +[[package]] +name = "move-ir-types" +version = "0.1.0" +source = "git+https://github.com/pontem-network/diem.git?branch=v1.5.1-pre#661c17af25be967c937048aa4f3d3c241ae03b93" +dependencies = [ + "anyhow", + "diem-workspace-hack", + "hex", + "move-command-line-common", + "move-core-types", + "move-symbol-pool", + "once_cell", + "serde 1.0.133", ] [[package]] name = "move-model" version = "0.1.0" -source = "git+https://github.com/pontem-network/diem.git?branch=v1.5-pre#2312f95e36d931814a88378c7117d3a6bb1f3809" +source = "git+https://github.com/pontem-network/diem.git?branch=v1.5.1-pre#661c17af25be967c937048aa4f3d3c241ae03b93" dependencies = [ "anyhow", - "bytecode-source-map", - "bytecode-verifier", "codespan", "codespan-reporting", "diem-workspace-hack", - "disassembler", "internment", "itertools 0.10.3", "log", "move-binary-format", + "move-bytecode-source-map", + "move-bytecode-verifier", "move-command-line-common", + "move-compiler", "move-core-types", + "move-disassembler", "move-ir-types", - "move-lang", "move-symbol-pool", "num", "once_cell", "regex", - "serde", + "serde 1.0.133", ] [[package]] name = "move-package" version = "0.1.0" -source = "git+https://github.com/pontem-network/diem.git?branch=v1.5-pre#2312f95e36d931814a88378c7117d3a6bb1f3809" +source = "git+https://github.com/pontem-network/diem.git?branch=v1.5.1-pre#661c17af25be967c937048aa4f3d3c241ae03b93" dependencies = [ - "abigen", "anyhow", "bcs", - "bytecode-source-map", "colored", "dialect", "diem-workspace-hack", - "docgen", - "errmapgen", + "move-abigen", "move-binary-format", + "move-bytecode-source-map", "move-bytecode-utils", "move-command-line-common", + "move-compiler", "move-core-types", - "move-lang", + "move-docgen", + "move-errmapgen", "move-model", "move-symbol-pool", - "petgraph", + "petgraph 0.5.1", + "ptree", "regex", - "serde", + "serde 1.0.133", "serde_yaml", "sha2", "structopt", @@ -2188,55 +2242,159 @@ dependencies = [ [[package]] name = "move-prover" version = "0.1.0" -source = "git+https://github.com/pontem-network/diem.git?branch=v1.5-pre#2312f95e36d931814a88378c7117d3a6bb1f3809" +source = "git+https://github.com/pontem-network/diem.git?branch=v1.5.1-pre#661c17af25be967c937048aa4f3d3c241ae03b93" dependencies = [ - "abigen", "anyhow", "async-trait", "atty", - "boogie-backend", - "bytecode", - "bytecode-interpreter", "clap", "codespan", "codespan-reporting", "diem-workspace-hack", - "docgen", - "errmapgen", "futures", "hex", "itertools 0.10.3", "log", + "move-abigen", "move-binary-format", "move-command-line-common", + "move-compiler", "move-core-types", + "move-docgen", + "move-errmapgen", "move-ir-types", - "move-lang", "move-model", + "move-prover-boogie-backend", + "move-stackless-bytecode", + "move-stackless-bytecode-interpreter", "num", "once_cell", "pretty", "rand 0.8.4", - "serde", + "serde 1.0.133", "serde_json", "simplelog", "tokio 1.15.0", "toml", ] +[[package]] +name = "move-prover-boogie-backend" +version = "0.1.0" +source = "git+https://github.com/pontem-network/diem.git?branch=v1.5.1-pre#661c17af25be967c937048aa4f3d3c241ae03b93" +dependencies = [ + "anyhow", + "async-trait", + "codespan", + "codespan-reporting", + "diem-workspace-hack", + "futures", + "itertools 0.10.3", + "log", + "move-binary-format", + "move-command-line-common", + "move-core-types", + "move-model", + "move-stackless-bytecode", + "num", + "once_cell", + "pretty", + "rand 0.8.4", + "regex", + "serde 1.0.133", + "serde_json", + "tera", + "tokio 1.15.0", +] + +[[package]] +name = "move-read-write-set-types" +version = "0.0.3" +source = "git+https://github.com/pontem-network/diem.git?branch=v1.5.1-pre#661c17af25be967c937048aa4f3d3c241ae03b93" +dependencies = [ + "anyhow", + "diem-workspace-hack", + "move-binary-format", + "move-core-types", + "serde 1.0.133", +] + +[[package]] +name = "move-resource-viewer" +version = "0.1.0" +source = "git+https://github.com/pontem-network/diem.git?branch=v1.5.1-pre#661c17af25be967c937048aa4f3d3c241ae03b93" +dependencies = [ + "anyhow", + "bcs", + "diem-workspace-hack", + "hex", + "move-binary-format", + "move-core-types", + "move-vm-types", + "once_cell", + "serde 1.0.133", +] + +[[package]] +name = "move-stackless-bytecode" +version = "0.1.0" +source = "git+https://github.com/pontem-network/diem.git?branch=v1.5.1-pre#661c17af25be967c937048aa4f3d3c241ae03b93" +dependencies = [ + "codespan", + "codespan-reporting", + "diem-workspace-hack", + "im", + "itertools 0.10.3", + "log", + "move-binary-format", + "move-borrow-graph", + "move-bytecode-verifier", + "move-command-line-common", + "move-core-types", + "move-ir-to-bytecode", + "move-model", + "move-read-write-set-types", + "num", + "once_cell", + "paste", + "petgraph 0.5.1", + "serde 1.0.133", + "serde_json", +] + +[[package]] +name = "move-stackless-bytecode-interpreter" +version = "0.1.0" +source = "git+https://github.com/pontem-network/diem.git?branch=v1.5.1-pre#661c17af25be967c937048aa4f3d3c241ae03b93" +dependencies = [ + "anyhow", + "bytecode-interpreter-crypto", + "codespan-reporting", + "diem-workspace-hack", + "itertools 0.10.3", + "move-binary-format", + "move-core-types", + "move-model", + "move-stackless-bytecode", + "move-vm-runtime", + "num", + "serde 1.0.133", + "structopt", +] + [[package]] name = "move-stdlib" version = "0.1.0" -source = "git+https://github.com/pontem-network/diem.git?branch=v1.5-pre#2312f95e36d931814a88378c7117d3a6bb1f3809" +source = "git+https://github.com/pontem-network/diem.git?branch=v1.5.1-pre#661c17af25be967c937048aa4f3d3c241ae03b93" dependencies = [ "diem-workspace-hack", - "docgen", - "errmapgen", "log", "move-binary-format", "move-command-line-common", + "move-compiler", "move-core-types", - "move-lang", + "move-docgen", + "move-errmapgen", "move-prover", "move-vm-runtime", "move-vm-types", @@ -2249,48 +2407,48 @@ dependencies = [ [[package]] name = "move-symbol-pool" version = "0.1.0" -source = "git+https://github.com/pontem-network/diem.git?branch=v1.5-pre#2312f95e36d931814a88378c7117d3a6bb1f3809" +source = "git+https://github.com/pontem-network/diem.git?branch=v1.5.1-pre#661c17af25be967c937048aa4f3d3c241ae03b93" dependencies = [ "diem-workspace-hack", "once_cell", - "serde", + "serde 1.0.133", ] [[package]] name = "move-unit-test" version = "0.1.0" -source = "git+https://github.com/pontem-network/diem.git?branch=v1.5-pre#2312f95e36d931814a88378c7117d3a6bb1f3809" +source = "git+https://github.com/pontem-network/diem.git?branch=v1.5.1-pre#661c17af25be967c937048aa4f3d3c241ae03b93" dependencies = [ "anyhow", - "bytecode-interpreter", "colored", "diem-workspace-hack", "move-binary-format", "move-bytecode-utils", "move-command-line-common", + "move-compiler", "move-core-types", - "move-lang", "move-model", + "move-resource-viewer", + "move-stackless-bytecode-interpreter", "move-stdlib", "move-vm-runtime", "move-vm-test-utils", "move-vm-types", "rayon", "regex", - "resource-viewer", "structopt", ] [[package]] name = "move-vm-runtime" version = "0.1.0" -source = "git+https://github.com/pontem-network/diem.git?branch=v1.5-pre#2312f95e36d931814a88378c7117d3a6bb1f3809" +source = "git+https://github.com/pontem-network/diem.git?branch=v1.5.1-pre#661c17af25be967c937048aa4f3d3c241ae03b93" dependencies = [ - "bytecode-verifier", "diem-workspace-hack", "fail", "mirai-annotations", "move-binary-format", + "move-bytecode-verifier", "move-core-types", "move-vm-types", "once_cell", @@ -2302,7 +2460,7 @@ dependencies = [ [[package]] name = "move-vm-test-utils" version = "0.1.0" -source = "git+https://github.com/pontem-network/diem.git?branch=v1.5-pre#2312f95e36d931814a88378c7117d3a6bb1f3809" +source = "git+https://github.com/pontem-network/diem.git?branch=v1.5.1-pre#661c17af25be967c937048aa4f3d3c241ae03b93" dependencies = [ "anyhow", "diem-workspace-hack", @@ -2314,7 +2472,7 @@ dependencies = [ [[package]] name = "move-vm-types" version = "0.1.0" -source = "git+https://github.com/pontem-network/diem.git?branch=v1.5-pre#2312f95e36d931814a88378c7117d3a6bb1f3809" +source = "git+https://github.com/pontem-network/diem.git?branch=v1.5.1-pre#661c17af25be967c937048aa4f3d3c241ae03b93" dependencies = [ "bcs", "diem-workspace-hack", @@ -2322,7 +2480,7 @@ dependencies = [ "move-binary-format", "move-core-types", "once_cell", - "serde", + "serde 1.0.133", "sha2", "smallvec", ] @@ -2338,7 +2496,7 @@ dependencies = [ "log", "mime", "mime_guess", - "quick-error", + "quick-error 1.2.3", "rand 0.8.4", "safemem", "tempfile", @@ -2351,7 +2509,7 @@ version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48ba9f7719b5a0f42f338907614285fb5fd70e53858141f69898a1fb7203b24d" dependencies = [ - "lazy_static", + "lazy_static 1.4.0", "libc", "log", "openssl", @@ -2380,6 +2538,17 @@ version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" +[[package]] +name = "nom" +version = "5.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffb4262d26ed83a1c0a33a38fe2bb15797329c85770da05e6b828ddb782627af" +dependencies = [ + "lexical-core", + "memchr", + "version_check", +] + [[package]] name = "ntapi" version = "0.3.6" @@ -2400,7 +2569,7 @@ dependencies = [ "num-integer", "num-iter", "num-rational", - "num-traits", + "num-traits 0.2.14", ] [[package]] @@ -2411,7 +2580,7 @@ checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" dependencies = [ "autocfg", "num-integer", - "num-traits", + "num-traits 0.2.14", ] [[package]] @@ -2420,7 +2589,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26873667bbbb7c5182d4a37c1add32cdf09f841af72da53318fdb81543c15085" dependencies = [ - "num-traits", + "num-traits 0.2.14", ] [[package]] @@ -2430,7 +2599,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" dependencies = [ "autocfg", - "num-traits", + "num-traits 0.2.14", ] [[package]] @@ -2441,7 +2610,7 @@ checksum = "b2021c8337a54d21aca0d59a92577a029af9431cb59b909b03252b9c164fad59" dependencies = [ "autocfg", "num-integer", - "num-traits", + "num-traits 0.2.14", ] [[package]] @@ -2453,7 +2622,16 @@ dependencies = [ "autocfg", "num-bigint", "num-integer", - "num-traits", + "num-traits 0.2.14", +] + +[[package]] +name = "num-traits" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" +dependencies = [ + "num-traits 0.2.14", ] [[package]] @@ -2475,6 +2653,12 @@ dependencies = [ "libc", ] +[[package]] +name = "numtoa" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8f8bdf33df195859076e54ab11ee78a1b208382d3a26ec40d142ffc1ecc49ef" + [[package]] name = "object" version = "0.23.0" @@ -2532,6 +2716,15 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "ordered-float" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7940cf2ca942593318d07fcf2596cdca60a85c9e7fab408a5e21a4f9dcd40d87" +dependencies = [ + "num-traits 0.2.14", +] + [[package]] name = "ouroboros" version = "0.9.5" @@ -2650,7 +2843,17 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "467d164a6de56270bd7c4d070df81d07beace25012d5103ced4e9ff08d6afdb7" dependencies = [ - "fixedbitset", + "fixedbitset 0.2.0", + "indexmap", +] + +[[package]] +name = "petgraph" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a13a2fa9d0b63e5f22328828741e523766fff0ee9e779316902290dff3f824f" +dependencies = [ + "fixedbitset 0.4.1", "indexmap", ] @@ -2743,7 +2946,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a3fd9ec30b9749ce28cd91f255d569591cdf937fe280c312143e3c4bad6f2a" dependencies = [ - "num-traits", + "num-traits 0.2.14", "plotters-backend", "plotters-svg", "wasm-bindgen", @@ -2846,6 +3049,26 @@ dependencies = [ "unicode-xid 0.2.2", ] +[[package]] +name = "proptest" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e0d9cc07f18492d879586c92b485def06bc850da3118075cd45d50e9c95b0e5" +dependencies = [ + "bit-set", + "bitflags", + "byteorder", + "lazy_static 1.4.0", + "num-traits 0.2.14", + "quick-error 2.0.1", + "rand 0.8.4", + "rand_chacha 0.3.1", + "rand_xorshift", + "regex-syntax", + "rusty-fork", + "tempfile", +] + [[package]] name = "prost" version = "0.8.0" @@ -2869,12 +3092,34 @@ dependencies = [ "syn 1.0.85", ] +[[package]] +name = "ptree" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0de80796b316aec75344095a6d2ef68ec9b8f573b9e7adc821149ba3598e270" +dependencies = [ + "ansi_term", + "atty", + "config", + "directories", + "petgraph 0.6.0", + "serde 1.0.133", + "serde-value", + "tint", +] + [[package]] name = "quick-error" version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" +[[package]] +name = "quick-error" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" + [[package]] name = "quote" version = "0.6.13" @@ -2959,7 +3204,7 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" dependencies = [ - "getrandom 0.2.3", + "getrandom 0.2.4", ] [[package]] @@ -2980,6 +3225,15 @@ dependencies = [ "rand_core 0.6.3", ] +[[package]] +name = "rand_xorshift" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" +dependencies = [ + "rand_core 0.6.3", +] + [[package]] name = "rand_xoshiro" version = "0.4.0" @@ -3010,48 +3264,38 @@ dependencies = [ "crossbeam-channel", "crossbeam-deque", "crossbeam-utils", - "lazy_static", + "lazy_static 1.4.0", "num_cpus", ] [[package]] name = "read-write-set" version = "0.1.0" -source = "git+https://github.com/pontem-network/diem.git?branch=v1.5-pre#2312f95e36d931814a88378c7117d3a6bb1f3809" +source = "git+https://github.com/pontem-network/diem.git?branch=v1.5.1-pre#661c17af25be967c937048aa4f3d3c241ae03b93" dependencies = [ "anyhow", - "bytecode", "diem-workspace-hack", "move-binary-format", "move-bytecode-utils", "move-core-types", "move-model", + "move-read-write-set-types", + "move-resource-viewer", + "move-stackless-bytecode", "read-write-set-dynamic", - "read-write-set-types", - "resource-viewer", ] [[package]] name = "read-write-set-dynamic" version = "0.1.0" -source = "git+https://github.com/pontem-network/diem.git?branch=v1.5-pre#2312f95e36d931814a88378c7117d3a6bb1f3809" -dependencies = [ - "anyhow", - "diem-workspace-hack", - "move-binary-format", - "move-core-types", - "read-write-set-types", -] - -[[package]] -name = "read-write-set-types" -version = "0.1.0" -source = "git+https://github.com/pontem-network/diem.git?branch=v1.5-pre#2312f95e36d931814a88378c7117d3a6bb1f3809" +source = "git+https://github.com/pontem-network/diem.git?branch=v1.5.1-pre#661c17af25be967c937048aa4f3d3c241ae03b93" dependencies = [ "anyhow", "diem-workspace-hack", "move-binary-format", + "move-bytecode-utils", "move-core-types", + "move-read-write-set-types", ] [[package]] @@ -3063,6 +3307,25 @@ dependencies = [ "bitflags", ] +[[package]] +name = "redox_termios" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8440d8acb4fd3d277125b4bd01a6f38aee8d814b3b5fc09b3f2b825d37d3fe8f" +dependencies = [ + "redox_syscall", +] + +[[package]] +name = "redox_users" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" +dependencies = [ + "getrandom 0.2.4", + "redox_syscall", +] + [[package]] name = "ref-cast" version = "1.0.6" @@ -3136,14 +3399,14 @@ dependencies = [ "hyper-tls 0.4.3", "ipnet", "js-sys", - "lazy_static", + "lazy_static 1.4.0", "log", "mime", "mime_guess", "native-tls", "percent-encoding", "pin-project-lite 0.2.8", - "serde", + "serde 1.0.133", "serde_json", "serde_urlencoded", "tokio 0.2.25", @@ -3173,13 +3436,13 @@ dependencies = [ "hyper-tls 0.5.0", "ipnet", "js-sys", - "lazy_static", + "lazy_static 1.4.0", "log", "mime", "native-tls", "percent-encoding", "pin-project-lite 0.2.8", - "serde", + "serde 1.0.133", "serde_json", "serde_urlencoded", "tokio 1.15.0", @@ -3192,22 +3455,6 @@ dependencies = [ "winreg", ] -[[package]] -name = "resource-viewer" -version = "0.1.0" -source = "git+https://github.com/pontem-network/diem.git?branch=v1.5-pre#2312f95e36d931814a88378c7117d3a6bb1f3809" -dependencies = [ - "anyhow", - "bcs", - "diem-workspace-hack", - "hex", - "move-binary-format", - "move-core-types", - "move-vm-types", - "once_cell", - "serde", -] - [[package]] name = "ring" version = "0.16.20" @@ -3232,6 +3479,12 @@ dependencies = [ "num", ] +[[package]] +name = "rust-ini" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e52c148ef37f8c375d49d5a73aa70713125b7f19095948a923f80afdeb22ec2" + [[package]] name = "rustc-demangle" version = "0.1.21" @@ -3264,7 +3517,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" dependencies = [ "fnv", - "quick-error", + "quick-error 1.2.3", "tempfile", "wait-timeout", ] @@ -3296,7 +3549,7 @@ version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75" dependencies = [ - "lazy_static", + "lazy_static 1.4.0", "winapi 0.3.9", ] @@ -3351,6 +3604,12 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "568a8e6258aa33c13358f81fd834adb854c6f7c9468520910a9b1e8fac068012" +[[package]] +name = "serde" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dad3f759919b92c3068c696c15c3d17238234498bbdcc80f2c469606f948ac8" + [[package]] name = "serde" version = "1.0.133" @@ -3360,23 +3619,45 @@ dependencies = [ "serde_derive", ] +[[package]] +name = "serde-hjson" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a3a4e0ea8a88553209f6cc6cfe8724ecad22e1acf372793c27d995290fe74f8" +dependencies = [ + "lazy_static 1.4.0", + "num-traits 0.1.43", + "regex", + "serde 0.8.23", +] + [[package]] name = "serde-name" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12c47087018ec281d1cdab673d36aea22d816b54d498264029c05d5fa1910da6" dependencies = [ - "serde", + "serde 1.0.133", "thiserror", ] +[[package]] +name = "serde-value" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3a1a3341211875ef120e117ea7fd5228530ae7e7036a779fdc9117be6b3282c" +dependencies = [ + "ordered-float", + "serde 1.0.133", +] + [[package]] name = "serde_bytes" version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16ae07dd2f88a366f15bd0632ba725227018c69a1c8550a927324f8eb8368bb9" dependencies = [ - "serde", + "serde 1.0.133", ] [[package]] @@ -3399,7 +3680,7 @@ dependencies = [ "indexmap", "itoa 1.0.1", "ryu", - "serde", + "serde 1.0.133", ] [[package]] @@ -3411,7 +3692,7 @@ dependencies = [ "form_urlencoded", "itoa 0.4.8", "ryu", - "serde", + "serde 1.0.133", ] [[package]] @@ -3422,7 +3703,7 @@ checksum = "a4a521f2940385c165a24ee286aa8599633d162077a54bdcae2a6fd5a7bfa7a0" dependencies = [ "indexmap", "ryu", - "serde", + "serde 1.0.133", "yaml-rust", ] @@ -3476,6 +3757,15 @@ dependencies = [ "opaque-debug 0.3.0", ] +[[package]] +name = "sharded-slab" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +dependencies = [ + "lazy_static 1.4.0", +] + [[package]] name = "signal-hook-registry" version = "1.4.0" @@ -3535,9 +3825,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ecab6c735a6bb4139c0caafd0cc3635748bbb3acf4550e8138122099251f309" +checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" [[package]] name = "socket2" @@ -3600,7 +3890,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40b9788f4202aa75c240ecc9c15c65185e6a39ccdeb0fd5d008b98825464c87c" dependencies = [ "clap", - "lazy_static", + "lazy_static 1.4.0", "structopt-derive", ] @@ -3687,13 +3977,13 @@ dependencies = [ "chrono-tz", "globwalk", "humansize", - "lazy_static", + "lazy_static 1.4.0", "percent-encoding", "pest", "pest_derive", "rand 0.8.4", "regex", - "serde", + "serde 1.0.133", "serde_json", "slug", "unic-segment", @@ -3708,6 +3998,18 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "termion" +version = "1.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "077185e2eac69c3f8379a4298e1e07cd36beb962290d4a51199acf0fdc10607e" +dependencies = [ + "libc", + "numtoa", + "redox_syscall", + "redox_termios", +] + [[package]] name = "textwrap" version = "0.11.0" @@ -3757,6 +4059,15 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "tint" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7af24570664a3074673dbbf69a65bdae0ae0b72f2949b1adfbacb736ee4d6896" +dependencies = [ + "lazy_static 0.2.11", +] + [[package]] name = "tiny-keccak" version = "2.0.2" @@ -3791,7 +4102,7 @@ dependencies = [ "fnv", "futures-core", "iovec", - "lazy_static", + "lazy_static 1.4.0", "memchr", "mio 0.6.23", "num_cpus", @@ -3919,7 +4230,7 @@ version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" dependencies = [ - "serde", + "serde 1.0.133", ] [[package]] @@ -3958,7 +4269,7 @@ version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f4ed65637b8390770814083d20756f87bfa2c21bf2f110babdc5438351746e4" dependencies = [ - "lazy_static", + "lazy_static 1.4.0", ] [[package]] @@ -3971,12 +4282,54 @@ dependencies = [ "tracing", ] +[[package]] +name = "tracing-log" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6923477a48e41c1951f1999ef8bb5a3023eb723ceadafe78ffb65dc366761e3" +dependencies = [ + "lazy_static 1.4.0", + "log", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d81bfa81424cc98cb034b837c985b7a290f592e5b4322f353f94a0ab0f9f594" +dependencies = [ + "ansi_term", + "lazy_static 1.4.0", + "matchers", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + [[package]] name = "try-lock" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" +[[package]] +name = "tui" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ced152a8e9295a5b168adc254074525c17ac4a83c90b2716274cc38118bddc9" +dependencies = [ + "bitflags", + "cassowary", + "termion", + "unicode-segmentation", + "unicode-width", +] + [[package]] name = "tungstenite" version = "0.14.0" @@ -4179,7 +4532,7 @@ dependencies = [ "idna", "matches", "percent-encoding", - "serde", + "serde 1.0.133", ] [[package]] @@ -4265,7 +4618,7 @@ dependencies = [ "percent-encoding", "pin-project", "scoped-tls", - "serde", + "serde 1.0.133", "serde_json", "serde_urlencoded", "tokio 1.15.0", @@ -4296,7 +4649,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "632f73e236b219150ea279196e54e610f5dbafa5d61786303d4da54f84e47fce" dependencies = [ "cfg-if 1.0.0", - "serde", + "serde 1.0.133", "serde_json", "wasm-bindgen-macro", ] @@ -4308,7 +4661,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a317bf8f9fba2476b4b2c85ef4c4af8ff39c3c7f0cdfeed4f82c34a880aa837b" dependencies = [ "bumpalo", - "lazy_static", + "lazy_static 1.4.0", "log", "proc-macro2 1.0.36", "quote 1.0.14", diff --git a/common/git-hash/src/lib.rs b/common/git-hash/src/lib.rs index e48052ff..bfdadc05 100644 --- a/common/git-hash/src/lib.rs +++ b/common/git-hash/src/lib.rs @@ -94,7 +94,6 @@ fn opt_tokenize(s: Option) -> Result { .unwrap_or_else(|| "None".to_owned()) .parse() } - #[derive(Default)] struct DependencyInfo { branch: Option, diff --git a/dove/Cargo.toml b/dove/Cargo.toml index 6271bcdc..1b649e28 100644 --- a/dove/Cargo.toml +++ b/dove/Cargo.toml @@ -15,19 +15,20 @@ git-hash = { path = "../common/git-hash" } lang = { path = "../lang" } # DIEM -move-core-types = { git = "https://github.com/pontem-network/diem.git", branch = "v1.5-pre" } -move-lang = { git = "https://github.com/pontem-network/diem.git", branch = "v1.5-pre" } -move-symbol-pool = { git = "https://github.com/pontem-network/diem.git", branch = "v1.5-pre" } -move-cli = { git = "https://github.com/pontem-network/diem.git", branch = "v1.5-pre" } -move-package = { git = "https://github.com/pontem-network/diem.git", branch = "v1.5-pre" } -move-stdlib = { git = "https://github.com/pontem-network/diem.git", branch = "v1.5-pre" } -dialect = { git = "https://github.com/pontem-network/diem.git", branch = "v1.5-pre" } -boogie-backend = { git = "https://github.com/pontem-network/diem.git", branch = "v1.5-pre" } -diem-types = { git = "https://github.com/pontem-network/diem.git", branch = "v1.5-pre" } -move-binary-format = { git = "https://github.com/pontem-network/diem.git", branch = "v1.5-pre" } -move-prover = { git = "https://github.com/pontem-network/diem.git", branch = "v1.5-pre" } -move-vm-runtime = { git = "https://github.com/pontem-network/diem.git", branch = "v1.5-pre" } -bytecode-source-map = { git = "https://github.com/pontem-network/diem.git", branch = "v1.5-pre" } +move-core-types = { git = "https://github.com/pontem-network/diem.git", branch = "v1.5.1-pre" } +move-compiler = { git = "https://github.com/pontem-network/diem.git", branch = "v1.5.1-pre" } +move-symbol-pool = { git = "https://github.com/pontem-network/diem.git", branch = "v1.5.1-pre" } +move-cli = { git = "https://github.com/pontem-network/diem.git", branch = "v1.5.1-pre" } +move-package = { git = "https://github.com/pontem-network/diem.git", branch = "v1.5.1-pre" } +move-stdlib = { git = "https://github.com/pontem-network/diem.git", branch = "v1.5.1-pre" } +dialect = { git = "https://github.com/pontem-network/diem.git", branch = "v1.5.1-pre" } +boogie-backend = { git = "https://github.com/pontem-network/diem.git", package = "move-prover-boogie-backend", branch = "v1.5.1-pre" } +diem-types = { git = "https://github.com/pontem-network/diem.git", branch = "v1.5.1-pre" } +move-binary-format = { git = "https://github.com/pontem-network/diem.git", branch = "v1.5.1-pre" } +move-prover = { git = "https://github.com/pontem-network/diem.git", branch = "v1.5.1-pre" } +move-vm-runtime = { git = "https://github.com/pontem-network/diem.git", branch = "v1.5.1-pre" } +bytecode-source-map = { git = "https://github.com/pontem-network/diem.git", package = "move-bytecode-source-map", branch = "v1.5.1-pre" } +move-command-line-common = { git = "https://github.com/pontem-network/diem.git", branch = "v1.5.1-pre" } # third-party dependencies log = "0.4.14" diff --git a/dove/src/cli.rs b/dove/src/cli.rs index 33e927c6..e50ef5f7 100644 --- a/dove/src/cli.rs +++ b/dove/src/cli.rs @@ -8,11 +8,10 @@ use structopt::StructOpt; use semver::{Version, VersionReq}; use move_cli::{Command as DiemCommand, experimental, Move, package, run_cli, sandbox}; -use move_cli::DEFAULT_SOURCE_DIR; use move_core_types::account_address::AccountAddress; use move_core_types::errmap::ErrorMapping; -use crate::{DOVE_VERSION, DOVE_HASH, PONT_STDLIB_VERSION, DIEM_VERSION, DIEM_HASH}; +use crate::{DOVE_VERSION, DOVE_HASH, MOVE_STDLIB_VERSION, DIEM_VERSION, DIEM_HASH}; use crate::cmd::Cmd; use crate::cmd::new::New; use crate::cmd::build::Build; @@ -23,6 +22,7 @@ use crate::cmd::run::Run; use crate::cmd::test::Test; use crate::cmd::tx::CreateTransactionCmd; use crate::context::Context; +use move_cli::DEFAULT_STORAGE_DIR; const HASH_FILE_NAME: &str = ".version"; @@ -50,49 +50,37 @@ pub enum CommonCommand { /// Move cli and dove commands. #[derive(StructOpt)] pub enum Command { - /// Package option. + /// Execute a package command. Executed in the current directory or the closest containing Move + /// package. #[structopt(name = "package")] Package { - /// Path to package. If none is supplied the current directory will be used. - #[structopt(long = "path", short = "p", global = true, parse(from_os_str))] - path: Option, - /// Build config. - #[structopt(flatten)] - config: move_package::BuildConfig, - /// Package sub commands. + /// cmd. #[structopt(subcommand)] cmd: package::cli::PackageCommand, }, - /// Compile and emit Move bytecode for the specified scripts and/or modules. - #[structopt(name = "compile")] - Compile { - /// The source files to check. - #[structopt( - name = "PATH_TO_SOURCE_FILE", - default_value = DEFAULT_SOURCE_DIR, - )] - source_files: Vec, - /// Do not emit source map information along with the compiled bytecode. - #[structopt(long = "no-source-maps")] - no_source_maps: bool, - /// Type check and verify the specified scripts and/or modules. Does not emit bytecode. - #[structopt(long = "check")] - check: bool, - }, /// Execute a sandbox command. #[structopt(name = "sandbox")] Sandbox { - /// Sandbox command. + /// Directory storing Move resources, events, and module bytecodes produced by module publishing + /// and script execution. + #[structopt(long, default_value = DEFAULT_STORAGE_DIR, parse(from_os_str))] + storage_dir: PathBuf, + /// cmd #[structopt(subcommand)] cmd: sandbox::cli::SandboxCommand, }, /// (Experimental) Run static analyses on Move source or bytecode. #[structopt(name = "experimental")] Experimental { - /// Experimental commands. + /// Directory storing Move resources, events, and module bytecodes produced by module publishing + /// and script execution. + #[structopt(long, default_value = DEFAULT_STORAGE_DIR, parse(from_os_str))] + storage_dir: PathBuf, + /// cmd #[structopt(subcommand)] cmd: experimental::cli::ExperimentalCommand, }, + /// Init new project with existing folder. #[structopt(about = "Init directory as move project")] Init { @@ -163,22 +151,14 @@ impl Command { /// Split commands to two different execution backend (move-cli, dove). pub fn select_backend(self) -> CommonCommand { match self { - Command::Package { path, config, cmd } => { - CommonCommand::Diem(DiemCommand::Package { path, config, cmd }) + Command::Package { cmd } => CommonCommand::Diem(DiemCommand::Package { cmd }), + Command::Sandbox { storage_dir, cmd } => { + CommonCommand::Diem(DiemCommand::Sandbox { storage_dir, cmd }) } - Command::Compile { - source_files, - no_source_maps, - check, - } => CommonCommand::Diem(DiemCommand::Compile { - source_files, - no_source_maps, - check, - }), - Command::Sandbox { cmd } => CommonCommand::Diem(DiemCommand::Sandbox { cmd }), - Command::Experimental { cmd } => { - CommonCommand::Diem(DiemCommand::Experimental { cmd }) + Command::Experimental { storage_dir, cmd } => { + CommonCommand::Diem(DiemCommand::Experimental { storage_dir, cmd }) } + Command::New { cmd } => CommonCommand::Dove(Box::new(cmd)), Command::Init { cmd } => CommonCommand::Dove(Box::new(cmd)), Command::Build { cmd } => CommonCommand::Dove(Box::new(cmd)), @@ -292,7 +272,7 @@ fn create_long_version() -> &'static str { "{}\n\ Diem {}\n\ Move-Stdlib {}", - dove, diem, PONT_STDLIB_VERSION + dove, diem, MOVE_STDLIB_VERSION ) .into_boxed_str(), ) diff --git a/dove/src/cmd/build.rs b/dove/src/cmd/build.rs index 131eb993..479456cf 100644 --- a/dove/src/cmd/build.rs +++ b/dove/src/cmd/build.rs @@ -15,7 +15,6 @@ use move_cli::Command as MoveCommand; use move_cli::package::cli::PackageCommand; use move_cli::run_cli; use move_core_types::language_storage::ModuleId; -use move_package::BuildConfig; use move_symbol_pool::Symbol; use crate::cmd::Cmd; @@ -26,13 +25,11 @@ use serde::{Serialize, Deserialize}; #[derive(StructOpt, Debug, Default)] #[structopt(setting(structopt::clap::AppSettings::ColoredHelp))] pub struct Build { - #[structopt(help = "Generate documentation.", long = "doc", short = "d")] - doc: bool, - /// Generate error map for the package and its dependencies /// at path for use by the Move explanation tool. #[structopt(long)] error_map: Option, + /// Address. Used as an additional parameter in error_map #[structopt(long)] address: Option, @@ -40,11 +37,12 @@ pub struct Build { // Pack the assembled modules into a single file, // except for those specified in modules_exclude #[structopt( - help = "Package modules in a binary file.", - short = "p", - long = "package" + help = "Package modules in a binary bundle file.", + short = "b", + long = "bundle" )] package: bool, + // Names of modules to exclude from the package process.. // Used with the "package" parameter. // Modules are taken from the /build//bytecode_modules directory. @@ -55,6 +53,7 @@ pub struct Build { long = "modules_exclude" )] modules_exclude: Vec, + // File name of module package. // Used with the "package" parameter. #[structopt(help = "File name of module package.", short = "o", long = "output")] @@ -71,13 +70,6 @@ impl Cmd for Build { bcs::from_bytes(move_stdlib::error_descriptions())?; let cmd = MoveCommand::Package { cmd: PackageCommand::Build {}, - path: Some(ctx.project_dir.clone()), - config: BuildConfig { - generate_abis: false, - generate_docs: self.doc, - test_mode: false, - dev_mode: false, - }, }; run_cli( @@ -96,9 +88,6 @@ impl Cmd for Build { // Checking directories in the "build" section, if there are none, then create checking_build_directories(ctx)?; - // Checking directories in the "build" section, if there are none, then create - checking_build_directories(ctx)?; - Ok(()) } } @@ -120,13 +109,6 @@ impl Build { error_prefix: None, output_file: path, }, - path: Some(ctx.project_dir.clone()), - config: BuildConfig { - generate_abis: false, - generate_docs: false, - test_mode: false, - dev_mode: false, - }, }; let address = self.address.clone().unwrap_or_else(|| "0x1".to_string()); @@ -212,12 +194,13 @@ fn checking_build_directories(ctx: &Context) -> Result<()> { .project_dir .join("build") .join(ctx.manifest.package.name.as_str()); - for path in [ - build_path.join("bytecode_modules"), - build_path.join("bytecode_scripts"), - build_path.join("source_maps"), - build_path.join("sources"), + for name_dir in [ + "bytecode_modules", + "bytecode_scripts", + "source_maps", + "sources", ] { + let path = build_path.join(name_dir); if path.exists() { continue; } diff --git a/dove/src/cmd/clean.rs b/dove/src/cmd/clean.rs index e0701e00..39d42434 100644 --- a/dove/src/cmd/clean.rs +++ b/dove/src/cmd/clean.rs @@ -23,6 +23,7 @@ pub struct Clean { state - Clear only the executor state.\n\ all - Clear all.")] clear_type: Option, + // deleting folders: // PROJECT_DIR/storage // PROJECT_DIR/build diff --git a/dove/src/cmd/export.rs b/dove/src/cmd/export.rs index 9cb588f5..356e7b32 100644 --- a/dove/src/cmd/export.rs +++ b/dove/src/cmd/export.rs @@ -122,7 +122,7 @@ impl Export { let mut move_toml_string = toml::to_string(&move_toml)?; // add/output errors for (name, error) in dependencies_errors.iter() { - let error = error.replace("\n", "\n# \t").to_string(); + let error = error.replace('\n', "\n# \t").to_string(); println!("\nWarning:\n# {}", &error); if let Some(pos) = move_toml_string .find(name) diff --git a/dove/src/cmd/init.rs b/dove/src/cmd/init.rs index 0149011f..ada0d5b2 100644 --- a/dove/src/cmd/init.rs +++ b/dove/src/cmd/init.rs @@ -1,27 +1,33 @@ -use std::string::ToString; use std::path::PathBuf; -use std::collections::HashMap; use structopt::StructOpt; use lazy_static::lazy_static; use regex::Regex; use move_cli::Move; -use move_lang::shared::NumericalAddress; use crate::cmd::{Cmd, context_with_empty_manifest}; use crate::context::Context; use crate::export::create_project_directories; use crate::cmd::new::dependencies_movestdlib; +use crate::cmd::new::parse_named_address; /// Init project command. #[derive(StructOpt, Debug)] #[structopt(setting(structopt::clap::AppSettings::ColoredHelp))] pub struct Init { #[structopt( - help = "Creates only Dove.toml.", + help = "Creates only Move.toml.", name = "minimal", long = "minimal", short = "m" )] minimal: bool, + + #[structopt( + help = "Named address.", + long = "addresses", + short = "a", + parse(try_from_str = parse_named_address) + )] + addresses: Vec<(String, String)>, } impl Cmd for Init { @@ -50,7 +56,7 @@ impl Cmd for Init { project_name ); - let move_toml_string = move_toml_new(project_name, &ctx.move_args); + let move_toml_string = move_toml_new(project_name, &ctx.move_args, &self.addresses); std::fs::write(move_toml_path, move_toml_string)?; if !self.minimal { @@ -82,7 +88,7 @@ fn is_valid_name(text: &str) -> bool { RE.is_match(text) } -fn move_toml_new(project_name: &str, move_args: &Move) -> String { +fn move_toml_new(project_name: &str, move_args: &Move, addresses: &[(String, String)]) -> String { let mut move_toml_string = format!( "\ [package]\n\ @@ -96,21 +102,11 @@ fn move_toml_new(project_name: &str, move_args: &Move) -> String { move_toml_string += format!("dialect = \"{}\"\n", dialect_name).as_str(); } - let mut addresses = move_args - .named_addresses - .iter() - .cloned() - .collect::>(); - addresses.insert( - "Std".to_string(), - NumericalAddress::parse_str("0x1").unwrap(), - ); - move_toml_string += "\n[addresses]\n"; - - for (name, address) in &addresses { + move_toml_string += "Std = \"0x1\"\n"; + for (name, address) in addresses { move_toml_string += format!("{} = \"{}\"\n", name, address).as_str(); } - move_toml_string + dependencies_movestdlib() + move_toml_string + &dependencies_movestdlib() } diff --git a/dove/src/cmd/new.rs b/dove/src/cmd/new.rs index f9c3095b..26d38aca 100644 --- a/dove/src/cmd/new.rs +++ b/dove/src/cmd/new.rs @@ -9,10 +9,10 @@ use move_core_types::account_address::AccountAddress; use move_core_types::errmap::ErrorMapping; use move_cli::Command as MoveCommand; use move_cli::package::cli::PackageCommand; -use move_package::BuildConfig; use crate::cmd::{Cmd, context_with_empty_manifest}; use crate::context::Context; use crate::export::create_project_directories; +use crate::{MOVE_STDLIB_URL, MOVE_STDLIB_VERSION}; /// Create project command. #[derive(StructOpt, Debug)] @@ -20,6 +20,7 @@ use crate::export::create_project_directories; pub struct New { #[structopt(help = "Project name.")] project_name: String, + #[structopt( help = "Creates only Move.toml without dependencies.", name = "minimal", @@ -27,6 +28,14 @@ pub struct New { short = "m" )] minimal: bool, + + #[structopt( + help = "Named address.", + long = "addresses", + short = "a", + parse(try_from_str = parse_named_address) + )] + addresses: Vec<(String, String)>, } impl Cmd for New { @@ -45,13 +54,6 @@ impl Cmd for New { cmd: PackageCommand::New { name: self.project_name.clone(), }, - path: Some(ctx.project_dir.clone()), - config: BuildConfig { - generate_abis: false, - generate_docs: false, - test_mode: false, - dev_mode: false, - }, }; run_cli( @@ -66,7 +68,7 @@ impl Cmd for New { bail!("Failed to create a project") } - add_dialect_addresses_and_stdlib(&project_dir, &ctx.move_args)?; + add_dialect_addresses_and_stdlib(&project_dir, &ctx.move_args, &self.addresses)?; if !self.minimal { println!( @@ -89,7 +91,11 @@ impl Cmd for New { } } -fn add_dialect_addresses_and_stdlib(project_dir: &Path, move_args: &Move) -> anyhow::Result<()> { +fn add_dialect_addresses_and_stdlib( + project_dir: &Path, + move_args: &Move, + named_addresses: &[(String, String)], +) -> anyhow::Result<()> { let move_toml_path = project_dir.join("Move.toml"); let mut move_toml = read_to_string(&move_toml_path)?.parse::()?; // add to Move.toml - dialect, @@ -117,20 +123,34 @@ fn add_dialect_addresses_and_stdlib(project_dir: &Path, move_args: &Move) -> any .ok_or_else(|| anyhow!(r#"Couldn't get the "addresses" section in "Move.toml""#))?; address_table.insert("Std".to_string(), Value::String("0x1".to_string())); - for (name, address) in &move_args.named_addresses { + for (name, address) in named_addresses { address_table.insert(name.clone(), Value::String(address.to_string())); } - let move_toml_string = move_toml.to_string() + dependencies_movestdlib(); + let move_toml_string = move_toml.to_string() + &dependencies_movestdlib(); fs::write(&move_toml_path, move_toml_string)?; Ok(()) } /// Move.toml: Dependency movestdlib -pub fn dependencies_movestdlib() -> &'static str { - r#"[dependencies.MoveStdlib] -git = "https://github.com/pontem-network/move-stdlib.git" -rev = "79ed97fc1f98fefab16fbb54988bdc7defb09578" -"# +pub fn dependencies_movestdlib() -> String { + format!( + r#"[dependencies.MoveStdlib] +git = "{}" +rev = "{}""#, + MOVE_STDLIB_URL, MOVE_STDLIB_VERSION + ) +} + +/// Address. +pub fn parse_named_address(s: &str) -> anyhow::Result<(String, String)> { + let before_after = s.split('=').collect::>(); + + if before_after.len() != 2 { + anyhow::bail!("Invalid named address assignment. Must be of the form =
, but found '{}'", s); + } + let name = before_after[0].to_string(); + let addr = before_after[1].to_string(); + Ok((name, addr)) } diff --git a/dove/src/cmd/prover.rs b/dove/src/cmd/prover.rs index 0cf3c6eb..decb573b 100644 --- a/dove/src/cmd/prover.rs +++ b/dove/src/cmd/prover.rs @@ -33,9 +33,11 @@ pub struct Prove { /// Override path to boogie executable. #[structopt(long)] boogie_exe: Option, + /// Override path to z3 executable. #[structopt(long)] z3_exe: Option, + /// Override path to cvc4 executable. #[structopt(long)] cvc4_exe: Option, @@ -46,19 +48,19 @@ impl Cmd for Prove { where Self: Sized, { - let (boogie_exe, z3_exe, cvc4_exe) = self.make_config(ctx).map(|conf| { + let (boogie_exe, z3_exe, cvc5_exe) = self.make_config(ctx).map(|conf| { ( conf.boogie_exe.unwrap_or_default(), conf.z3_exe.unwrap_or_default(), - conf.cvc4_exe.unwrap_or_default(), + conf.cvc5_exe.unwrap_or_default(), ) })?; ensure!(is_boogie_available(&boogie_exe), "boogie executable not found in PATH. Please install it from https://github.com/boogie-org/boogie"); ensure!(is_z3_available(&z3_exe), "z3 executable not found in PATH. Please install it from https://github.com/Z3Prover/z3"); - if !cvc4_exe.is_empty() { - ensure!(is_cvc4_available(&cvc4_exe), "cvc4 executable not found in PATH. Please install it from https://github.com/CVC4/CVC4-archived"); + if !cvc5_exe.is_empty() { + ensure!(is_cvc4_available(&cvc5_exe), "cvc4 executable not found in PATH. Please install it from https://github.com/CVC4/CVC4-archived"); } // Build a project @@ -78,9 +80,9 @@ impl Cmd for Prove { BoogieOptions::default() }; - if cvc4_exe.is_empty() && boogie_options.use_cvc4 { + if cvc5_exe.is_empty() && boogie_options.use_cvc5 { println!("Warning: cvc4 is not defined."); - boogie_options.use_cvc4 = false; + boogie_options.use_cvc5 = false; } // addresses @@ -105,7 +107,7 @@ impl Cmd for Prove { backend: BoogieOptions { boogie_exe, z3_exe, - cvc4_exe, + cvc5_exe, ..boogie_options }, move_deps, @@ -132,8 +134,8 @@ impl Prove { if let Some(z3_exe) = toml_conf.z3_exe { conf.z3_exe = Some(z3_exe); } - if let Some(cvc4_exe) = toml_conf.cvc4_exe { - conf.cvc4_exe = Some(cvc4_exe); + if let Some(cvc4_exe) = toml_conf.cvc5_exe { + conf.cvc5_exe = Some(cvc4_exe); } } // cmd @@ -144,7 +146,7 @@ impl Prove { conf.z3_exe = Some(z3_exe); } if let Some(cvc4_exe) = self.cvc4_exe.take() { - conf.cvc4_exe = Some(cvc4_exe); + conf.cvc5_exe = Some(cvc4_exe); } conf.normalize()?; Ok(conf) @@ -212,7 +214,7 @@ struct ProverConfig { #[serde(rename = "z3")] pub z3_exe: Option, #[serde(rename = "cvc4")] - pub cvc4_exe: Option, + pub cvc5_exe: Option, } impl ProverConfig { @@ -221,13 +223,13 @@ impl ProverConfig { ProverConfig { boogie_exe: find_path(&env_path, BOOGIE_EXE), z3_exe: find_path(&env_path, Z3_EXE), - cvc4_exe: find_path(&env_path, CVC4_EXE), + cvc5_exe: find_path(&env_path, CVC4_EXE), } } else { ProverConfig { boogie_exe: None, z3_exe: None, - cvc4_exe: None, + cvc5_exe: None, } } } @@ -236,7 +238,7 @@ impl ProverConfig { fn canonicalize(path: Option<&mut String>, home: &str) -> Result<(), anyhow::Error> { if let Some(path) = path { if path.starts_with("~/") { - *path = path.replacen("~", home, 1); + *path = path.replacen('~', home, 1); } let mut path_buff = PathBuf::from_str(path)?; if path_buff.exists() { @@ -252,7 +254,7 @@ impl ProverConfig { canonicalize(self.boogie_exe.as_mut(), &home)?; canonicalize(self.z3_exe.as_mut(), &home)?; - canonicalize(self.cvc4_exe.as_mut(), &home)?; + canonicalize(self.cvc5_exe.as_mut(), &home)?; } Ok(()) } diff --git a/dove/src/cmd/run.rs b/dove/src/cmd/run.rs index 3322902d..d2e0ced7 100644 --- a/dove/src/cmd/run.rs +++ b/dove/src/cmd/run.rs @@ -1,15 +1,17 @@ +use std::collections::HashMap; use std::fs; use std::path::{Path, PathBuf}; use structopt::StructOpt; use anyhow::{Error, Result}; use bytecode_source_map::source_map::SourceMap; use lang::bytecode::info::BytecodeInfo; -use move_cli::{Move, run_cli}; +use move_cli::{DEFAULT_STORAGE_DIR, Move, run_cli}; use move_cli::sandbox::cli::SandboxCommand; use move_cli::Command; +use move_command_line_common::files::FileHash; use move_core_types::account_address::AccountAddress; use move_core_types::errmap::ErrorMapping; -use move_lang::shared::{NumberFormat, NumericalAddress}; +use move_package::BuildConfig; use move_package::compilation::package_layout::CompiledPackageLayout; use crate::cmd::Cmd; use crate::cmd::build::run_internal_build; @@ -33,10 +35,12 @@ use crate::tx::model::EnrichedTransaction; pub struct Run { #[structopt(flatten)] call: CallDeclarationCmd, + /// If set, the effects of executing `script_file` (i.e., published, updated, and /// deleted resources) will NOT be committed to disk. - #[structopt(long = "dry-run", short = "d")] + #[structopt(long = "dry-run")] dry_run: bool, + /// Gas budget. #[structopt(long = "gas_budget", short = "g")] gas_budget: Option, @@ -81,27 +85,31 @@ impl Cmd for Run { .named_address() .into_iter() .filter_map(|(k, v)| v.map(|v| (k, v))) - .map(|(k, v)| { - ( - k.to_string(), - NumericalAddress::new(v.into_bytes(), NumberFormat::Hex), - ) - }) + .map(|(k, v)| (k.to_string(), v)) .collect(); let move_args = Move { - named_addresses, - storage_dir: ctx.move_args.storage_dir.clone(), - build_dir: ctx.move_args.build_dir.clone(), - mode: ctx.move_args.mode, + package_path: ctx.project_dir.clone(), dialect: ctx.move_args.dialect, verbose: ctx.move_args.verbose, + build_config: BuildConfig { + dev_mode: true, + test_mode: true, + generate_docs: false, + generate_abis: false, + install_dir: None, + force_recompilation: false, + additional_named_addresses: named_addresses, + }, }; run_cli( natives, &error_descriptions, &move_args, - &Command::Sandbox { cmd }, + &Command::Sandbox { + storage_dir: PathBuf::from(DEFAULT_STORAGE_DIR), + cmd, + }, ) } EnrichedTransaction::Global { .. } => unreachable!(), @@ -110,8 +118,7 @@ impl Cmd for Run { } fn resolve_script_name(bi: &BytecodeInfo) -> Result { - let path: &Path = bi.bytecode_ref().0.as_ref(); - let path = path.to_path_buf(); + let path = PathBuf::from(&bi.bytecode_ref().0); let name = path .file_name() .map(|name| name.to_string_lossy().to_string()) @@ -124,20 +131,57 @@ fn resolve_script_name(bi: &BytecodeInfo) -> Result { .join(CompiledPackageLayout::SourceMaps.path()) .join(name); source_map.set_extension("mvsm"); - let source_map = bcs::from_bytes(&fs::read(source_map)?)?; - find_loc(&source_map) + let source_map: SourceMap = bcs::from_bytes(&fs::read(source_map)?)?; + + let project_path = path + .parent() + .and_then(|parent| parent.parent()) + .and_then(|parent| parent.parent()) + .and_then(|parent| parent.parent()) + .ok_or_else(|| anyhow!("Failed to get project dir: {:?}", path))?; + + find_loc(project_path, &source_map) } -fn find_loc(source_map: &SourceMap) -> Result { - source_map - .function_map +fn find_loc(project_path: &Path, source_map: &SourceMap) -> Result { + let map = find_move_files_in_project(project_path); + let hash = source_map.definition_location.file_hash(); + + map.get(&hash) + .cloned() + .ok_or_else(|| anyhow!("Script location not found")) +} + +/// Search "move" files in the project +/// Search is carried out in the directories: scripts, sources +/// +fn find_move_files_in_project(project_path: &Path) -> HashMap { + ["scripts", "sources"] .iter() - .find_map(|(_, v)| Some(PathBuf::from(v.decl_location.file().as_str()))) - .or_else(|| { - source_map - .struct_map - .iter() - .find_map(|(_, v)| Some(PathBuf::from(v.decl_location.file().as_str()))) + .filter_map(|dir| find_move_files_in_dir(&project_path.join(dir)).ok()) + .flatten() + .collect() +} + +/// Search "move" files in directory +/// Recursive search +fn find_move_files_in_dir(dir_path: &Path) -> Result> { + let list = fs::read_dir(dir_path)? + .filter_map(|dir| dir.ok()) + .map(|r| r.path()) + .filter_map(|path| { + if path.is_dir() { + find_move_files_in_dir(&path).ok() + } else if path.is_file() && path.extension().and_then(|s| s.to_str()) == Some("move") + { + let file = fs::read_to_string(&path).ok()?; + let hash = FileHash::new(&file); + Some(vec![(hash, path)]) + } else { + None + } }) - .ok_or_else(|| anyhow!("Script location not found")) + .flatten() + .collect(); + Ok(list) } diff --git a/dove/src/cmd/test.rs b/dove/src/cmd/test.rs index 4770fe0a..a53420ca 100644 --- a/dove/src/cmd/test.rs +++ b/dove/src/cmd/test.rs @@ -2,7 +2,6 @@ use structopt::StructOpt; use move_core_types::errmap::ErrorMapping; use move_cli::{run_cli, Command as MoveCommand}; use move_cli::package::cli::PackageCommand; -use move_package::BuildConfig; use diem_types::account_address::AccountAddress; use crate::cmd::Cmd; use crate::cmd::build::run_internal_build; @@ -20,6 +19,7 @@ pub struct Test { long = "instructions" )] instruction_execution_bound: u64, + /// A filter string to determine which unit tests to run #[structopt(name = "filter", short = "f", long = "filter")] filter: Option, @@ -36,6 +36,7 @@ pub struct Test { long = "threads" )] num_threads: usize, + /// Report test statistics at the end of testing #[structopt(name = "report_statistics", short = "s", long = "statistics")] report_statistics: bool, @@ -52,6 +53,10 @@ pub struct Test { /// Verbose mode #[structopt(long = "verbose")] verbose_mode: bool, + + /// Compute coverage + #[structopt(long = "coverage")] + compute_coverage: bool, } impl Cmd for Test { @@ -77,13 +82,7 @@ impl Cmd for Test { report_storage_on_error: self.report_storage_on_error, check_stackless_vm: self.check_stackless_vm, verbose_mode: self.verbose_mode, - }, - path: Some(ctx.project_dir.clone()), - config: BuildConfig { - generate_abis: false, - generate_docs: false, - test_mode: true, - dev_mode: true, + compute_coverage: self.compute_coverage, }, }; diff --git a/dove/src/cmd/tx.rs b/dove/src/cmd/tx.rs index fa4b3c46..03b0febb 100644 --- a/dove/src/cmd/tx.rs +++ b/dove/src/cmd/tx.rs @@ -24,6 +24,7 @@ use crate::tx::model::{EnrichedTransaction, Transaction}; pub struct CreateTransactionCmd { #[structopt(flatten)] call: CallDeclarationCmd, + #[structopt(help = "Output file name.", long = "output", short = "o")] output: Option, } @@ -64,7 +65,7 @@ fn store_transaction( if tx_file.exists() { fs::remove_file(&tx_file)?; } - println!("Store transaction:{:?}", tx_file); + println!("Store transaction: {:?}", tx_file); Ok(fs::write(&tx_file, bcs::to_bytes(&tx)?)?) } diff --git a/dove/src/context.rs b/dove/src/context.rs index d477c79b..55771fe9 100644 --- a/dove/src/context.rs +++ b/dove/src/context.rs @@ -2,10 +2,8 @@ use std::fs; use std::path::PathBuf; use anyhow::Error; use move_cli::Move; -use move_core_types::account_address::AccountAddress; use move_package::compilation::package_layout::CompiledPackageLayout; use move_package::source_package::parsed_manifest::{AddressDeclarations, SourceManifest}; -use move_symbol_pool::Symbol; /// Project context. pub struct Context { @@ -62,14 +60,7 @@ impl Context { /// Creates and returns map of named addresses. pub fn named_address(&self) -> AddressDeclarations { - let mut named_address = self.manifest.addresses.clone().unwrap_or_default(); - for (name, addr) in &self.move_args.named_addresses { - named_address.insert( - Symbol::from(name.as_str()), - Some(AccountAddress::new(addr.into_bytes())), - ); - } - named_address + self.manifest.addresses.clone().unwrap_or_default() } /// Returns transaction output folder for specified `package` or for the default package. diff --git a/dove/src/lib.rs b/dove/src/lib.rs index 3099ee2e..8972564c 100644 --- a/dove/src/lib.rs +++ b/dove/src/lib.rs @@ -6,10 +6,10 @@ pub const DOVE_VERSION: &str = git_hash::crate_version!(); /// Dove short hash of the commit pub const DOVE_HASH: &str = git_hash::git_hash_short_as_str!(); -/// Version and Tag (v###) for PONT STDLIB -pub const PONT_STDLIB_VERSION: &str = "v0.3.0"; -/// GIT URL for PONT STDLIB -pub const PONT_STDLIB_URL: &str = "https://github.com/pontem-network/move-stdlib"; +/// Version and Tag (v###) for MOVE STDLIB +pub const MOVE_STDLIB_VERSION: &str = "25b211f0129afd5b511eb27412bf0d8aaba39eb0"; +/// GIT URL for MOVE STDLIB +pub const MOVE_STDLIB_URL: &str = "https://github.com/pontem-network/move-stdlib"; /// DIEM version|branch pub const DIEM_VERSION: &str = git_hash::dependency_branch_from_cargo_lock!("move-cli"); @@ -29,7 +29,5 @@ pub mod colorize; pub mod context; /// Export Dove.toml => Move.toml pub mod export; -/// Manifest Processing -pub mod manifest; /// Transactions. pub mod tx; diff --git a/dove/src/manifest.rs b/dove/src/manifest.rs deleted file mode 100644 index 232fb5b0..00000000 --- a/dove/src/manifest.rs +++ /dev/null @@ -1,15 +0,0 @@ -use std::hash::{Hash, Hasher}; -use std::collections::hash_map::DefaultHasher; -use move_package::source_package::parsed_manifest::SourceManifest; - -/// Get a hash object in the form of u64 -pub trait HashU64: Hash { - /// Conversion to Bytes - fn hash_u64(&self) -> u64 { - let mut hasher = DefaultHasher::new(); - self.hash(&mut hasher); - hasher.finish() - } -} - -impl HashU64 for SourceManifest {} diff --git a/dove/src/tx/cmd.rs b/dove/src/tx/cmd.rs index 6a05c2c1..d77838ac 100644 --- a/dove/src/tx/cmd.rs +++ b/dove/src/tx/cmd.rs @@ -29,8 +29,8 @@ Examples: #[structopt( help = r#"Script arguments, e.g. 10 20 30"#, name = "Script arguments.", - long = "parameters", - short = "p" + long = "args", + short = "a" )] params: Option>, #[structopt( @@ -44,6 +44,7 @@ Examples: impl CallDeclarationCmd { /// Takes call data. + #[must_use] pub fn take(&mut self) -> Self { Self { call: mem::take(&mut self.call), diff --git a/dove/src/tx/fn_call.rs b/dove/src/tx/fn_call.rs index 98e69b32..ca99dd87 100644 --- a/dove/src/tx/fn_call.rs +++ b/dove/src/tx/fn_call.rs @@ -2,7 +2,7 @@ use std::str::FromStr; use std::fmt::Debug; use anyhow::Error; use move_symbol_pool::Symbol; -use diem_types::account_config::{treasury_compliance_account_address, diem_root_address}; +use diem_types::account_config::diem_root_address; use move_core_types::account_address::AccountAddress; use move_core_types::identifier::Identifier; use move_core_types::language_storage::{CORE_CODE_ADDRESS, TypeTag}; @@ -255,7 +255,6 @@ fn prepare_function_signature( Signer::from_str(arg).and_then(|s| { Ok(match s { Signer::Root => diem_root_address(), - Signer::Treasury => treasury_compliance_account_address(), Signer::Placeholder => { return Err(anyhow!( "Use explicit signer instead of placeholder" diff --git a/dove/src/tx/model.rs b/dove/src/tx/model.rs index dc3ef37f..afc34893 100644 --- a/dove/src/tx/model.rs +++ b/dove/src/tx/model.rs @@ -182,8 +182,6 @@ impl TryInto for ScriptArg { pub enum Signer { /// Root signer. Root, - /// Treasury signer. - Treasury, /// Template to replace. Placeholder, /// Named address. @@ -196,7 +194,6 @@ impl FromStr for Signer { fn from_str(s: &str) -> Result { Ok(match s.to_lowercase().as_str() { "root" | "rt" | "dr" => Self::Root, - "treasury" | "tr" | "tc" => Self::Treasury, "_" => Self::Placeholder, _ => Self::Name(Symbol::from(s)), }) diff --git a/dove/src/tx/parser.rs b/dove/src/tx/parser.rs index e9448bd5..9fdfda24 100644 --- a/dove/src/tx/parser.rs +++ b/dove/src/tx/parser.rs @@ -2,12 +2,13 @@ use move_core_types::language_storage::TypeTag; use anyhow::Error; use move_core_types::account_address::AccountAddress; use move_core_types::identifier::Identifier; -use move_lang::parser::lexer::{Lexer, Tok}; -use move_lang::parser::syntax::{parse_type, parse_address_bytes, consume_token, Context}; +use move_compiler::parser::lexer::{Lexer, Tok}; +use move_compiler::parser::syntax::{parse_type, parse_address_bytes, consume_token, Context}; use lang::lexer::unwrap_spanned_ty; use std::str::FromStr; -use move_lang::Flags; -use move_lang::shared::CompilationEnv; +use move_command_line_common::files::FileHash; +use move_compiler::Flags; +use move_compiler::shared::CompilationEnv; use move_package::source_package::parsed_manifest::AddressDeclarations; use move_symbol_pool::Symbol; @@ -109,7 +110,7 @@ impl Call { /// Parse call /// Return: Ok(Script name, Type parameters, Function arguments) or Error pub(crate) fn parse_call(addr_map: &AddressDeclarations, call: &str) -> Result { - let mut lexer = Lexer::new(call, Symbol::from("call")); + let mut lexer = Lexer::new(call, FileHash::new("call")); let mut env = CompilationEnv::new(Flags::empty(), Default::default()); let mut ctx = Context::new(&mut env, &mut lexer); @@ -144,7 +145,7 @@ fn parse_call_body(addr_map: &AddressDeclarations, ctx: &mut Context) -> Result< let mut tokens = vec![]; loop { - if ctx.tokens.peek() != Tok::IdentifierValue { + if ctx.tokens.peek() != Tok::Identifier { break; } @@ -295,7 +296,7 @@ fn parse_args(ctx: &mut Context) -> Result, Error> { } pub(crate) fn parse_tp_param(tp: &str) -> Result { - let mut lexer = Lexer::new(tp, Symbol::from("tp")); + let mut lexer = Lexer::new(tp, FileHash::new("tp")); let mut env = CompilationEnv::new(Flags::empty(), Default::default()); let mut ctx = Context::new(&mut env, &mut lexer); @@ -321,7 +322,7 @@ where { let map_err = |err| Error::msg(format!("{:?}", err)); - let mut lexer = Lexer::new(tkn, Symbol::from("vec")); + let mut lexer = Lexer::new(tkn, FileHash::new("vec")); lexer.advance().map_err(map_err)?; diff --git a/dove/tests/helper.rs b/dove/tests/helper.rs index 25983120..a2f4d733 100644 --- a/dove/tests/helper.rs +++ b/dove/tests/helper.rs @@ -52,6 +52,7 @@ pub fn execute_dove_at(args: &[&str], project_path: &Path) -> Result { output.status, String::from_utf8(output.stderr).unwrap_or_default() ); + Ok(String::from_utf8(output.stdout)?) } @@ -120,8 +121,12 @@ pub fn assert_basic_project_dirs_exist(project_dir: &Path) -> Result<()> { /// Create a new project in a temporary directory /// Returns the path to the project -pub fn create_new_project(project_name: &str, addresses: HashMap<&str, &str>) -> Result { - let (base_dir, project_dir) = pre_start_dove_new(project_name)?; +pub fn create_new_project( + project_name: &str, + addresses: HashMap<&str, &str>, + move_stdlib: bool, +) -> Result { + let (base_dir, project_path) = pre_start_dove_new(project_name)?; let mut args = vec!["new", project_name]; let addresses: Vec = addresses @@ -135,13 +140,25 @@ pub fn create_new_project(project_name: &str, addresses: HashMap<&str, &str>) -> } execute_dove_at(&args, &base_dir)?; - Ok(project_dir) + + if !move_stdlib { + let move_toml_path = project_path.join("Move.toml"); + let move_toml_content = fs::read_to_string(&move_toml_path)?; + let mut move_toml = toml::from_str::(&move_toml_content)?; + move_toml + .get_mut("dependencies") + .and_then(|dep| dep.as_table_mut()) + .and_then(|dep| dep.remove("MoveStdlib")); + fs::write(&move_toml_path, move_toml.to_string())?; + } + + Ok(project_path) } /// Create a test project -pub fn new_demo_project(project_name: &str) -> Result { +pub fn new_demo_project(project_name: &str, move_stdlib: bool) -> Result { let addresses = [("Demo", "0x2")].into_iter().collect(); - let project_path = create_new_project(project_name, addresses)?; + let project_path = create_new_project(project_name, addresses, move_stdlib)?; // scripts/main.move let mut main_script = fs::File::create(project_path.join("scripts").join("main.move"))?; @@ -150,47 +167,47 @@ pub fn new_demo_project(project_name: &str) -> Result { // scripts/one_param.move let mut one_param_scripts = fs::File::create(project_path.join("scripts").join("one_param.move"))?; - one_param_scripts.write_all(b"script { fun one_param(a:bool){ assert(a,2); } }")?; + one_param_scripts.write_all(b"script { fun one_param(a:bool){ assert!(a,2); } }")?; // scripts/two_params.move let mut two_params_scripts = fs::File::create(project_path.join("scripts").join("two_params.move"))?; - two_params_scripts.write_all(b"script { fun two_params(a:u8, b:u8){ assert(a==b,2); } }")?; + two_params_scripts.write_all(b"script { fun two_params(a:u8, b:u8){ assert!(a==b,2); } }")?; // scripts/with_type.move let mut with_type_scripts = fs::File::create(project_path.join("scripts").join("with_type.move"))?; - with_type_scripts.write_all(b"script { fun with_type(_a:u8){ assert(true, 3); } }")?; + with_type_scripts.write_all(b"script { fun with_type(_a:u8){ assert!(true, 3); } }")?; // scripts/multiple_scripts.move let mut multiple_scripts = fs::File::create(project_path.join("scripts").join("multiple_scripts.move"))?; multiple_scripts.write_all( - b"script { fun script_1(a:bool){ assert(a, 1); } }\n\ - script { fun script_2(a:u8, b:u8){ assert(a==b,2); } }", + b"script { fun script_1(a:bool){ assert!(a, 1); } }\n\ + script { fun script_2(a:u8, b:u8){ assert!(a==b,2); } }", )?; // scripts/one_param.move let mut one_param_scripts = fs::File::create(project_path.join("scripts").join("one_param.move"))?; - one_param_scripts.write_all(b"script { fun one_param(a:bool){ assert(a,2); } }")?; + one_param_scripts.write_all(b"script { fun one_param(a:bool){ assert!(a,2); } }")?; // scripts/two_params.move let mut two_params_scripts = fs::File::create(project_path.join("scripts").join("two_params.move"))?; - two_params_scripts.write_all(b"script { fun two_params(a:u8, b:u8){ assert(a==b,2); } }")?; + two_params_scripts.write_all(b"script { fun two_params(a:u8, b:u8){ assert!(a==b,2); } }")?; // scripts/with_type.move let mut with_type_scripts = fs::File::create(project_path.join("scripts").join("with_type.move"))?; - with_type_scripts.write_all(b"script { fun with_type(_a:u8){ assert(true, 3); } }")?; + with_type_scripts.write_all(b"script { fun with_type(_a:u8){ assert!(true, 3); } }")?; // scripts/multiple_scripts.move let mut multiple_scripts = fs::File::create(project_path.join("scripts").join("multiple_scripts.move"))?; multiple_scripts.write_all( - b"script { fun script_1(a:bool){ assert(a, 1); } }\n\ - script { fun script_2(a:u8, b:u8){ assert(a==b,2); } }", + b"script { fun script_1(a:bool){ assert!(a, 1); } }\n\ + script { fun script_2(a:u8, b:u8){ assert!(a==b,2); } }", )?; // sources/demo1v.move @@ -211,7 +228,7 @@ pub fn new_demo_project(project_name: &str) -> Result { b"#[test_only]\n\ module Demo::Test1{\n\ #[test]\n\ - fun success(){ assert(true,1); }\n\ + fun success(){ assert!(true,1); }\n\ }", )?; @@ -221,7 +238,7 @@ pub fn new_demo_project(project_name: &str) -> Result { b"#[test_only]\n\ module Demo::Test2{\n\ #[test]\n\ - fun success(){ assert(true,2); }\n\ + fun success(){ assert!(true,2); }\n\ }", )?; @@ -231,7 +248,7 @@ pub fn new_demo_project(project_name: &str) -> Result { b"#[test_only]\n\ module Demo::Test3{\n\ #[test]\n\ - fun error(){ assert(false,3); }\n\ + fun error(){ assert!(false,3); }\n\ }", )?; diff --git a/dove/tests/test_cmd_dove_build.rs b/dove/tests/test_cmd_dove_build.rs index fd1b3ca4..c8744e65 100644 --- a/dove/tests/test_cmd_dove_build.rs +++ b/dove/tests/test_cmd_dove_build.rs @@ -10,7 +10,7 @@ use std::collections::HashMap; #[test] fn test_cmd_dove_build_without_arguments() { let project_name = "project_build_without_arguments"; - let project_path = new_demo_project(project_name).unwrap(); + let project_path = new_demo_project(project_name, false).unwrap(); execute_dove_at(&["build"], &project_path).unwrap(); @@ -18,13 +18,13 @@ fn test_cmd_dove_build_without_arguments() { } /// Build a project and generate documentation -/// $ dove build -d +/// $ dove build --doc #[test] fn test_cmd_dove_build_with_doc() { - let project_name = "project_build_build_with_doc"; - let project_path = new_demo_project(project_name).unwrap(); + let project_name = "project_build_with_doc"; + let project_path = new_demo_project(project_name, false).unwrap(); - execute_dove_at(&["build", "-d"], &project_path).unwrap(); + execute_dove_at(&["build", "--doc"], &project_path).unwrap(); let docs_path = project_path.join("build").join(project_name).join("docs"); @@ -36,16 +36,16 @@ fn test_cmd_dove_build_with_doc() { } /// Build a project and package -/// $ dove build -p --modules_exclude NAME_1 NAME_2 ... NAME_N -o PACKAGE_NAME.mv +/// $ dove build --bundle --modules_exclude NAME_1 NAME_2 ... NAME_N -o PACKAGE_NAME.mv #[test] fn test_cmd_dove_build_with_package() { - let project_name = "project_build_build_with_package"; - let project_path = new_demo_project(project_name).unwrap(); + let project_name = "project_build_with_package"; + let project_path = new_demo_project(project_name, false).unwrap(); execute_dove_at( &[ "build", - "-p", + "--bundle", "--modules_exclude", "Demo1v", "Demo2v", @@ -80,8 +80,8 @@ fn test_cmd_dove_build_with_package() { /// $ dove build --error-map OUTPUT_NAME #[test] fn test_cmd_dove_build_error_map() { - let project_name = "project_build_build_error_map"; - let project_path = new_demo_project(project_name).unwrap(); + let project_name = "project_build_error_map"; + let project_path = new_demo_project(project_name, false).unwrap(); execute_dove_at(&["build", "--error-map", "error_map"], &project_path).unwrap(); assert!(project_path.join("error_map.errmap").exists()); @@ -92,7 +92,7 @@ fn test_cmd_dove_build_error_map() { #[test] fn test_cmd_dove_build_two_times() { let project_name = "project_build_two_times"; - let project_path = create_new_project(project_name, HashMap::new()).unwrap(); + let project_path = create_new_project(project_name, HashMap::new(), false).unwrap(); build(&project_path).unwrap(); build(&project_path).unwrap(); diff --git a/dove/tests/test_cmd_dove_clean.rs b/dove/tests/test_cmd_dove_clean.rs index 851a86b2..489a9ae2 100644 --- a/dove/tests/test_cmd_dove_clean.rs +++ b/dove/tests/test_cmd_dove_clean.rs @@ -6,7 +6,7 @@ use crate::helper::{new_demo_project, delete_project, build, execute_dove_at}; #[test] fn test_cmd_dove_clean() { let project_name = "project_clean"; - let project_dir = new_demo_project(project_name).unwrap(); + let project_dir = new_demo_project(project_name, false).unwrap(); build(&project_dir).unwrap(); assert!(project_dir.join("build").exists()); diff --git a/dove/tests/test_cmd_dove_run.rs b/dove/tests/test_cmd_dove_run.rs index 5ed9e9f1..f12df7cb 100644 --- a/dove/tests/test_cmd_dove_run.rs +++ b/dove/tests/test_cmd_dove_run.rs @@ -8,7 +8,7 @@ use helper::{new_demo_project, execute_dove_at, delete_project}; #[test] fn test_cmd_dove_run_with_call() { let project_name = "project_run_with_call"; - let project_folder = new_demo_project(project_name).unwrap(); + let project_folder = new_demo_project(project_name, true).unwrap(); for call in ["main()", "one_param(true)", "two_params(1,1)"] { execute_dove_at(&["run", call], &project_folder).unwrap(); @@ -17,16 +17,16 @@ fn test_cmd_dove_run_with_call() { delete_project(&project_folder).unwrap(); } -/// $ dove run 'one_param' -p true -/// $ dove run 'two_params' -p 1 1 +/// $ dove run 'one_param' -a true +/// $ dove run 'two_params' --args 1 1 #[test] fn test_cmd_dove_run_with_params() { let project_name = "project_run_with_params"; - let project_folder = new_demo_project(project_name).unwrap(); + let project_folder = new_demo_project(project_name, true).unwrap(); for call in [ - vec!["run", "one_param", "-p", "true"], - vec!["run", "two_params", "-p", "1", "1"], + vec!["run", "one_param", "-a", "true"], + vec!["run", "two_params", "--args", "1", "1"], ] { execute_dove_at(&call, &project_folder).unwrap(); } @@ -37,16 +37,16 @@ fn test_cmd_dove_run_with_params() { /// With type /// $ dove run 'with_type(1)' /// $ dove run 'with_type(1)' -t u8 -/// $ dove run 'with_type' -p 1 -t u8 +/// $ dove run 'with_type' -a 1 -t u8 #[test] fn test_cmd_dove_run_with_type() { let project_name = "project_run_with_type"; - let project_folder = new_demo_project(project_name).unwrap(); + let project_folder = new_demo_project(project_name, true).unwrap(); for call in [ vec!["run", "with_type(1)"], vec!["run", "with_type(1)", "-t", "u8"], - vec!["run", "with_type", "-p", "1", "-t", "u8"], + vec!["run", "with_type", "-a", "1", "-t", "u8"], ] { execute_dove_at(&call, &project_folder).unwrap(); } @@ -61,7 +61,7 @@ fn test_cmd_dove_run_with_type() { #[ignore] fn test_cmd_dove_run_multiple() { let project_name = "project_run_multiple"; - let project_folder = new_demo_project(project_name).unwrap(); + let project_folder = new_demo_project(project_name, true).unwrap(); for call in ["script_1(true)", "script_2(1,1)"] { execute_dove_at(&["run", call], &project_folder).unwrap(); diff --git a/dove/tests/test_cmd_dove_test.rs b/dove/tests/test_cmd_dove_test.rs index 3e26f63e..247d6551 100644 --- a/dove/tests/test_cmd_dove_test.rs +++ b/dove/tests/test_cmd_dove_test.rs @@ -9,7 +9,7 @@ mod helper; #[test] fn test_cmd_dove_test() { let project_name = "project_test"; - let project_path = new_demo_project(project_name).unwrap(); + let project_path = new_demo_project(project_name, true).unwrap(); build(&project_path).unwrap(); // Success @@ -27,7 +27,7 @@ fn test_cmd_dove_test() { #[test] fn test_cmd_dove_test_list() { let project_name = "project_test_list"; - let project_path = new_demo_project(project_name).unwrap(); + let project_path = new_demo_project(project_name, true).unwrap(); build(&project_path).unwrap(); let output = execute_dove_at(&["test", "-l"], &project_path).unwrap(); diff --git a/dove/tests/test_cmd_dove_tx.rs b/dove/tests/test_cmd_dove_tx.rs index 3de3a8d4..18b9eecd 100644 --- a/dove/tests/test_cmd_dove_tx.rs +++ b/dove/tests/test_cmd_dove_tx.rs @@ -8,7 +8,7 @@ use helper::{new_demo_project, execute_dove_at, delete_project}; #[test] fn test_cmd_dove_tx_with_call() { let project_name = "project_tx_with_call"; - let project_folder = new_demo_project(project_name).unwrap(); + let project_folder = new_demo_project(project_name, false).unwrap(); for call in ["main()", "one_param(true)", "two_params(1,1)"] { execute_dove_at(&["tx", call], &project_folder).unwrap(); @@ -17,16 +17,16 @@ fn test_cmd_dove_tx_with_call() { } /// $ dove tx 'main()' -/// $ dove tx 'one_param' -p true -/// $ dove tx 'two_params' -p 1 1 +/// $ dove tx 'one_param' -a true +/// $ dove tx 'two_params' --args 1 1 #[test] fn test_cmd_dove_tx_with_params() { let project_name = "project_tx_with_params"; - let project_folder = new_demo_project(project_name).unwrap(); + let project_folder = new_demo_project(project_name, false).unwrap(); for call in [ - vec!["tx", "one_param", "-p", "true"], - vec!["tx", "two_params", "-p", "1", "1"], + vec!["tx", "one_param", "-a", "true"], + vec!["tx", "two_params", "--args", "1", "1"], ] { execute_dove_at(&call, &project_folder).unwrap(); } @@ -37,16 +37,16 @@ fn test_cmd_dove_tx_with_params() { /// With type /// $ dove tx 'with_type(1)' /// $ dove tx 'with_type(1)' -t u8 -/// $ dove tx 'with_type' -p 1 -t u8 +/// $ dove tx 'with_type' -a 1 -t u8 #[test] fn test_cmd_dove_tx_with_type() { let project_name = "project_tx_with_type"; - let project_folder = new_demo_project(project_name).unwrap(); + let project_folder = new_demo_project(project_name, false).unwrap(); for call in [ vec!["tx", "with_type(1)"], vec!["tx", "with_type(1)", "-t", "u8"], - vec!["tx", "with_type", "-p", "1", "-t", "u8"], + vec!["tx", "with_type", "-a", "1", "-t", "u8"], ] { execute_dove_at(&call, &project_folder).unwrap(); } @@ -59,7 +59,7 @@ fn test_cmd_dove_tx_with_type() { #[test] fn test_cmd_dove_tx_output() { let project_name = "project_tx_output"; - let project_folder = new_demo_project(project_name).unwrap(); + let project_folder = new_demo_project(project_name, false).unwrap(); for (name, args) in [ ("main", vec!["tx", "main()"]), diff --git a/lang/Cargo.toml b/lang/Cargo.toml index f784f82e..21ad20ad 100644 --- a/lang/Cargo.toml +++ b/lang/Cargo.toml @@ -12,11 +12,12 @@ publish = false [dependencies] # DIEM -move-core-types = { git = "https://github.com/pontem-network/diem.git", branch = "v1.5-pre" } -move-lang = { git = "https://github.com/pontem-network/diem.git", branch = "v1.5-pre" } -move-symbol-pool = { git = "https://github.com/pontem-network/diem.git", branch = "v1.5-pre" } -move-ir-types = { git = "https://github.com/pontem-network/diem.git", branch = "v1.5-pre" } -move-binary-format = { git = "https://github.com/pontem-network/diem.git", branch = "v1.5-pre" } +move-core-types = { git = "https://github.com/pontem-network/diem.git", branch = "v1.5.1-pre" } +move-compiler = { git = "https://github.com/pontem-network/diem.git", branch = "v1.5.1-pre" } +move-symbol-pool = { git = "https://github.com/pontem-network/diem.git", branch = "v1.5.1-pre" } +move-ir-types = { git = "https://github.com/pontem-network/diem.git", branch = "v1.5.1-pre" } +move-binary-format = { git = "https://github.com/pontem-network/diem.git", branch = "v1.5.1-pre" } +move-command-line-common = { git = "https://github.com/pontem-network/diem.git", branch = "v1.5.1-pre" } # third-party dependencies anyhow = "1.0.45" @@ -24,43 +25,6 @@ serde = { version = "1.0.130", features = ["derive"] } codespan-reporting = "0.11.1" walkdir = "2.3.1" -#move-lang = { git = "https://github.com/pontem-network/diem.git", branch = "v1.3-r1" } -#move-core-types = { git = "https://github.com/pontem-network/diem.git", branch = "v1.3-r1" } -#move-binary-format = { git = "https://github.com/pontem-network/diem.git", branch = "v1.3-r1" } -#move-vm-types = { git = "https://github.com/pontem-network/diem.git", branch = "v1.3-r1" } -#move-ir-types = { git = "https://github.com/pontem-network/diem.git", branch = "v1.3-r1" } -#ir-to-bytecode-syntax = { git = "https://github.com/pontem-network/diem.git", branch = "v1.3-r1" } -#compat = { path = "compat", package = "move-compat" } -#move-model = { git = "https://github.com/pontem-network/diem.git", branch = "v1.3-r1" } -# -#serde = "1.0.125" -#serde_derive = "1.0.125" -#serde_json = "1.0.52" -#log = "0.4" -#env_logger = "0.7.1" -#anyhow = "1.0.28" -#rand = "=0.7.3" -#hex = "0.4.2" -#itertools = "0.9.0" -#walkdir = "2.3.1" -#once_cell = "1.7.2" -# -#lsp-types = "0.89.0" -#codespan = "0.8.0" -#codespan-reporting = "0.8.0" -#codespan9 = { package = "codespan", version = "0.9.2" } -#codespan-reporting9 = { package = "codespan-reporting", version = "0.9.2" } -# -# -## bech32 support -#regex = "1.4.3" -#lazy_static = "1.4.0" -#bech32 = "0.7.2" -# -## ss58 prefix -#blake2-rfc = "0.2.18" -#rust-base58 = "0.0.4" - [dev-dependencies] include_dir = "0.6.0" tempfile = "3.2.0" \ No newline at end of file diff --git a/lang/src/bytecode/info.rs b/lang/src/bytecode/info.rs index d5cf14da..a3855860 100644 --- a/lang/src/bytecode/info.rs +++ b/lang/src/bytecode/info.rs @@ -54,9 +54,13 @@ impl BytecodeInfo { } } - pub fn find_script_function(&self, name: &str) -> Option