From 1e82570b8915e0ba7a89afefd1e06db6b6809863 Mon Sep 17 00:00:00 2001 From: Maksim Kurnikov Date: Mon, 22 Jun 2020 19:35:25 +0300 Subject: [PATCH 1/6] disable completion --- crates/move-language-server/src/server.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/crates/move-language-server/src/server.rs b/crates/move-language-server/src/server.rs index e862a3f7..fba1f992 100644 --- a/crates/move-language-server/src/server.rs +++ b/crates/move-language-server/src/server.rs @@ -2,9 +2,7 @@ use std::path::PathBuf; use anyhow::Result; use lsp_server::{Connection, ProtocolError}; -use lsp_types::{ - CompletionOptions, ServerCapabilities, TextDocumentSyncCapability, TextDocumentSyncKind, -}; +use lsp_types::{ServerCapabilities, TextDocumentSyncCapability, TextDocumentSyncKind}; use serde::de::DeserializeOwned; use analysis::config::Config; @@ -12,13 +10,15 @@ use analysis::config::Config; use crate::global_state::initialize_new_global_state; use crate::main_loop; -pub fn initialize_server(connection: &Connection) -> Result { - let server_capabilities = ServerCapabilities { +fn move_language_server_capabilities() -> ServerCapabilities { + ServerCapabilities { text_document_sync: Some(TextDocumentSyncCapability::Kind(TextDocumentSyncKind::Full)), - completion_provider: Some(CompletionOptions::default()), ..ServerCapabilities::default() - }; - connection.initialize(serde_json::to_value(server_capabilities).unwrap()) + } +} + +pub fn initialize_server(connection: &Connection) -> Result { + connection.initialize(serde_json::to_value(move_language_server_capabilities()).unwrap()) } pub fn parse_initialize_params(init_params: serde_json::Value) -> Result<(PathBuf, Config)> { From d3be5a5695df4160d7a36741ef3c98a5cad2d02c Mon Sep 17 00:00:00 2001 From: Maksim Kurnikov Date: Mon, 22 Jun 2020 20:35:11 +0300 Subject: [PATCH 2/6] update deps --- Cargo.lock | 186 ++++++++++++++++++++++++++++++++--------------------- 1 file changed, 112 insertions(+), 74 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 876175fa..ec8ce985 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -57,9 +57,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "0.7.10" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8716408b8bc624ed7f65d223ddb9ac2d044c0547b6fa4b0d554f3a9540496ada" +checksum = "54309d4484cb62a267d4a0826c8c391989e81fa5066abd7a9d07a46f21817cdd" dependencies = [ "memchr", ] @@ -144,9 +144,9 @@ checksum = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" [[package]] name = "base64" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d1ccbaf7d9ec9537465a97bf19edc1a4e158ecb49fc16178202238c569cc42" +checksum = "e223af0dc48c96d4f8342ec01a4974f139df863896b316681efd36742f22cc67" [[package]] name = "bech32" @@ -282,7 +282,7 @@ dependencies = [ "proc-macro2 1.0.18", "quote 1.0.7", "serde_json", - "syn 1.0.31", + "syn 1.0.33", ] [[package]] @@ -337,10 +337,11 @@ checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" [[package]] name = "bytes" -version = "0.5.4" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "130aac562c0dd69c56b3b1cc8ffd2e17be31d0b6c25b61c96b76231aa23e39e1" +checksum = "118cf036fbb97d0816e3c34b2d7a1e8cfc60f68fcf63d550ddbe9bd5f59c213b" dependencies = [ + "loom", "serde", ] @@ -601,13 +602,13 @@ dependencies = [ [[package]] name = "derive_more" -version = "0.99.7" +version = "0.99.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2127768764f1556535c01b5326ef94bd60ff08dcfbdc544d53e69ed155610f5d" +checksum = "bc655351f820d774679da6cdc23355a93de496867d8203496675162e17b1d671" dependencies = [ "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.31", + "syn 1.0.33", ] [[package]] @@ -675,9 +676,9 @@ dependencies = [ [[package]] name = "dtoa" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4358a9e11b9a09cf52383b451b49a169e8d797b68aa02301ff586d70d9661ea3" +checksum = "134951f4028bdadb9b84baf4232681efbf277da25144b9b0ad65df75946c422b" [[package]] name = "ed25519-dalek" @@ -729,7 +730,7 @@ checksum = "1e94aa31f7c0dc764f57896dc615ddd76fc13b0d5dca7eb6cc5e018a5a09ec06" dependencies = [ "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.31", + "syn 1.0.33", ] [[package]] @@ -885,7 +886,7 @@ dependencies = [ "proc-macro-hack", "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.31", + "syn 1.0.33", ] [[package]] @@ -929,6 +930,19 @@ version = "0.3.55" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f5f3913fa0bfe7ee1fd8248b6b9f42a5af4b9d65ec2dd2c3c26132b950ecfc2" +[[package]] +name = "generator" +version = "0.6.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "add72f17bb81521258fcc8a7a3245b1e184e916bfbe34f0ea89558f440df5c68" +dependencies = [ + "cc", + "libc", + "log 0.4.8", + "rustc_version", + "winapi 0.3.8", +] + [[package]] name = "generic-array" version = "0.12.3" @@ -1038,7 +1052,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed18eb2459bf1a09ad2d6b1547840c3e5e62882fa09b9a6a20b1de8e3228848f" dependencies = [ - "base64 0.12.1", + "base64 0.12.2", "bitflags", "bytes", "headers-core", @@ -1183,7 +1197,7 @@ dependencies = [ "proc-macro-hack", "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.31", + "syn 1.0.33", ] [[package]] @@ -1297,9 +1311,9 @@ dependencies = [ [[package]] name = "itoa" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8b7a7c0c47db5545ed3fef7468ee7bb5b74691498139e4b3f6a20685dc6dd8e" +checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6" [[package]] name = "jobserver" @@ -1517,7 +1531,7 @@ dependencies = [ "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.31", + "syn 1.0.33", ] [[package]] @@ -1528,7 +1542,7 @@ dependencies = [ "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git)", "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.31", + "syn 1.0.33", ] [[package]] @@ -1693,7 +1707,7 @@ dependencies = [ "serde", "sha-1", "subtle 2.2.3", - "syn 1.0.31", + "syn 1.0.33", ] [[package]] @@ -1710,7 +1724,7 @@ dependencies = [ "serde", "sha-1", "subtle 2.2.3", - "syn 1.0.31", + "syn 1.0.33", ] [[package]] @@ -1753,11 +1767,22 @@ dependencies = [ "serde", ] +[[package]] +name = "loom" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ecc775857611e1df29abba5c41355cdf540e7e9d4acfdf0f355eefee82330b7" +dependencies = [ + "cfg-if", + "generator", + "scoped-tls 0.1.2", +] + [[package]] name = "lsp-server" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dccec31bfd027ac0dd288a78e19005fd89624d9099456e284b5241316a6c3072" +checksum = "53b4ace8ebe5d2aff3687ce0ed507f6020d6a47a7de2b0d3d664ea237ffb0c62" dependencies = [ "crossbeam-channel", "log 0.4.8", @@ -1771,7 +1796,7 @@ version = "0.74.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b360754e89e0e13c114245131382ba921d4ff1efabb918e549422938aaa8d392" dependencies = [ - "base64 0.12.1", + "base64 0.12.2", "bitflags", "serde", "serde_json", @@ -2274,7 +2299,7 @@ dependencies = [ "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.31", + "syn 1.0.33", ] [[package]] @@ -2358,7 +2383,7 @@ dependencies = [ "pest_meta", "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.31", + "syn 1.0.33", ] [[package]] @@ -2438,7 +2463,7 @@ checksum = "6a0ffd45cf79d88737d7cc85bfd5d2894bee1139b356e616fe85dc389c61aaf7" dependencies = [ "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.31", + "syn 1.0.33", ] [[package]] @@ -2503,7 +2528,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.31", + "syn 1.0.33", "version_check 0.9.2", ] @@ -2515,7 +2540,7 @@ checksum = "4f5444ead4e9935abd7f27dc51f7e852a0569ac888096d5ec2499470794e2e53" dependencies = [ "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.31", + "syn 1.0.33", "syn-mid", "version_check 0.9.2", ] @@ -2802,10 +2827,11 @@ dependencies = [ [[package]] name = "rayon" -version = "1.3.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6ce3297f9c85e16621bb8cca38a06779ffc31bb8184e1be4bed2be4678a098" +checksum = "62f02856753d04e03e26929f820d0a0a337ebe71f849801eea335d464b349080" dependencies = [ + "autocfg 1.0.0", "crossbeam-deque", "either", "rayon-core", @@ -2813,9 +2839,9 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.7.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08a89b46efaf957e52b18062fb2f4660f8b8a4dde1807ca002690868ef2c85a9" +checksum = "e92e15d89083484e11353891f1af602cc661426deb9564c298b270c726973280" dependencies = [ "crossbeam-deque", "crossbeam-queue", @@ -2841,22 +2867,22 @@ checksum = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" [[package]] name = "ref-cast" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a214c7875e1b63fc1618db7c80efc0954f6156c9ff07699fd9039e255accdd1" +checksum = "745c1787167ddae5569661d5ffb8b25ae5fedbf46717eaa92d652221cec72623" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "602eb59cda66fcb9aec25841fb76bc01d2b34282dcdd705028da297db6f3eec8" +checksum = "7d21b475ab879ef0e315ad99067fa25778c3b0377f57f1b00207448dac1a3144" dependencies = [ "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.31", + "syn 1.0.33", ] [[package]] @@ -2879,9 +2905,9 @@ checksum = "26412eb97c6b088a6997e05f69403a802a92d520de2f8e63c2b65f9e0f47c4e8" [[package]] name = "relative-path" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "629a4b40d41677dde754d00bb392d777c80b8716d9271b6e2aa5f6a2b3d4261e" +checksum = "c602122c47b382cd045b10866a084b184035d45d8c2609cdd3762852ddfae2a1" [[package]] name = "remove_dir_all" @@ -2898,7 +2924,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b82c9238b305f26f53443e3a4bc8528d64b8d0bee408ec949eb7bf5635ec680" dependencies = [ - "base64 0.12.1", + "base64 0.12.2", "bytes", "encoding_rs", "futures-core", @@ -2972,6 +2998,12 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "scoped-tls" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "332ffa32bf586782a3efaeb58f127980944bbc8c4d6913a86107ac2a5ab24b28" + [[package]] name = "scoped-tls" version = "1.0.0" @@ -3011,9 +3043,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.112" +version = "1.0.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "736aac72d1eafe8e5962d1d1c3d99b0df526015ba40915cb3c49d042e92ec243" +checksum = "5317f7588f0a5078ee60ef675ef96735a1442132dc645eb1d12c018620ed8cd3" dependencies = [ "serde_derive", ] @@ -3039,13 +3071,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.112" +version = "1.0.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf0343ce212ac0d3d6afd9391ac8e9c9efe06b533c8d33f660f6390cc4093f57" +checksum = "2a0be94b04690fbaed37cddffc5c134bf537c8e3329d53e982fe04c374978f8e" dependencies = [ "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.31", + "syn 1.0.33", ] [[package]] @@ -3061,13 +3093,13 @@ dependencies = [ [[package]] name = "serde_repr" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd02c7587ec314570041b2754829f84d873ced14a96d1fd1823531e11db40573" +checksum = "2dc6b7951b17b051f3210b063f12cc17320e2fe30ae05b0fe2a3abb068551c76" dependencies = [ "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.31", + "syn 1.0.33", ] [[package]] @@ -3245,9 +3277,9 @@ checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" [[package]] name = "structopt" -version = "0.3.14" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "863246aaf5ddd0d6928dfeb1a9ca65f505599e4e1b399935ef7e75107516b4ef" +checksum = "de2f5e239ee807089b62adce73e48c625e0ed80df02c7ab3f068f5db5281065c" dependencies = [ "clap", "lazy_static", @@ -3256,15 +3288,15 @@ dependencies = [ [[package]] name = "structopt-derive" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d239ca4b13aee7a2142e6795cbd69e457665ff8037aed33b3effdc430d2f927a" +checksum = "510413f9de616762a4fbeab62509bf15c729603b72d7cd71280fbca431b1c118" dependencies = [ "heck", "proc-macro-error", "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.31", + "syn 1.0.33", ] [[package]] @@ -3292,9 +3324,9 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.31" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5304cfdf27365b7585c25d4af91b35016ed21ef88f17ced89c7093b43dba8b6" +checksum = "e8d5d96e8cbb005d6959f119f773bfaebb5684296108fb32600c00cde305b2cd" dependencies = [ "proc-macro2 1.0.18", "quote 1.0.7", @@ -3309,7 +3341,7 @@ checksum = "7be3539f6c128a931cf19dcee741c1af532c7fd387baa739c03dd2e96479338a" dependencies = [ "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.31", + "syn 1.0.33", ] [[package]] @@ -3320,7 +3352,7 @@ checksum = "b834f2d66f734cb897113e34aaff2f1ab4719ca946f9a7358dba8f8064148701" dependencies = [ "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.31", + "syn 1.0.33", "unicode-xid 0.2.0", ] @@ -3366,22 +3398,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b13f926965ad00595dd129fa12823b04bbf866e9085ab0a5f2b05b850fbfc344" +checksum = "7dfdd070ccd8ccb78f4ad66bf1982dc37f620ef696c6b5028fe2ed83dd3d0d08" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "893582086c2f98cde18f906265a65b5030a074b1046c674ae898be6519a7f479" +checksum = "bd80fc12f73063ac132ac92aceea36734f04a1d93c1240c6944e23a3b8841793" dependencies = [ "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.31", + "syn 1.0.33", ] [[package]] @@ -3421,6 +3453,12 @@ dependencies = [ "crunchy", ] +[[package]] +name = "tinyvec" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53953d2d3a5ad81d9f844a32f14ebb121f50b650cd59d0ee2a07cf13c617efed" + [[package]] name = "tokio" version = "0.2.21" @@ -3453,7 +3491,7 @@ checksum = "f0c3acc6aa564495a0f2e1d59fab677cd7f81a19994cfc7f3ad0e64301560389" dependencies = [ "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.31", + "syn 1.0.33", ] [[package]] @@ -3613,11 +3651,11 @@ dependencies = [ [[package]] name = "unicode-normalization" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5479532badd04e128284890390c1e876ef7a993d0570b3597ae43dfa1d59afa4" +checksum = "6fb19cf769fa8c6a80a162df694621ebeb4dafb606470b2b2fce0be40a98a977" dependencies = [ - "smallvec", + "tinyvec", ] [[package]] @@ -3668,9 +3706,9 @@ dependencies = [ [[package]] name = "urlencoding" -version = "1.0.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3df3561629a8bb4c57e5a2e4c43348d9e29c7c29d9b1c4c1f47166deca8f37ed" +checksum = "c9232eb53352b4442e40d7900465dfc534e8cb2dc8f18656fcb2ac16112b5593" [[package]] name = "utf-8" @@ -3800,7 +3838,7 @@ dependencies = [ "mime_guess 2.0.3", "multipart", "pin-project", - "scoped-tls", + "scoped-tls 1.0.0", "serde", "serde_json", "serde_urlencoded", @@ -3839,7 +3877,7 @@ dependencies = [ "log 0.4.8", "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.31", + "syn 1.0.33", "wasm-bindgen-shared", ] @@ -3873,7 +3911,7 @@ checksum = "3156052d8ec77142051a533cdd686cba889537b213f948cd1d20869926e68e92" dependencies = [ "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.31", + "syn 1.0.33", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -3983,6 +4021,6 @@ checksum = "de251eec69fc7c1bc3923403d18ececb929380e016afe103da75f396704f8ca2" dependencies = [ "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.31", + "syn 1.0.33", "synstructure", ] From a5f56ead4fcb7954a2afb2b9e108e50c5302b41c Mon Sep 17 00:00:00 2001 From: Maksim Kurnikov Date: Tue, 23 Jun 2020 05:30:27 +0300 Subject: [PATCH 3/6] update to latest libra --- Cargo.lock | 603 ++++++++++++------ crates/analysis/src/analysis.rs | 17 +- crates/dialects/Cargo.toml | 24 +- .../tests/test_compilation_check.rs | 5 +- crates/move-language-server/src/main_loop.rs | 41 +- resources/tests/stdlib/Transaction.move | 5 - 6 files changed, 461 insertions(+), 234 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ec8ce985..62420275 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6,7 +6,16 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4cf01b9b56e767bb57b94ebf91a58b338002963785cdd7013e21c0d4679471e4" dependencies = [ - "generic-array", + "generic-array 0.12.3", +] + +[[package]] +name = "aead" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3672ba0d12aaf256aabcdab516ebed87b5cec4b602316d7a3035fac9b7a9567b" +dependencies = [ + "generic-array 0.14.2", ] [[package]] @@ -15,25 +24,49 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "54eb1d8fe354e5fc611daf4f2ea97dd45a765f4f1e4512306ec183ae2e8f20c9" dependencies = [ - "aes-soft", - "aesni", + "aes-soft 0.3.3", + "aesni 0.6.0", "block-cipher-trait", ] +[[package]] +name = "aes" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7001367fde4c768a19d1029f0a8be5abd9308e1119846d5bd9ad26297b8faf5" +dependencies = [ + "aes-soft 0.4.0", + "aesni 0.7.0", + "block-cipher", +] + [[package]] name = "aes-gcm" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "834a6bda386024dbb7c8fc51322856c10ffe69559f972261c868485f5759c638" dependencies = [ - "aead", - "aes", + "aead 0.2.0", + "aes 0.3.2", "block-cipher-trait", - "ghash", + "ghash 0.2.3", "subtle 2.2.3", "zeroize", ] +[[package]] +name = "aes-gcm" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86f5007801316299f922a6198d1d09a0bae95786815d066d5880d13f7c45ead1" +dependencies = [ + "aead 0.3.1", + "aes 0.4.0", + "block-cipher", + "ghash 0.3.0", + "subtle 2.2.3", +] + [[package]] name = "aes-soft" version = "0.3.3" @@ -45,6 +78,17 @@ dependencies = [ "opaque-debug", ] +[[package]] +name = "aes-soft" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4925647ee64e5056cf231608957ce7c81e12d6d6e316b9ce1404778cc1d35fa7" +dependencies = [ + "block-cipher", + "byteorder", + "opaque-debug", +] + [[package]] name = "aesni" version = "0.6.0" @@ -55,11 +99,21 @@ dependencies = [ "opaque-debug", ] +[[package]] +name = "aesni" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d050d39b0b7688b3a3254394c3e30a9d66c41dcf9b05b0e2dbdc623f6505d264" +dependencies = [ + "block-cipher", + "opaque-debug", +] + [[package]] name = "aho-corasick" -version = "0.7.11" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54309d4484cb62a267d4a0826c8c391989e81fa5066abd7a9d07a46f21817cdd" +checksum = "c259a748ac706ba73d609b73fc13469e128337f9a6b2fb3cc82d100f8dd8d511" dependencies = [ "memchr", ] @@ -184,7 +238,28 @@ dependencies = [ "block-padding", "byte-tools", "byteorder", - "generic-array", + "generic-array 0.12.3", +] + +[[package]] +name = "block-buffer" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbcf92448676f82bb7a334c58bbce8b0d43580fb5362a9d608b18879d12a3d31" +dependencies = [ + "block-padding", + "byte-tools", + "byteorder", + "generic-array 0.14.2", +] + +[[package]] +name = "block-cipher" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa136449e765dc7faa244561ccae839c394048667929af599b5d931ebe7b7f10" +dependencies = [ + "generic-array 0.14.2", ] [[package]] @@ -193,7 +268,7 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c924d49bd09e7c06003acda26cd9742e796e34282ec6c1189404dee0c1f4774" dependencies = [ - "generic-array", + "generic-array 0.12.3", ] [[package]] @@ -208,9 +283,9 @@ dependencies = [ [[package]] name = "borrow-graph" version = "0.0.1" -source = "git+https://github.com/dfinance/libra.git?branch=09.06.2020#cbec1544981ae6466fbaa1a3f2815a026f1028e8" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" dependencies = [ - "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "mirai-annotations", ] @@ -274,7 +349,7 @@ dependencies = [ "build-info-common", "chrono", "format-buf", - "num-bigint", + "num-bigint 0.2.6", "num-traits", "proc-macro-crate", "proc-macro-error", @@ -300,15 +375,15 @@ checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" [[package]] name = "bytecode-source-map" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=09.06.2020#cbec1544981ae6466fbaa1a3f2815a026f1028e8" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" dependencies = [ "anyhow", "codespan 0.8.0", "codespan-reporting 0.8.0", - "libra-canonical-serialization 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "libra-canonical-serialization 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "libra-types", - "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", - "move-core-types 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", + "move-core-types 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "move-ir-types", "serde", "vm", @@ -317,14 +392,14 @@ dependencies = [ [[package]] name = "bytecode-verifier" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=09.06.2020#cbec1544981ae6466fbaa1a3f2815a026f1028e8" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" dependencies = [ "anyhow", "borrow-graph", "libra-types", - "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "mirai-annotations", - "move-core-types 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "move-core-types 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "petgraph", "vm", ] @@ -451,21 +526,39 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "compiled-stdlib" +version = "0.1.0" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" +dependencies = [ + "anyhow", + "bytecode-verifier", + "include_dir", + "libra-canonical-serialization 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", + "libra-crypto 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", + "libra-types", + "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", + "once_cell", + "sha2 0.9.0", + "stdlib", + "vm", +] + [[package]] name = "compiler" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=09.06.2020#cbec1544981ae6466fbaa1a3f2815a026f1028e8" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" dependencies = [ "anyhow", "bytecode-source-map", "bytecode-verifier", + "compiled-stdlib", "ir-to-bytecode", - "libra-canonical-serialization 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "libra-canonical-serialization 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "libra-types", - "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "move-ir-types", "serde_json", - "stdlib", "structopt", "vm", ] @@ -554,17 +647,27 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4434400df11d95d556bac068ddfedd482915eb18fe8bea89bc80b6e4b1c179e5" dependencies = [ - "generic-array", + "generic-array 0.12.3", "subtle 1.0.0", ] +[[package]] +name = "crypto-mac" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" +dependencies = [ + "generic-array 0.14.2", + "subtle 2.2.3", +] + [[package]] name = "curve25519-dalek" version = "2.0.0" source = "git+https://github.com/novifinancial/curve25519-dalek.git?branch=fiat2#05d0dff946fe37679c763fe1bac82890a901e841" dependencies = [ "byteorder", - "digest", + "digest 0.8.1", "fiat-crypto", "rand_core 0.5.1", "subtle 2.2.3", @@ -574,9 +677,9 @@ dependencies = [ [[package]] name = "datatest-stable" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=09.06.2020#cbec1544981ae6466fbaa1a3f2815a026f1028e8" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" dependencies = [ - "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "regex", "structopt", "termcolor", @@ -586,12 +689,12 @@ dependencies = [ [[package]] name = "debug-interface" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=09.06.2020#cbec1544981ae6466fbaa1a3f2815a026f1028e8" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" dependencies = [ "anyhow", "libra-logger", "libra-metrics", - "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "once_cell", "reqwest", "serde", @@ -621,11 +724,11 @@ dependencies = [ "hex", "language-e2e-tests", "lazy_static", - "libra-canonical-serialization 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", - "libra-crypto 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "libra-canonical-serialization 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", + "libra-crypto 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "libra-state-view", "libra-types", - "move-core-types 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "move-core-types 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "move-core-types 0.1.0 (git+https://github.com/dfinance/libra.git)", "move-ir-types", "move-lang", @@ -652,19 +755,28 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" dependencies = [ - "generic-array", + "generic-array 0.12.3", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array 0.14.2", ] [[package]] name = "docgen" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=09.06.2020#cbec1544981ae6466fbaa1a3f2815a026f1028e8" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" dependencies = [ "anyhow", "codespan 0.8.0", "codespan-reporting 0.8.0", "itertools", - "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "log 0.4.8", "num", "once_cell", @@ -689,7 +801,7 @@ dependencies = [ "curve25519-dalek", "rand 0.7.3", "serde", - "sha2", + "sha2 0.8.2", ] [[package]] @@ -952,6 +1064,16 @@ dependencies = [ "typenum", ] +[[package]] +name = "generic-array" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac746a5f3bbfdadd6106868134545e684693d54d9d44f6e9588a7d54af0bf980" +dependencies = [ + "typenum", + "version_check 0.9.2", +] + [[package]] name = "get_if_addrs" version = "0.5.3" @@ -991,7 +1113,16 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f0930ed19a7184089ea46d2fedead2f6dc2b674c5db4276b7da336c7cd83252" dependencies = [ - "polyval", + "polyval 0.3.3", +] + +[[package]] +name = "ghash" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6e27f0689a6e15944bdce7e45425efb87eaa8ab0c6e87f11d0987a9133e2531" +dependencies = [ + "polyval 0.4.0", ] [[package]] @@ -1058,7 +1189,7 @@ dependencies = [ "headers-core", "http", "mime 0.3.16", - "sha-1", + "sha-1 0.8.2", "time", ] @@ -1101,8 +1232,18 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5dcb5e64cda4c23119ab41ba960d1e170a774c8e4b9d9e6a9bc18aabf5e59695" dependencies = [ - "crypto-mac", - "digest", + "crypto-mac 0.7.0", + "digest 0.8.1", +] + +[[package]] +name = "hmac" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b87b580bd66811cc2324a27f3587de707cacf7525b96dca8122f7493e6cce0da" +dependencies = [ + "crypto-mac 0.8.0", + "digest 0.9.0", ] [[package]] @@ -1270,7 +1411,7 @@ dependencies = [ [[package]] name = "ir-to-bytecode" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=09.06.2020#cbec1544981ae6466fbaa1a3f2815a026f1028e8" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" dependencies = [ "anyhow", "bytecode-source-map", @@ -1278,9 +1419,9 @@ dependencies = [ "codespan-reporting 0.8.0", "ir-to-bytecode-syntax", "libra-types", - "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "log 0.4.8", - "move-core-types 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "move-core-types 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "move-ir-types", "thiserror", "vm", @@ -1289,14 +1430,14 @@ dependencies = [ [[package]] name = "ir-to-bytecode-syntax" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=09.06.2020#cbec1544981ae6466fbaa1a3f2815a026f1028e8" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" dependencies = [ "anyhow", "codespan 0.8.0", "hex", "libra-types", - "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", - "move-core-types 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", + "move-core-types 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "move-ir-types", ] @@ -1358,21 +1499,22 @@ dependencies = [ [[package]] name = "language-e2e-tests" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=09.06.2020#cbec1544981ae6466fbaa1a3f2815a026f1028e8" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" dependencies = [ "anyhow", "bytecode-verifier", + "compiled-stdlib", "compiler", - "libra-canonical-serialization 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "libra-canonical-serialization 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "libra-config", - "libra-crypto 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "libra-crypto 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "libra-logger", "libra-proptest-helpers", "libra-state-view", "libra-types", "libra-vm", - "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", - "move-core-types 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", + "move-core-types 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "move-vm-natives", "move-vm-runtime", "move-vm-types", @@ -1380,7 +1522,6 @@ dependencies = [ "proptest", "proptest-derive", "rand 0.7.3", - "stdlib", "transaction-builder", "vm", "vm-genesis", @@ -1419,9 +1560,9 @@ dependencies = [ [[package]] name = "libra-canonical-serialization" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=09.06.2020#cbec1544981ae6466fbaa1a3f2815a026f1028e8" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" dependencies = [ - "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "serde", "thiserror", ] @@ -1439,43 +1580,43 @@ dependencies = [ [[package]] name = "libra-config" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=09.06.2020#cbec1544981ae6466fbaa1a3f2815a026f1028e8" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" dependencies = [ "anyhow", "get_if_addrs", - "libra-canonical-serialization 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", - "libra-crypto 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", - "libra-crypto-derive 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "libra-canonical-serialization 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", + "libra-crypto 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", + "libra-crypto-derive 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "libra-logger", "libra-network-address", "libra-temppath", "libra-types", - "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "log 0.4.8", "mirai-annotations", "rand 0.7.3", "serde", + "serde_yaml", "thiserror", - "toml", ] [[package]] name = "libra-crypto" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=09.06.2020#cbec1544981ae6466fbaa1a3f2815a026f1028e8" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" dependencies = [ - "aes-gcm", + "aes-gcm 0.6.0", "anyhow", "bytes", "curve25519-dalek", - "digest", + "digest 0.9.0", "ed25519-dalek", "hex", - "hmac", - "libra-canonical-serialization 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", - "libra-crypto-derive 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", - "libra-nibble 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", - "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "hmac 0.8.0", + "libra-canonical-serialization 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", + "libra-crypto-derive 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", + "libra-nibble 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", + "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "mirai-annotations", "once_cell", "proptest", @@ -1485,8 +1626,8 @@ dependencies = [ "serde", "serde-name", "serde_bytes", - "sha2", - "sha3", + "sha2 0.9.0", + "sha3 0.9.0", "thiserror", "tiny-keccak", "x25519-dalek", @@ -1497,14 +1638,14 @@ name = "libra-crypto" version = "0.1.0" source = "git+https://github.com/dfinance/libra.git#0426d5b8c4388edbcdf72009de8c3f0b695f520d" dependencies = [ - "aes-gcm", + "aes-gcm 0.5.0", "anyhow", "bytes", "curve25519-dalek", - "digest", + "digest 0.8.1", "ed25519-dalek", "hex", - "hmac", + "hmac 0.7.1", "libra-canonical-serialization 0.1.0 (git+https://github.com/dfinance/libra.git)", "libra-crypto-derive 0.1.0 (git+https://github.com/dfinance/libra.git)", "libra-nibble 0.1.0 (git+https://github.com/dfinance/libra.git)", @@ -1516,8 +1657,8 @@ dependencies = [ "serde", "serde-name", "serde_bytes", - "sha2", - "sha3", + "sha2 0.8.2", + "sha3 0.8.2", "thiserror", "tiny-keccak", "x25519-dalek", @@ -1526,9 +1667,9 @@ dependencies = [ [[package]] name = "libra-crypto-derive" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=09.06.2020#cbec1544981ae6466fbaa1a3f2815a026f1028e8" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" dependencies = [ - "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "proc-macro2 1.0.18", "quote 1.0.7", "syn 1.0.33", @@ -1548,11 +1689,11 @@ dependencies = [ [[package]] name = "libra-logger" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=09.06.2020#cbec1544981ae6466fbaa1a3f2815a026f1028e8" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" dependencies = [ "chrono", "env_logger", - "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "log 0.4.8", "once_cell", "serde", @@ -1562,13 +1703,13 @@ dependencies = [ [[package]] name = "libra-metrics" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=09.06.2020#cbec1544981ae6466fbaa1a3f2815a026f1028e8" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" dependencies = [ "anyhow", "futures", "hyper", "libra-logger", - "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "once_cell", "prometheus", "serde_json", @@ -1578,11 +1719,11 @@ dependencies = [ [[package]] name = "libra-network-address" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=09.06.2020#cbec1544981ae6466fbaa1a3f2815a026f1028e8" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" dependencies = [ - "libra-canonical-serialization 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", - "libra-crypto 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", - "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "libra-canonical-serialization 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", + "libra-crypto 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", + "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "proptest", "proptest-derive", "serde", @@ -1593,9 +1734,9 @@ dependencies = [ [[package]] name = "libra-nibble" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=09.06.2020#cbec1544981ae6466fbaa1a3f2815a026f1028e8" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" dependencies = [ - "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "serde", ] @@ -1611,10 +1752,10 @@ dependencies = [ [[package]] name = "libra-proptest-helpers" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=09.06.2020#cbec1544981ae6466fbaa1a3f2815a026f1028e8" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" dependencies = [ "crossbeam", - "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "proptest", "proptest-derive", ] @@ -1622,27 +1763,27 @@ dependencies = [ [[package]] name = "libra-state-view" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=09.06.2020#cbec1544981ae6466fbaa1a3f2815a026f1028e8" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" dependencies = [ "anyhow", "libra-types", - "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", ] [[package]] name = "libra-temppath" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=09.06.2020#cbec1544981ae6466fbaa1a3f2815a026f1028e8" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" dependencies = [ "hex", - "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "rand 0.7.3", ] [[package]] name = "libra-types" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=09.06.2020#cbec1544981ae6466fbaa1a3f2815a026f1028e8" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" dependencies = [ "anyhow", "bytes", @@ -1650,14 +1791,14 @@ dependencies = [ "enum-iterator", "hex", "itertools", - "libra-canonical-serialization 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", - "libra-crypto 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", - "libra-crypto-derive 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "libra-canonical-serialization 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", + "libra-crypto 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", + "libra-crypto-derive 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "libra-network-address", "libra-proptest-helpers", - "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "mirai-annotations", - "move-core-types 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "move-core-types 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "once_cell", "proptest", "proptest-derive", @@ -1672,18 +1813,18 @@ dependencies = [ [[package]] name = "libra-vm" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=09.06.2020#cbec1544981ae6466fbaa1a3f2815a026f1028e8" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" dependencies = [ "debug-interface", - "libra-canonical-serialization 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", - "libra-crypto 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "libra-canonical-serialization 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", + "libra-crypto 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "libra-logger", "libra-metrics", "libra-state-view", "libra-types", - "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "mirai-annotations", - "move-core-types 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "move-core-types 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "move-vm-runtime", "move-vm-types", "once_cell", @@ -1696,7 +1837,7 @@ dependencies = [ [[package]] name = "libra-workspace-hack" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=09.06.2020#cbec1544981ae6466fbaa1a3f2815a026f1028e8" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" dependencies = [ "bytes", "cc", @@ -1705,7 +1846,7 @@ dependencies = [ "num-traits", "petgraph", "serde", - "sha-1", + "sha-1 0.9.0", "subtle 2.2.3", "syn 1.0.33", ] @@ -1722,7 +1863,7 @@ dependencies = [ "num-traits", "petgraph", "serde", - "sha-1", + "sha-1 0.8.2", "subtle 2.2.3", "syn 1.0.33", ] @@ -1739,6 +1880,12 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "linked-hash-map" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8dd5a6d5999d9907cda8ed67bbd137d3af8085216c2ac62de5be860bd41f304a" + [[package]] name = "lock_api" version = "0.3.4" @@ -1959,14 +2106,14 @@ checksum = "258c143ddb5105becc4834f66d0b0ad3d3205d07cb3efc3236f33f623dd07b16" [[package]] name = "move-core-types" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=09.06.2020#cbec1544981ae6466fbaa1a3f2815a026f1028e8" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" dependencies = [ "anyhow", "hex", - "libra-canonical-serialization 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", - "libra-crypto 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", - "libra-crypto-derive 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", - "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "libra-canonical-serialization 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", + "libra-crypto 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", + "libra-crypto-derive 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", + "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "mirai-annotations", "proptest", "proptest-derive", @@ -2009,14 +2156,14 @@ dependencies = [ [[package]] name = "move-ir-types" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=09.06.2020#cbec1544981ae6466fbaa1a3f2815a026f1028e8" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" dependencies = [ "anyhow", "codespan 0.8.0", "hex", "libra-types", - "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", - "move-core-types 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", + "move-core-types 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "once_cell", "serde", ] @@ -2024,7 +2171,7 @@ dependencies = [ [[package]] name = "move-lang" version = "0.0.1" -source = "git+https://github.com/dfinance/libra.git?branch=09.06.2020#cbec1544981ae6466fbaa1a3f2815a026f1028e8" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" dependencies = [ "anyhow", "borrow-graph", @@ -2037,9 +2184,9 @@ dependencies = [ "difference", "hex", "ir-to-bytecode", - "libra-canonical-serialization 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "libra-canonical-serialization 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "libra-types", - "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "move-ir-types", "petgraph", "regex", @@ -2078,7 +2225,7 @@ dependencies = [ [[package]] name = "move-prover" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=09.06.2020#cbec1544981ae6466fbaa1a3f2815a026f1028e8" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" dependencies = [ "anyhow", "bytecode-source-map", @@ -2090,7 +2237,7 @@ dependencies = [ "itertools", "libra-temppath", "libra-types", - "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "log 0.4.8", "move-ir-types", "move-lang", @@ -2109,18 +2256,19 @@ dependencies = [ [[package]] name = "move-vm-natives" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=09.06.2020#cbec1544981ae6466fbaa1a3f2815a026f1028e8" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" dependencies = [ "bit-vec", "byteorder", - "libra-crypto 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "libra-crypto 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "libra-types", - "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "mirai-annotations", - "move-core-types 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "move-core-types 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "move-vm-types", "once_cell", - "sha2", + "rand 0.7.3", + "sha2 0.9.0", "twox-hash", "vm", ] @@ -2128,15 +2276,15 @@ dependencies = [ [[package]] name = "move-vm-runtime" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=09.06.2020#cbec1544981ae6466fbaa1a3f2815a026f1028e8" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" dependencies = [ "bytecode-verifier", - "libra-crypto 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "libra-crypto 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "libra-logger", "libra-types", - "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "mirai-annotations", - "move-core-types 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "move-core-types 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "move-vm-natives", "move-vm-types", "once_cell", @@ -2146,18 +2294,18 @@ dependencies = [ [[package]] name = "move-vm-types" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=09.06.2020#cbec1544981ae6466fbaa1a3f2815a026f1028e8" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" dependencies = [ - "libra-canonical-serialization 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", - "libra-crypto 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "libra-canonical-serialization 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", + "libra-crypto 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "libra-state-view", "libra-types", - "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "mirai-annotations", - "move-core-types 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "move-core-types 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "once_cell", "serde", - "sha2", + "sha2 0.9.0", "vm", ] @@ -2216,11 +2364,11 @@ dependencies = [ [[package]] name = "num" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8536030f9fea7127f841b45bb6243b27255787fb4eb83958aa1ef9d2fdc0c36" +checksum = "ab3e176191bc4faad357e3122c4747aa098ac880e88b168f106386128736cf4a" dependencies = [ - "num-bigint", + "num-bigint 0.3.0", "num-complex", "num-integer", "num-iter", @@ -2240,12 +2388,22 @@ dependencies = [ ] [[package]] -name = "num-complex" -version = "0.2.4" +name = "num-bigint" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6b19411a9719e753aff12e5187b74d60d3dc449ec3f4dc21e3989c3f554bc95" +checksum = "b7f3fc75e3697059fb1bc465e3d8cca6cf92f56854f201158b3f9c77d5a3cfa0" dependencies = [ "autocfg 1.0.0", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-complex" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b05ad05bd8977050b171b3f6b48175fea6e0565b7981059b486075e1026a9fb5" +dependencies = [ "num-traits", ] @@ -2272,12 +2430,12 @@ dependencies = [ [[package]] name = "num-rational" -version = "0.2.4" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c000134b5dbf44adc5cb772486d335293351644b801551abe8f75c84cfa4aef" +checksum = "a5b4d7360f362cfb50dde8143501e6940b22f644be75a4cc90b2d81968908138" dependencies = [ "autocfg 1.0.0", - "num-bigint", + "num-bigint 0.3.0", "num-integer", "num-traits", ] @@ -2294,9 +2452,9 @@ dependencies = [ [[package]] name = "num-variants" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=09.06.2020#cbec1544981ae6466fbaa1a3f2815a026f1028e8" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" dependencies = [ - "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "proc-macro2 1.0.18", "quote 1.0.7", "syn 1.0.33", @@ -2394,7 +2552,7 @@ checksum = "54be6e404f5317079812fc8f9f5279de376d8856929e21c184ecf6bbd692a11d" dependencies = [ "maplit", "pest", - "sha-1", + "sha-1 0.8.2", ] [[package]] @@ -2491,7 +2649,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ec3341498978de3bfd12d1b22f1af1de22818f5473a11e8a6ef997989e3a212" dependencies = [ "cfg-if", - "universal-hash", + "universal-hash 0.3.0", +] + +[[package]] +name = "polyval" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9a50142b55ab3ed0e9f68dfb3709f1d90d29da24e91033f28b96330643107dc" +dependencies = [ + "cfg-if", + "universal-hash 0.4.0", ] [[package]] @@ -3114,14 +3282,38 @@ dependencies = [ "url", ] +[[package]] +name = "serde_yaml" +version = "0.8.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3e2dd40a7cdc18ca80db804b7f461a39bb721160a85c9a1fa30134bf3c02a5" +dependencies = [ + "dtoa", + "linked-hash-map", + "serde", + "yaml-rust", +] + [[package]] name = "sha-1" version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7d94d0bede923b3cea61f3f1ff57ff8cdfd77b400fb8f9998949e0cf04163df" dependencies = [ - "block-buffer", - "digest", + "block-buffer 0.7.3", + "digest 0.8.1", + "fake-simd", + "opaque-debug", +] + +[[package]] +name = "sha-1" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59520a294fcfdaff2ce8276dc1bdc6170b97abe8043560f70178222e611242fc" +dependencies = [ + "block-buffer 0.8.0", + "digest 0.9.0", "fake-simd", "opaque-debug", ] @@ -3132,8 +3324,20 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69" dependencies = [ - "block-buffer", - "digest", + "block-buffer 0.7.3", + "digest 0.8.1", + "fake-simd", + "opaque-debug", +] + +[[package]] +name = "sha2" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72377440080fd008550fe9b441e854e43318db116f90181eef92e9ae9aedab48" +dependencies = [ + "block-buffer 0.8.0", + "digest 0.9.0", "fake-simd", "opaque-debug", ] @@ -3144,9 +3348,22 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd26bc0e7a2e3a7c959bc494caf58b72ee0c71d67704e9520f736ca7e4853ecf" dependencies = [ - "block-buffer", + "block-buffer 0.7.3", "byte-tools", - "digest", + "digest 0.8.1", + "keccak", + "opaque-debug", +] + +[[package]] +name = "sha3" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b859cf80317bb4ab6b29422f3d77de357ef60a0e0b3dedf28469d2b11d098968" +dependencies = [ + "block-buffer 0.8.0", + "byte-tools", + "digest 0.9.0", "keccak", "opaque-debug", ] @@ -3205,7 +3422,7 @@ dependencies = [ [[package]] name = "spec-lang" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=09.06.2020#cbec1544981ae6466fbaa1a3f2815a026f1028e8" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" dependencies = [ "anyhow", "bytecode-source-map", @@ -3214,9 +3431,9 @@ dependencies = [ "codespan-reporting 0.8.0", "itertools", "libra-types", - "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "log 0.4.8", - "move-core-types 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "move-core-types 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "move-ir-types", "move-lang", "num", @@ -3233,15 +3450,15 @@ checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] name = "stackless-bytecode-generator" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=09.06.2020#cbec1544981ae6466fbaa1a3f2815a026f1028e8" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" dependencies = [ "borrow-graph", "bytecode-verifier", "ir-to-bytecode", "itertools", "libra-types", - "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", - "move-core-types 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", + "move-core-types 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "num", "spec-lang", "vm", @@ -3250,22 +3467,21 @@ dependencies = [ [[package]] name = "stdlib" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=09.06.2020#cbec1544981ae6466fbaa1a3f2815a026f1028e8" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" dependencies = [ "anyhow", "bytecode-verifier", "clap", "datatest-stable", - "include_dir", - "libra-canonical-serialization 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", - "libra-crypto 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "libra-canonical-serialization 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", + "libra-crypto 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "libra-types", - "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "log 0.4.8", "move-lang", "move-prover", - "once_cell", "rayon", + "sha2 0.9.0", "vm", ] @@ -3539,15 +3755,15 @@ checksum = "e987b6bf443f4b5b3b6f38704195592cca41c5bb7aedd3c3693c7081f8289860" [[package]] name = "transaction-builder" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=09.06.2020#cbec1544981ae6466fbaa1a3f2815a026f1028e8" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" dependencies = [ - "libra-canonical-serialization 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "compiled-stdlib", + "libra-canonical-serialization 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "libra-config", "libra-types", - "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "mirai-annotations", - "move-core-types 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", - "stdlib", + "move-core-types 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "vm", ] @@ -3581,7 +3797,7 @@ dependencies = [ "input_buffer", "log 0.4.8", "rand 0.7.3", - "sha-1", + "sha-1 0.8.2", "url", "utf-8", ] @@ -3688,7 +3904,17 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df0c900f2f9b4116803415878ff48b63da9edb268668e08cf9292d7503114a01" dependencies = [ - "generic-array", + "generic-array 0.12.3", + "subtle 2.2.3", +] + +[[package]] +name = "universal-hash" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8326b2c654932e3e4f9196e69d08fdf7cfd718e1dc6f66b347e6024a0c961402" +dependencies = [ + "generic-array 0.14.2", "subtle 2.2.3", ] @@ -3753,15 +3979,15 @@ checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" [[package]] name = "vm" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=09.06.2020#cbec1544981ae6466fbaa1a3f2815a026f1028e8" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" dependencies = [ "anyhow", "byteorder", - "libra-crypto 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "libra-crypto 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "libra-types", - "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "mirai-annotations", - "move-core-types 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "move-core-types 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "num-variants", "once_cell", "ref-cast", @@ -3770,24 +3996,24 @@ dependencies = [ [[package]] name = "vm-genesis" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=09.06.2020#cbec1544981ae6466fbaa1a3f2815a026f1028e8" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" dependencies = [ "anyhow", "bytecode-verifier", - "libra-canonical-serialization 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "compiled-stdlib", + "libra-canonical-serialization 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "libra-config", - "libra-crypto 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "libra-crypto 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "libra-network-address", "libra-state-view", "libra-types", "libra-vm", - "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", - "move-core-types 0.1.0 (git+https://github.com/dfinance/libra.git?branch=09.06.2020)", + "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", + "move-core-types 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "move-vm-runtime", "move-vm-types", "once_cell", "rand 0.7.3", - "stdlib", "transaction-builder", "vm", ] @@ -4004,6 +4230,15 @@ dependencies = [ "zeroize", ] +[[package]] +name = "yaml-rust" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39f0c922f1a334134dc2f7a8b67dc5d25f0735263feec974345ff706bcf20b0d" +dependencies = [ + "linked-hash-map", +] + [[package]] name = "zeroize" version = "1.1.0" diff --git a/crates/analysis/src/analysis.rs b/crates/analysis/src/analysis.rs index 12ecf2d7..6264111a 100644 --- a/crates/analysis/src/analysis.rs +++ b/crates/analysis/src/analysis.rs @@ -74,13 +74,16 @@ impl Analysis { .map_err(|errors| { errors .into_iter() - .filter_map(|err| match self.db.compiler_error_into_diagnostic(err) { - Ok(d) => Some(d), - Err(err) => { - log::error!("{}", err); - None - } - }) + .map( + |err| match self.db.compiler_error_into_diagnostic(err.clone()) { + Ok(d) => d, + Err(error) => panic!( + "While converting {:#?} into Diagnostic, error occurred: {:?}", + err, + error.to_string() + ), + }, + ) .collect() }) } diff --git a/crates/dialects/Cargo.toml b/crates/dialects/Cargo.toml index 13fc4621..344db881 100644 --- a/crates/dialects/Cargo.toml +++ b/crates/dialects/Cargo.toml @@ -21,17 +21,17 @@ bech32 = "0.7.2" utils = { path = "../utils" } -move-vm-runtime = { git = "https://github.com/dfinance/libra.git", branch = "09.06.2020" } -move-vm-types = { git = "https://github.com/dfinance/libra.git", branch = "09.06.2020" } -libra-state-view = { git = "https://github.com/dfinance/libra.git", branch = "09.06.2020" } -language-e2e-tests = { git = "https://github.com/dfinance/libra.git", branch = "09.06.2020" } -move-core-types = { git = "https://github.com/dfinance/libra.git", branch = "09.06.2020" } -vm = { git = "https://github.com/dfinance/libra.git", branch = "09.06.2020" } -libra-types = { git = "https://github.com/dfinance/libra.git", branch = "09.06.2020" } -move-lang = { git = "https://github.com/dfinance/libra.git", branch = "09.06.2020" } -libra-canonical-serialization = { git = "https://github.com/dfinance/libra.git", branch = "09.06.2020" } -libra-crypto = { git = "https://github.com/dfinance/libra.git", branch = "09.06.2020" } -move-ir-types = { git = "https://github.com/dfinance/libra.git", branch = "09.06.2020" } -vm-genesis = { git = "https://github.com/dfinance/libra.git", branch = "09.06.2020" } +move-vm-runtime = { git = "https://github.com/dfinance/libra.git", branch = "16.06.2020" } +move-vm-types = { git = "https://github.com/dfinance/libra.git", branch = "16.06.2020" } +libra-state-view = { git = "https://github.com/dfinance/libra.git", branch = "16.06.2020" } +language-e2e-tests = { git = "https://github.com/dfinance/libra.git", branch = "16.06.2020" } +move-core-types = { git = "https://github.com/dfinance/libra.git", branch = "16.06.2020" } +vm = { git = "https://github.com/dfinance/libra.git", branch = "16.06.2020" } +libra-types = { git = "https://github.com/dfinance/libra.git", branch = "16.06.2020" } +move-lang = { git = "https://github.com/dfinance/libra.git", branch = "16.06.2020" } +libra-canonical-serialization = { git = "https://github.com/dfinance/libra.git", branch = "16.06.2020" } +libra-crypto = { git = "https://github.com/dfinance/libra.git", branch = "16.06.2020" } +move-ir-types = { git = "https://github.com/dfinance/libra.git", branch = "16.06.2020" } +vm-genesis = { git = "https://github.com/dfinance/libra.git", branch = "16.06.2020" } libra-move-core-types = { package = "move-core-types", git = "https://github.com/dfinance/libra.git", branch = "master" } diff --git a/crates/integration_tests/tests/test_compilation_check.rs b/crates/integration_tests/tests/test_compilation_check.rs index 1c3c6a45..c51f4afe 100644 --- a/crates/integration_tests/tests/test_compilation_check.rs +++ b/crates/integration_tests/tests/test_compilation_check.rs @@ -9,7 +9,6 @@ use move_language_server::global_state::initialize_new_global_state; use crossbeam_channel::unbounded; use move_language_server::main_loop::{compute_file_diagnostics, Task}; -use threadpool::ThreadPool; use utils::{leaked_fpath, MoveFile, MoveFilePath}; fn range(start: (u64, u64), end: (u64, u64)) -> Range { @@ -35,11 +34,9 @@ fn diagnostics_with_config_and_filename( fpath: MoveFilePath, ) -> Vec { let state_snapshot = global_state_snapshot((fpath, text.to_string()), config, vec![]); - let pool = ThreadPool::new(1); let (task_sender, task_receiver) = unbounded::(); - compute_file_diagnostics(&pool, state_snapshot.analysis, task_sender, vec![fpath]); - pool.join(); + compute_file_diagnostics(state_snapshot.analysis, task_sender, vec![fpath]); let task = task_receiver.try_recv().unwrap(); let mut ds = match task { diff --git a/crates/move-language-server/src/main_loop.rs b/crates/move-language-server/src/main_loop.rs index 0e95fac9..c5b2bfcc 100644 --- a/crates/move-language-server/src/main_loop.rs +++ b/crates/move-language-server/src/main_loop.rs @@ -207,7 +207,9 @@ pub fn loop_turn( files.extend(loop_state.opened_files.files()); files.extend(analysis.db().module_files().keys()); - compute_file_diagnostics(pool, analysis, task_sender.clone(), files); + let cloned_task_sender = task_sender.clone(); + pool.execute(move || compute_file_diagnostics(analysis, cloned_task_sender, files)); + // compute_file_diagnostics(pool, analysis, task_sender.clone(), files); } Ok(()) } @@ -361,33 +363,28 @@ fn on_notification( } pub fn compute_file_diagnostics( - pool: &ThreadPool, analysis: Analysis, task_sender: Sender, files: Vec, ) { - pool.execute(move || { - log::info!("Computing diagnostics for files: {:#?}", files); - let mut diagnostics = vec![]; - for fpath in files { - // clear previous diagnostics for file - diagnostics.push(FileDiagnostic::new_empty(fpath)); - - let text = match analysis.db().available_files.get(fpath) { - Some(text) => text, - None => { - log::warn!("Trying to check untracked file: {:?}", fpath); - continue; - } - }; - // let from_file_compile_check = analysis.check_file_with_compiler(fpath, text); - if let Some(d) = analysis.check_file_with_compiler(fpath, text) { - diagnostics.push(d); + log::info!("Computing diagnostics for files: {:#?}", files); + let mut diagnostics = vec![]; + for fpath in files { + // clear previous diagnostics for file + diagnostics.push(FileDiagnostic::new_empty(fpath)); + + let text = match analysis.db().available_files.get(fpath) { + Some(text) => text, + None => { + log::warn!("Trying to check untracked file: {:?}", fpath); + continue; } - // diagnostics.extend(from_file_compile_check); + }; + if let Some(d) = analysis.check_file_with_compiler(fpath, text) { + diagnostics.push(d); } - task_sender.send(Task::Diagnostic(diagnostics)).unwrap(); - }) + } + task_sender.send(Task::Diagnostic(diagnostics)).unwrap(); } pub fn notification_cast(notification: Notification) -> Result diff --git a/resources/tests/stdlib/Transaction.move b/resources/tests/stdlib/Transaction.move index 1dece787..a901e358 100644 --- a/resources/tests/stdlib/Transaction.move +++ b/resources/tests/stdlib/Transaction.move @@ -7,10 +7,5 @@ module Transaction { native public fun sender(): address; native public fun sequence_number(): u64; native public fun public_key(): vector; - - // inlined - public fun assert(check: bool, code: u64) { - if (check) () else abort code - } } } From 95ad6be44f6f9140364b536f9a36a1704e9697d8 Mon Sep 17 00:00:00 2001 From: Maksim Kurnikov Date: Tue, 23 Jun 2020 13:01:41 +0300 Subject: [PATCH 4/6] fix compilation tests for new libra --- crates/analysis/src/config.rs | 2 +- crates/integration_tests/src/lib.rs | 29 ++++-- .../tests/test_compilation_check.rs | 89 +++++++------------ .../integration_tests/tests/test_executor.rs | 84 ++++------------- crates/integration_tests/tests/test_lsp.rs | 4 +- resources/tests/modules/covid_tracker.move | 23 ----- resources/tests/modules/record.move | 32 +++++++ resources/tests/stdlib/Event.move | 73 --------------- resources/tests/stdlib/Transaction.move | 11 --- resources/tests/stdlib/coins.move | 2 +- resources/tests/stdlib/debug.move | 4 +- resources/tests/stdlib/event.move | 9 ++ resources/tests/stdlib/{LCS.move => lcs.move} | 11 +-- resources/tests/stdlib/oracle.move | 2 +- .../tests/stdlib/{Signer.move => signer.move} | 2 +- .../tests/stdlib/{Vector.move => vector.move} | 56 +----------- 16 files changed, 126 insertions(+), 307 deletions(-) delete mode 100644 resources/tests/modules/covid_tracker.move create mode 100644 resources/tests/modules/record.move delete mode 100644 resources/tests/stdlib/Event.move delete mode 100644 resources/tests/stdlib/Transaction.move create mode 100644 resources/tests/stdlib/event.move rename resources/tests/stdlib/{LCS.move => lcs.move} (63%) rename resources/tests/stdlib/{Signer.move => signer.move} (97%) rename resources/tests/stdlib/{Vector.move => vector.move} (71%) diff --git a/crates/analysis/src/config.rs b/crates/analysis/src/config.rs index d2ec186e..2e3ad29c 100644 --- a/crates/analysis/src/config.rs +++ b/crates/analysis/src/config.rs @@ -37,7 +37,7 @@ impl Default for Config { modules_folders: vec![], sender_address: DialectName::Libra .get_dialect() - .normalize_account_address("0x0") + .normalize_account_address("0x1") .unwrap(), } } diff --git a/crates/integration_tests/src/lib.rs b/crates/integration_tests/src/lib.rs index d934a2a5..d2fefcfd 100644 --- a/crates/integration_tests/src/lib.rs +++ b/crates/integration_tests/src/lib.rs @@ -3,26 +3,26 @@ use analysis::config::Config; use move_language_server::global_state::{initialize_new_global_state, GlobalStateSnapshot}; use std::path::PathBuf; use utils::io::read_move_files; -use utils::{leaked_fpath, MoveFile, MoveFilePath}; +use utils::{leaked_fpath, MoveFile, MoveFilePath, io}; pub fn get_script_path() -> MoveFilePath { leaked_fpath(get_modules_path().join("script.move")) } // just need some valid fname -pub fn existing_file_abspath() -> MoveFilePath { +pub fn existing_module_file_abspath() -> MoveFilePath { let abspath = std::env::current_dir() .unwrap() .join("resources") .join("modules") - .join("covid_tracker.move") + .join("record.move") .into_os_string() .into_string() .unwrap(); leaked_fpath(&abspath) } -pub fn get_resources_dir() -> PathBuf { +pub fn get_test_resources_dir() -> PathBuf { std::env::current_dir() .unwrap() .parent() // crates/ @@ -34,11 +34,11 @@ pub fn get_resources_dir() -> PathBuf { } pub fn get_stdlib_path() -> PathBuf { - get_resources_dir().join("stdlib") + get_test_resources_dir().join("stdlib") } pub fn get_modules_path() -> PathBuf { - get_resources_dir().join("modules") + get_test_resources_dir().join("modules") } pub fn setup_test_logging() { @@ -87,3 +87,20 @@ macro_rules! config { config }}; } + + +pub fn stdlib_mod(name: &str) -> MoveFile { + io::load_move_file(get_stdlib_path().join(name)).unwrap() +} + +pub fn modules_mod(name: &str) -> MoveFile { + io::load_move_file(get_modules_path().join(name)).unwrap() +} + +pub fn stdlib_transaction_mod() -> MoveFile { + stdlib_mod("Transaction.move") +} + +pub fn record_mod() -> MoveFile { + io::load_move_file(get_modules_path().join("record.move")).unwrap() +} diff --git a/crates/integration_tests/tests/test_compilation_check.rs b/crates/integration_tests/tests/test_compilation_check.rs index c51f4afe..685e666c 100644 --- a/crates/integration_tests/tests/test_compilation_check.rs +++ b/crates/integration_tests/tests/test_compilation_check.rs @@ -4,7 +4,7 @@ use analysis::analysis::Analysis; use analysis::change::AnalysisChange; use analysis::config::Config; use analysis::db::FileDiagnostic; -use integration_tests::{get_modules_path, get_resources_dir, global_state_snapshot}; +use integration_tests::{get_modules_path, get_test_resources_dir, global_state_snapshot}; use move_language_server::global_state::initialize_new_global_state; use crossbeam_channel::unbounded; @@ -23,7 +23,7 @@ fn diagnostics_with_config(text: &str, config: Config) -> Vec { let loc_ds = diagnostics_with_config_and_filename( text, config, - leaked_fpath(get_resources_dir().join("some_script.move")), + leaked_fpath(get_test_resources_dir().join("some_script.move")), ); loc_ds.into_iter().filter_map(|d| d.diagnostic).collect() } @@ -80,9 +80,7 @@ mod tests { use super::*; use analysis::db::RootDatabase; - use integration_tests::{ - config, get_modules_path, get_script_path, get_stdlib_path, setup_test_logging, - }; + use integration_tests::{config, get_modules_path, get_script_path, get_stdlib_path, modules_mod}; use utils::{leaked_fpath, FilesSourceText}; #[test] @@ -200,10 +198,10 @@ module M { fn test_stdlib_modules_are_available_if_loaded() { let source_text = r" module MyModule { - use 0x0::Transaction; + use 0x1::Signer; - public fun how_main(_country: u8) { - let _ = Transaction::sender(); + public fun how_main(s: &signer) { + let _ = Signer::address_of(s); } } "; @@ -215,12 +213,15 @@ module MyModule { #[test] fn test_compile_check_script_with_additional_dependencies() { // hardcoded sender address - setup_test_logging(); let script_source_text = r" script { - use 0x8572f83cee01047effd6e7d0b5c19743::CovidTracker; - fun main() { - CovidTracker::how_many(5); + use 0x1::Signer; + use 0x2::Record; + + fun main(s: &signer) { + let signer_address = Signer::address_of(s); + let record = Record::get_record(signer_address); + Record::save(record); } } "; @@ -236,44 +237,16 @@ script { #[test] fn test_compile_check_module_from_a_folder_with_folder_provided_as_dependencies() { - let module_source_text = r" -module CovidTracker { - use 0x0::Vector; - use 0x0::Transaction; - struct NewsReport { - news_source_id: u64, - infected_count: u64, - } - resource struct CovidSituation { - country_id: u8, - reports: vector - } - public fun how_many(_country: u8): u64 acquires CovidSituation { - let case = borrow_global(Transaction::sender()); - let len = Vector::length(&case.reports); - let sum = 0u64; - let i = 0; - while (i < len) { - sum = sum + Vector::borrow(&case.reports, i).infected_count; - }; - sum - } -} - "; + let (record_module_fpath, record_module_text) = modules_mod("record.move"); let config = config!({ "stdlib_folder": get_stdlib_path(), "modules_folders": [get_modules_path()], }); - let covid_tracker_module = leaked_fpath( - get_modules_path() - .join("covid_tracker.move") - .to_str() - .unwrap(), - ); + let errors = diagnostics_with_config_and_filename( - module_source_text, + &record_module_text, config, - covid_tracker_module, + record_module_fpath, ); assert!(errors.is_empty()); } @@ -283,10 +256,13 @@ module CovidTracker { // hardcoded sender address let script_source_text = r" script { - use 0x11111111111111111111111111111111::CovidTracker; + use 0x1::Signer; + use 0x2::Record; - fun main() { - CovidTracker::how_many(5); + fun main(s: &signer) { + let signer_address = Signer::address_of(s); + let record = Record::get_record(signer_address); + Record::save(record); } } "; @@ -294,24 +270,25 @@ script { "dialect": "libra", "stdlib_folder": get_stdlib_path(), "modules_folders": [get_modules_path()], - "sender_address": "0x11111111111111111111111111111111", + "sender_address": "0x1", }); let errors = diagnostics_with_config(script_source_text, config); - assert!(errors.is_empty(), "{:?}", errors); + assert!(errors.is_empty(), "{:#?}", errors); } #[test] fn test_compiler_out_of_bounds_multimessage_diagnostic() { let source_text = r" script { - use 0x0::CovidTracker; + use 0x1::Signer; + use 0x2::Record; - fun main() { - let how_many: u8; - how_many = CovidTracker::how_many(10); + fun main(s: &signer) { + let signer_address = Signer::address_of(s); + let record: u8; + record = Record::get_record(signer_address); } -} - "; +} "; let config = config!({ "stdlib_folder": get_stdlib_path(), "modules_folders": [get_modules_path()] @@ -660,8 +637,6 @@ module DFI { #[test] fn test_when_module_resolution_fails_error_should_be_at_use_site() { - setup_test_logging(); - let script_text = r"script { use 0x0::UnknownPayments; fun main(s: &signer) { diff --git a/crates/integration_tests/tests/test_executor.rs b/crates/integration_tests/tests/test_executor.rs index 440976ca..5422862a 100644 --- a/crates/integration_tests/tests/test_executor.rs +++ b/crates/integration_tests/tests/test_executor.rs @@ -2,59 +2,9 @@ use dialects::shared::errors::ExecCompilerError; use move_executor::compile_and_execute_script; use dialects::shared::results::ExecutionError; -use integration_tests::{ - existing_file_abspath, get_modules_path, get_script_path, get_stdlib_path, -}; +use integration_tests::{existing_module_file_abspath, get_modules_path, get_script_path, get_stdlib_path, stdlib_transaction_mod, record_mod, stdlib_mod}; use utils::{io, leaked_fpath, MoveFile}; -fn stdlib_mod(name: &str) -> MoveFile { - io::load_move_file(get_stdlib_path().join(name)).unwrap() -} - -fn stdlib_transaction_mod() -> MoveFile { - stdlib_mod("Transaction.move") -} - -fn record_mod() -> MoveFile { - let text = r" -address 0x1111111111111111 { - module Record { - use 0x0::Transaction; - - resource struct T { - age: u8, - } - - public fun create(age: u8): T { - T { age } - } - - public fun save(record: T) { - move_to_sender(record); - } - - public fun remove_record(user: address): T acquires T { - move_from(user) - } - - public fun destroy_record() acquires T { - let T { age: _ } = move_from(Transaction::sender()); - } - - public fun with_doubled_age(): T acquires T { - let record: T; - record = move_from(Transaction::sender()); - record.age = record.age * 2; - record - } - } -} - " - .to_string(); - let fpath = leaked_fpath(get_modules_path().join("record.move")); - (fpath, text) -} - #[test] fn test_show_compilation_errors() { let text = r" @@ -94,7 +44,7 @@ script { }"; let deps = vec![stdlib_transaction_mod()]; compile_and_execute_script( - (existing_file_abspath(), text.to_string()), + (existing_module_file_abspath(), text.to_string()), &deps, "libra", "0x1111111111111111", @@ -439,19 +389,23 @@ script { fn move_resource_from_another_user_to_sender() { let script_text = r" script { - use 0x1111111111111111::Record; + use 0x2::Record; fun main() { - let record = Record::remove_record(0x1111111111111111); + let original_record_owner = 0x1; + let record = Record::get_record(original_record_owner); Record::save(record); } }"; - let deps = vec![stdlib_transaction_mod(), record_mod()]; + let deps = vec![ + stdlib_mod("signer.move"), + stdlib_mod("record.move") + ]; let initial_chain_state = serde_json::json!([{ - "account": "0x1111111111111111", + "account": "0x1", "ty": { - "address": "0x1111111111111111", + "address": "0x1", "module": "Record", "name": "T", "ty_args": [], @@ -463,7 +417,7 @@ script { (get_script_path(), script_text.to_string()), &deps, "libra", - "0x2222222222222222", + "0x2", initial_chain_state, vec![], ) @@ -473,9 +427,9 @@ script { state_changes["changes"], serde_json::json!([ { - "account": "0x1111111111111111", + "account": "0x1", "ty": { - "address": "0x1111111111111111", + "address": "0x1", "module": "Record", "name": "T", "ty_args": [], @@ -484,9 +438,9 @@ script { "op": {"type": "Delete"}, }, { - "account": "0x2222222222222222", + "account": "0x2", "ty": { - "address": "0x1111111111111111", + "address": "0x2", "module": "Record", "name": "T", "ty_args": [], @@ -588,7 +542,7 @@ script { }"; let deps = vec![stdlib_transaction_mod()]; let chain_state = compile_and_execute_script( - (existing_file_abspath(), text.to_string()), + (existing_module_file_abspath(), text.to_string()), &deps, "libra", "0x1111111111111111", @@ -673,7 +627,7 @@ script { fun main() {} }"; compile_and_execute_script( - (existing_file_abspath(), text.to_string()), + (existing_module_file_abspath(), text.to_string()), &[], "dfinance", "0x0", @@ -683,7 +637,7 @@ script { .unwrap(); compile_and_execute_script( - (existing_file_abspath(), text.to_string()), + (existing_module_file_abspath(), text.to_string()), &[], "dfinance", "0x1", diff --git a/crates/integration_tests/tests/test_lsp.rs b/crates/integration_tests/tests/test_lsp.rs index 1e272ef0..c114b26f 100644 --- a/crates/integration_tests/tests/test_lsp.rs +++ b/crates/integration_tests/tests/test_lsp.rs @@ -9,7 +9,7 @@ use crossbeam_channel::{unbounded, Sender}; use dialects::DialectName; use integration_tests::config; -use integration_tests::get_resources_dir; +use integration_tests::get_test_resources_dir; use lsp_types::notification::{DidChangeConfiguration, Initialized}; use move_language_server::fs::ws_root_vfs; use move_language_server::global_state::GlobalState; @@ -96,7 +96,7 @@ fn send_shutdown(client_conn: &Connection) { } fn global_state(config: Config) -> (GlobalState, Sender) { - let ws_root = get_resources_dir(); + let ws_root = get_test_resources_dir(); let (fs_events_sender, fs_events_receiver) = unbounded::(); let vfs = ws_root_vfs(ws_root.clone(), fs_events_sender.clone()); let global_state = GlobalState::new(ws_root, config, vfs, fs_events_receiver); diff --git a/resources/tests/modules/covid_tracker.move b/resources/tests/modules/covid_tracker.move deleted file mode 100644 index 44e25aaa..00000000 --- a/resources/tests/modules/covid_tracker.move +++ /dev/null @@ -1,23 +0,0 @@ -module CovidTracker { - use 0x0::Vector; - use 0x0::Transaction; - - struct NewsReport { - news_source_id: u64, - infected_count: u64, - } - resource struct CovidSituation { - country_id: u8, - reports: vector - } - public fun how_many(_country: u8): u64 acquires CovidSituation { - let case = borrow_global(Transaction::sender()); - let len = Vector::length(&case.reports); - let sum = 0u64; - let i = 0; - while (i < len) { - sum = sum + Vector::borrow(&case.reports, i).infected_count; - }; - sum - } -} \ No newline at end of file diff --git a/resources/tests/modules/record.move b/resources/tests/modules/record.move new file mode 100644 index 00000000..48c656aa --- /dev/null +++ b/resources/tests/modules/record.move @@ -0,0 +1,32 @@ +address 0x2 { + module Record { + use 0x1::Signer; + + resource struct T { + age: u8, + } + + public fun get_record(addr: address): T acquires T { + move_from(addr) + } + + public fun create(age: u8): T { + T { age } + } + + public fun save(record: T) { + move_to_sender(record); + } + + public fun destroy_record(s: &signer) acquires T { + let T { age: _ } = get_record(Signer::address_of(s)); + } + + public fun with_doubled_age(s: &signer): T acquires T { + let record: T; + record = get_record(Signer::address_of(s)); + record.age = record.age * 2; + record + } + } +} \ No newline at end of file diff --git a/resources/tests/stdlib/Event.move b/resources/tests/stdlib/Event.move deleted file mode 100644 index a74b13af..00000000 --- a/resources/tests/stdlib/Event.move +++ /dev/null @@ -1,73 +0,0 @@ -address 0x0 { - -module Event { - use 0x0::LCS; - use 0x0::Signer; - use 0x0::Vector; - - // A resource representing the counter used to generate uniqueness under each account. There won't be destructor for - // this resource to guarantee the uniqueness of the generated handle. - resource struct EventHandleGenerator { - // A monotonically increasing counter - counter: u64, - addr: address, - } - - // A handle for an event such that: - // 1. Other modules can emit events to this handle. - // 2. Storage can use this handle to prove the total number of events that happened in the past. - resource struct EventHandle { - // Total number of events emitted to this event stream. - counter: u64, - // A globally unique ID for this event stream. - guid: vector, - } - - public fun publish_generator(account: &signer) { - move_to(account, EventHandleGenerator{ counter: 0, addr: Signer::address_of(account) }) - } - - // Derive a fresh unique id by using sender's EventHandleGenerator. The generated vector is indeed unique because it - // was derived from the hash(sender's EventHandleGenerator || sender_address). This module guarantees that the - // EventHandleGenerator is only going to be monotonically increased and there's no way to revert it or destroy it. Thus - // such counter is going to give distinct value for each of the new event stream under each sender. And since we - // hash it with the sender's address, the result is guaranteed to be globally unique. - fun fresh_guid(counter: &mut EventHandleGenerator): vector { - let sender_bytes = LCS::to_bytes(&counter.addr); - let count_bytes = LCS::to_bytes(&counter.counter); - counter.counter = counter.counter + 1; - - // EventHandleGenerator goes first just in case we want to extend address in the future. - Vector::append(&mut count_bytes, sender_bytes); - - count_bytes - } - - // Use EventHandleGenerator to generate a unique event handle for `sig` - public fun new_event_handle(account: &signer): EventHandle - acquires EventHandleGenerator { - EventHandle { - counter: 0, - guid: fresh_guid(borrow_global_mut(Signer::address_of(account))) - } - } - - // Emit an event with payload `msg` by using handle's key and counter. Will change the payload from vector to a - // generic type parameter once we have generics. - public fun emit_event(handle_ref: &mut EventHandle, msg: T) { - let guid = *&handle_ref.guid; - - write_to_event_store(guid, handle_ref.counter, msg); - handle_ref.counter = handle_ref.counter + 1; - } - - // Native procedure that writes to the actual event stream in Event store - // This will replace the "native" portion of EmitEvent bytecode - native fun write_to_event_store(guid: vector, count: u64, msg: T); - - // Destroy a unique handle. - public fun destroy_handle(handle: EventHandle) { - EventHandle { counter: _, guid: _ } = handle; - } -} -} diff --git a/resources/tests/stdlib/Transaction.move b/resources/tests/stdlib/Transaction.move deleted file mode 100644 index a901e358..00000000 --- a/resources/tests/stdlib/Transaction.move +++ /dev/null @@ -1,11 +0,0 @@ -address 0x0 { - -module Transaction { - native public fun gas_unit_price(): u64; - native public fun max_gas_units(): u64; - native public fun gas_remaining(): u64; - native public fun sender(): address; - native public fun sequence_number(): u64; - native public fun public_key(): vector; -} -} diff --git a/resources/tests/stdlib/coins.move b/resources/tests/stdlib/coins.move index b1cdabc2..b158c2aa 100644 --- a/resources/tests/stdlib/coins.move +++ b/resources/tests/stdlib/coins.move @@ -1,4 +1,4 @@ -address 0x0 { +address 0x1 { /// Enum-like module to make generic type-matching possible, every coin which is /// officially supported by blockchain (or peg-zone specifically) is added here. diff --git a/resources/tests/stdlib/debug.move b/resources/tests/stdlib/debug.move index a22013ce..2c722089 100644 --- a/resources/tests/stdlib/debug.move +++ b/resources/tests/stdlib/debug.move @@ -1,9 +1,7 @@ -address 0x0 { +address 0x1 { module Debug { native public fun print(x: &T); - native public fun print_stack_trace(); } - } diff --git a/resources/tests/stdlib/event.move b/resources/tests/stdlib/event.move new file mode 100644 index 00000000..5e97d75b --- /dev/null +++ b/resources/tests/stdlib/event.move @@ -0,0 +1,9 @@ +address 0x1 { + +module Event { + + // Native procedure that writes to the actual event stream in Event store + // This will replace the "native" portion of EmitEvent bytecode + native public fun emit(msg: T); +} +} diff --git a/resources/tests/stdlib/LCS.move b/resources/tests/stdlib/lcs.move similarity index 63% rename from resources/tests/stdlib/LCS.move rename to resources/tests/stdlib/lcs.move index 2c902d9e..68a40a95 100644 --- a/resources/tests/stdlib/LCS.move +++ b/resources/tests/stdlib/lcs.move @@ -3,17 +3,10 @@ // published on-chain. See https://github.com/libra/libra/tree/master/common/lcs for more // details on LCS (TODO: link to spec once we have one) -address 0x0 { +address 0x1 { + module LCS { // Return the binary representation of `v` in LCS (Libra Canonical Serialization) format native public fun to_bytes(v: &MoveValue): vector; - - // ------------------------------------------------------------------------ - // Specification - // ------------------------------------------------------------------------ - - spec module { - native define serialize(v: &MoveValue): vector; - } } } diff --git a/resources/tests/stdlib/oracle.move b/resources/tests/stdlib/oracle.move index 93a7dbb9..d68e1af1 100644 --- a/resources/tests/stdlib/oracle.move +++ b/resources/tests/stdlib/oracle.move @@ -1,4 +1,4 @@ -address 0x0 { +address 0x1 { module Oracle { native public fun get_price(): u64; diff --git a/resources/tests/stdlib/Signer.move b/resources/tests/stdlib/signer.move similarity index 97% rename from resources/tests/stdlib/Signer.move rename to resources/tests/stdlib/signer.move index 5e187b83..e85885b5 100644 --- a/resources/tests/stdlib/Signer.move +++ b/resources/tests/stdlib/signer.move @@ -1,4 +1,4 @@ -address 0x0 { +address 0x1 { module Signer { // Borrows the address of the signer // Conceptually, you can think of the `signer` as being a resource struct wrapper arround an diff --git a/resources/tests/stdlib/Vector.move b/resources/tests/stdlib/vector.move similarity index 71% rename from resources/tests/stdlib/Vector.move rename to resources/tests/stdlib/vector.move index ce098818..cc497f6b 100644 --- a/resources/tests/stdlib/Vector.move +++ b/resources/tests/stdlib/vector.move @@ -1,7 +1,8 @@ -address 0x0 { +address 0x1 { // A variable-sized container that can hold both unrestricted types and resources. module Vector { + native public fun empty(): vector; // Return the length of the vector. @@ -25,13 +26,6 @@ module Vector { // Swaps the elements at the i'th and j'th indices in the vector. native public fun swap(v: &mut vector, i: u64, j: u64); - // Return an vector of size one containing `e` - public fun singleton(e: Element): vector { - let v = empty(); - push_back(&mut v, e); - v - } - // Reverses the order of the elements in the vector in place. public fun reverse(v: &mut vector) { let len = length(v); @@ -69,19 +63,6 @@ module Vector { false } - // Return (true, i) if `e` is in the vector `v` at index `i`. - // Otherwise returns (false, 0). - public fun index_of(v: &vector, e: &Element): (bool, u64) { - let i = 0; - let len = length(v); - while (i < len) { - if (borrow(v, i) == e) return (true, i); - i = i + 1; - }; - (false, 0) - } - - // Remove the `i`th element E of the vector, shifting all subsequent elements // It is O(n) and preserves ordering public fun remove(v: &mut vector, i: u64): Element { @@ -102,38 +83,5 @@ module Vector { swap(v, i, last_idx); pop_back(v) } - - // ------------------------------------------------------------------------ - // Specification - // ------------------------------------------------------------------------ - - spec fun reverse { - pragma intrinsic = true; - } - - spec fun append { - pragma intrinsic = true; - } - - spec fun is_empty { - pragma intrinsic = true; - } - - spec fun contains { - pragma intrinsic = true; - } - - spec fun index_of { - pragma intrinsic = true; - } - - spec fun remove { - pragma intrinsic = true; - } - - spec fun swap_remove { - pragma intrinsic = true; - } } - } From ef8a8521e9d5287179b9b7ea9931f6c081602670 Mon Sep 17 00:00:00 2001 From: Maksim Kurnikov Date: Tue, 23 Jun 2020 14:14:25 +0300 Subject: [PATCH 5/6] fix executor tests with proper zero padding for lowering --- Cargo.lock | 78 ++++---- crates/dialects/Cargo.toml | 13 ++ crates/dialects/src/impls.rs | 2 +- crates/dialects/src/shared/addresses.rs | 14 +- crates/integration_tests/src/lib.rs | 3 +- .../tests/test_compilation_check.rs | 4 +- .../tests/test_completion.rs | 3 +- .../integration_tests/tests/test_executor.rs | 182 ++++-------------- resources/tests/stdlib/signer.move | 4 - 9 files changed, 105 insertions(+), 198 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 62420275..d0df8d20 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -283,7 +283,7 @@ dependencies = [ [[package]] name = "borrow-graph" version = "0.0.1" -source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#46cd3dc349147351d61dc64dc6e000276fcf400d" dependencies = [ "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "mirai-annotations", @@ -375,7 +375,7 @@ checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" [[package]] name = "bytecode-source-map" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#46cd3dc349147351d61dc64dc6e000276fcf400d" dependencies = [ "anyhow", "codespan 0.8.0", @@ -392,7 +392,7 @@ dependencies = [ [[package]] name = "bytecode-verifier" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#46cd3dc349147351d61dc64dc6e000276fcf400d" dependencies = [ "anyhow", "borrow-graph", @@ -529,7 +529,7 @@ dependencies = [ [[package]] name = "compiled-stdlib" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#46cd3dc349147351d61dc64dc6e000276fcf400d" dependencies = [ "anyhow", "bytecode-verifier", @@ -547,7 +547,7 @@ dependencies = [ [[package]] name = "compiler" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#46cd3dc349147351d61dc64dc6e000276fcf400d" dependencies = [ "anyhow", "bytecode-source-map", @@ -677,7 +677,7 @@ dependencies = [ [[package]] name = "datatest-stable" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#46cd3dc349147351d61dc64dc6e000276fcf400d" dependencies = [ "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "regex", @@ -689,7 +689,7 @@ dependencies = [ [[package]] name = "debug-interface" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#46cd3dc349147351d61dc64dc6e000276fcf400d" dependencies = [ "anyhow", "libra-logger", @@ -770,7 +770,7 @@ dependencies = [ [[package]] name = "docgen" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#46cd3dc349147351d61dc64dc6e000276fcf400d" dependencies = [ "anyhow", "codespan 0.8.0", @@ -1411,7 +1411,7 @@ dependencies = [ [[package]] name = "ir-to-bytecode" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#46cd3dc349147351d61dc64dc6e000276fcf400d" dependencies = [ "anyhow", "bytecode-source-map", @@ -1430,7 +1430,7 @@ dependencies = [ [[package]] name = "ir-to-bytecode-syntax" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#46cd3dc349147351d61dc64dc6e000276fcf400d" dependencies = [ "anyhow", "codespan 0.8.0", @@ -1499,7 +1499,7 @@ dependencies = [ [[package]] name = "language-e2e-tests" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#46cd3dc349147351d61dc64dc6e000276fcf400d" dependencies = [ "anyhow", "bytecode-verifier", @@ -1560,7 +1560,7 @@ dependencies = [ [[package]] name = "libra-canonical-serialization" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#46cd3dc349147351d61dc64dc6e000276fcf400d" dependencies = [ "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "serde", @@ -1580,7 +1580,7 @@ dependencies = [ [[package]] name = "libra-config" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#46cd3dc349147351d61dc64dc6e000276fcf400d" dependencies = [ "anyhow", "get_if_addrs", @@ -1603,7 +1603,7 @@ dependencies = [ [[package]] name = "libra-crypto" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#46cd3dc349147351d61dc64dc6e000276fcf400d" dependencies = [ "aes-gcm 0.6.0", "anyhow", @@ -1667,7 +1667,7 @@ dependencies = [ [[package]] name = "libra-crypto-derive" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#46cd3dc349147351d61dc64dc6e000276fcf400d" dependencies = [ "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "proc-macro2 1.0.18", @@ -1689,7 +1689,7 @@ dependencies = [ [[package]] name = "libra-logger" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#46cd3dc349147351d61dc64dc6e000276fcf400d" dependencies = [ "chrono", "env_logger", @@ -1703,7 +1703,7 @@ dependencies = [ [[package]] name = "libra-metrics" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#46cd3dc349147351d61dc64dc6e000276fcf400d" dependencies = [ "anyhow", "futures", @@ -1719,7 +1719,7 @@ dependencies = [ [[package]] name = "libra-network-address" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#46cd3dc349147351d61dc64dc6e000276fcf400d" dependencies = [ "libra-canonical-serialization 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "libra-crypto 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", @@ -1734,7 +1734,7 @@ dependencies = [ [[package]] name = "libra-nibble" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#46cd3dc349147351d61dc64dc6e000276fcf400d" dependencies = [ "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "serde", @@ -1752,7 +1752,7 @@ dependencies = [ [[package]] name = "libra-proptest-helpers" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#46cd3dc349147351d61dc64dc6e000276fcf400d" dependencies = [ "crossbeam", "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", @@ -1763,7 +1763,7 @@ dependencies = [ [[package]] name = "libra-state-view" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#46cd3dc349147351d61dc64dc6e000276fcf400d" dependencies = [ "anyhow", "libra-types", @@ -1773,7 +1773,7 @@ dependencies = [ [[package]] name = "libra-temppath" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#46cd3dc349147351d61dc64dc6e000276fcf400d" dependencies = [ "hex", "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", @@ -1783,7 +1783,7 @@ dependencies = [ [[package]] name = "libra-types" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#46cd3dc349147351d61dc64dc6e000276fcf400d" dependencies = [ "anyhow", "bytes", @@ -1813,7 +1813,7 @@ dependencies = [ [[package]] name = "libra-vm" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#46cd3dc349147351d61dc64dc6e000276fcf400d" dependencies = [ "debug-interface", "libra-canonical-serialization 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", @@ -1837,7 +1837,7 @@ dependencies = [ [[package]] name = "libra-workspace-hack" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#46cd3dc349147351d61dc64dc6e000276fcf400d" dependencies = [ "bytes", "cc", @@ -2106,7 +2106,7 @@ checksum = "258c143ddb5105becc4834f66d0b0ad3d3205d07cb3efc3236f33f623dd07b16" [[package]] name = "move-core-types" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#46cd3dc349147351d61dc64dc6e000276fcf400d" dependencies = [ "anyhow", "hex", @@ -2156,7 +2156,7 @@ dependencies = [ [[package]] name = "move-ir-types" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#46cd3dc349147351d61dc64dc6e000276fcf400d" dependencies = [ "anyhow", "codespan 0.8.0", @@ -2171,7 +2171,7 @@ dependencies = [ [[package]] name = "move-lang" version = "0.0.1" -source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#46cd3dc349147351d61dc64dc6e000276fcf400d" dependencies = [ "anyhow", "borrow-graph", @@ -2225,7 +2225,7 @@ dependencies = [ [[package]] name = "move-prover" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#46cd3dc349147351d61dc64dc6e000276fcf400d" dependencies = [ "anyhow", "bytecode-source-map", @@ -2256,7 +2256,7 @@ dependencies = [ [[package]] name = "move-vm-natives" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#46cd3dc349147351d61dc64dc6e000276fcf400d" dependencies = [ "bit-vec", "byteorder", @@ -2276,7 +2276,7 @@ dependencies = [ [[package]] name = "move-vm-runtime" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#46cd3dc349147351d61dc64dc6e000276fcf400d" dependencies = [ "bytecode-verifier", "libra-crypto 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", @@ -2294,7 +2294,7 @@ dependencies = [ [[package]] name = "move-vm-types" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#46cd3dc349147351d61dc64dc6e000276fcf400d" dependencies = [ "libra-canonical-serialization 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "libra-crypto 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", @@ -2452,7 +2452,7 @@ dependencies = [ [[package]] name = "num-variants" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#46cd3dc349147351d61dc64dc6e000276fcf400d" dependencies = [ "libra-workspace-hack 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", "proc-macro2 1.0.18", @@ -3422,7 +3422,7 @@ dependencies = [ [[package]] name = "spec-lang" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#46cd3dc349147351d61dc64dc6e000276fcf400d" dependencies = [ "anyhow", "bytecode-source-map", @@ -3450,7 +3450,7 @@ checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] name = "stackless-bytecode-generator" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#46cd3dc349147351d61dc64dc6e000276fcf400d" dependencies = [ "borrow-graph", "bytecode-verifier", @@ -3467,7 +3467,7 @@ dependencies = [ [[package]] name = "stdlib" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#46cd3dc349147351d61dc64dc6e000276fcf400d" dependencies = [ "anyhow", "bytecode-verifier", @@ -3755,7 +3755,7 @@ checksum = "e987b6bf443f4b5b3b6f38704195592cca41c5bb7aedd3c3693c7081f8289860" [[package]] name = "transaction-builder" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#46cd3dc349147351d61dc64dc6e000276fcf400d" dependencies = [ "compiled-stdlib", "libra-canonical-serialization 0.1.0 (git+https://github.com/dfinance/libra.git?branch=16.06.2020)", @@ -3979,7 +3979,7 @@ checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" [[package]] name = "vm" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#46cd3dc349147351d61dc64dc6e000276fcf400d" dependencies = [ "anyhow", "byteorder", @@ -3996,7 +3996,7 @@ dependencies = [ [[package]] name = "vm-genesis" version = "0.1.0" -source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#0f0ecb388ad127d8ad66b98b0d4d8a54d40c4f40" +source = "git+https://github.com/dfinance/libra.git?branch=16.06.2020#46cd3dc349147351d61dc64dc6e000276fcf400d" dependencies = [ "anyhow", "bytecode-verifier", diff --git a/crates/dialects/Cargo.toml b/crates/dialects/Cargo.toml index 344db881..efbcef9b 100644 --- a/crates/dialects/Cargo.toml +++ b/crates/dialects/Cargo.toml @@ -34,4 +34,17 @@ libra-crypto = { git = "https://github.com/dfinance/libra.git", branch = "16.06. move-ir-types = { git = "https://github.com/dfinance/libra.git", branch = "16.06.2020" } vm-genesis = { git = "https://github.com/dfinance/libra.git", branch = "16.06.2020" } +#move-vm-runtime = { path = "../../../dvm-libra/language/move-vm/runtime" } +#move-vm-types = { path = "../../../dvm-libra/language/move-vm/types" } +#libra-state-view = { path = "../../../dvm-libra/storage/state-view" } +#language-e2e-tests = { path = "../../../dvm-libra/language/e2e-tests" } +#move-core-types = { path = "../../../dvm-libra/language/move-core/types" } +#vm = { path = "../../../dvm-libra/language/vm" } +#libra-types = { path = "../../../dvm-libra/types" } +#move-lang = { path = "../../../dvm-libra/language/move-lang" } +#libra-canonical-serialization = { path = "../../../dvm-libra/common/lcs" } +#libra-crypto = { path = "../../../dvm-libra/crypto/crypto" } +#move-ir-types = { path = "../../../dvm-libra/language/move-ir/types" } +#vm-genesis = { path = "../../../dvm-libra/language/tools/vm-genesis" } + libra-move-core-types = { package = "move-core-types", git = "https://github.com/dfinance/libra.git", branch = "master" } diff --git a/crates/dialects/src/impls.rs b/crates/dialects/src/impls.rs index d3ae6323..9e7922b8 100644 --- a/crates/dialects/src/impls.rs +++ b/crates/dialects/src/impls.rs @@ -21,7 +21,7 @@ impl Dialect for LibraDialect { fn normalize_account_address(&self, addr: &str) -> Result { let address = LibraAccountAddress::from_hex_literal(&addr)?; let normalized_address = format!("0x{}", address); - let lowered = format!("{}00000000", normalized_address); + let lowered = format!("0x00000000{}", address); Ok(ProvidedAccountAddress::new( addr.to_string(), normalized_address, diff --git a/crates/dialects/src/shared/addresses.rs b/crates/dialects/src/shared/addresses.rs index 1d3f7532..b19f52b8 100644 --- a/crates/dialects/src/shared/addresses.rs +++ b/crates/dialects/src/shared/addresses.rs @@ -16,7 +16,7 @@ pub fn replace_16_bytes_libra(source: &str, file_source_map: &mut FileSourceMap) let orig_address = item.as_str(); let account_address = LibraAccountAddress::from_hex_literal(orig_address).unwrap(); - let repl_address = format!("0x{}00000000", account_address); + let repl_address = format!("0x00000000{}", account_address); file_source_map.insert_address_layer( item.end(), @@ -67,12 +67,12 @@ mod tests { assert_eq!( replaced, r"use 0x0000000000000000000000000000000000000000; - use 0x0000000000000000000000000000000100000000; - use 0x0000000000000000000000000000001100000000; - use 0x0000000000000000000000000000111100000000; - use 0x0000000000000000000000001111111100000000; - use 0x0000000000000000111111111111111100000000; - use 0x0000000000000000111111111111111100000000;" + use 0x0000000000000000000000000000000000000001; + use 0x0000000000000000000000000000000000000011; + use 0x0000000000000000000000000000000000001111; + use 0x0000000000000000000000000000000011111111; + use 0x0000000000000000000000001111111111111111; + use 0x0000000000000000000000001111111111111111;" ) } } diff --git a/crates/integration_tests/src/lib.rs b/crates/integration_tests/src/lib.rs index d2fefcfd..8d23b4e3 100644 --- a/crates/integration_tests/src/lib.rs +++ b/crates/integration_tests/src/lib.rs @@ -3,7 +3,7 @@ use analysis::config::Config; use move_language_server::global_state::{initialize_new_global_state, GlobalStateSnapshot}; use std::path::PathBuf; use utils::io::read_move_files; -use utils::{leaked_fpath, MoveFile, MoveFilePath, io}; +use utils::{io, leaked_fpath, MoveFile, MoveFilePath}; pub fn get_script_path() -> MoveFilePath { leaked_fpath(get_modules_path().join("script.move")) @@ -88,7 +88,6 @@ macro_rules! config { }}; } - pub fn stdlib_mod(name: &str) -> MoveFile { io::load_move_file(get_stdlib_path().join(name)).unwrap() } diff --git a/crates/integration_tests/tests/test_compilation_check.rs b/crates/integration_tests/tests/test_compilation_check.rs index 685e666c..ba3ef9f5 100644 --- a/crates/integration_tests/tests/test_compilation_check.rs +++ b/crates/integration_tests/tests/test_compilation_check.rs @@ -80,7 +80,9 @@ mod tests { use super::*; use analysis::db::RootDatabase; - use integration_tests::{config, get_modules_path, get_script_path, get_stdlib_path, modules_mod}; + use integration_tests::{ + config, get_modules_path, get_script_path, get_stdlib_path, modules_mod, + }; use utils::{leaked_fpath, FilesSourceText}; #[test] diff --git a/crates/integration_tests/tests/test_completion.rs b/crates/integration_tests/tests/test_completion.rs index b1f3d876..e7724845 100644 --- a/crates/integration_tests/tests/test_completion.rs +++ b/crates/integration_tests/tests/test_completion.rs @@ -37,11 +37,10 @@ mod tests { #[test] fn test_top_level_completion() { let source_text = "script { fun main() {} }"; - let completions = completions( + completions( (get_script_path(), source_text.to_string()), config!({}), (0, 0), ); - dbg!(completions); } } diff --git a/crates/integration_tests/tests/test_executor.rs b/crates/integration_tests/tests/test_executor.rs index 5422862a..a397b229 100644 --- a/crates/integration_tests/tests/test_executor.rs +++ b/crates/integration_tests/tests/test_executor.rs @@ -1,9 +1,10 @@ use dialects::shared::errors::ExecCompilerError; use move_executor::compile_and_execute_script; -use dialects::shared::results::ExecutionError; -use integration_tests::{existing_module_file_abspath, get_modules_path, get_script_path, get_stdlib_path, stdlib_transaction_mod, record_mod, stdlib_mod}; -use utils::{io, leaked_fpath, MoveFile}; +use integration_tests::{ + existing_module_file_abspath, get_modules_path, get_script_path, modules_mod, stdlib_mod, +}; +use utils::leaked_fpath; #[test] fn test_show_compilation_errors() { @@ -36,13 +37,13 @@ script { fn test_execute_custom_script_with_stdlib_module() { let text = r" script { - use 0x0::Transaction; + use 0x1::Signer; - fun main() { - let _ = Transaction::sender(); + fun main(s: &signer) { + let _ = Signer::address_of(s); } }"; - let deps = vec![stdlib_transaction_mod()]; + let deps = vec![stdlib_mod("signer.move")]; compile_and_execute_script( (existing_module_file_abspath(), text.to_string()), &deps, @@ -58,14 +59,14 @@ script { fn test_execute_script_and_record_resource_changes() { let script_text = r" script { - use 0x1111111111111111::Record; + use 0x2::Record; fun main() { let record = Record::create(10); Record::save(record); } }"; - let deps = vec![stdlib_transaction_mod(), record_mod()]; + let deps = vec![stdlib_mod("signer.move"), modules_mod("record.move")]; let state_changes = compile_and_execute_script( (get_script_path(), script_text.to_string()), @@ -81,7 +82,7 @@ script { serde_json::json!([{ "account": "0x1111111111111111", "ty": { - "address": "0x1111111111111111", + "address": "0x0000000000000000000000000000000000000002", "module": "Record", "name": "T", "ty_args": [], @@ -96,19 +97,19 @@ script { fn test_execute_script_with_genesis_state_provided() { let script_text = r" script { - use 0x1111111111111111::Record; + use 0x2::Record; - fun main() { - let record = Record::with_doubled_age(); + fun main(s: &signer) { + let record = Record::with_doubled_age(s); Record::save(record); } }"; - let deps = vec![stdlib_transaction_mod(), record_mod()]; + let deps = vec![stdlib_mod("signer.move"), modules_mod("record.move")]; let initial_chain_state = serde_json::json!([{ "account": "0x1111111111111111", "ty": { - "address": "0x1111111111111111", + "address": "0x2", "module": "Record", "name": "T", "ty_args": [], @@ -130,7 +131,7 @@ script { serde_json::json!([{ "account": "0x1111111111111111", "ty": { - "address": "0x1111111111111111", + "address": "0x0000000000000000000000000000000000000002", "module": "Record", "name": "T", "ty_args": [], @@ -341,18 +342,18 @@ script { fn test_resource_move_from_sender() { let script_text = r" script { - use 0x1111111111111111::Record; + use 0x2::Record; - fun main() { - Record::destroy_record(); + fun main(s: &signer) { + Record::destroy_record(s); } }"; - let deps = vec![stdlib_transaction_mod(), record_mod()]; + let deps = vec![stdlib_mod("signer.move"), modules_mod("record.move")]; let initial_chain_state = serde_json::json!([{ "account": "0x1111111111111111", "ty": { - "address": "0x1111111111111111", + "address": "0x2", "module": "Record", "name": "T", "ty_args": [], @@ -374,7 +375,7 @@ script { serde_json::json!([{ "account": "0x1111111111111111", "ty": { - "address": "0x1111111111111111", + "address": "0x0000000000000000000000000000000000000002", "module": "Record", "name": "T", "ty_args": [], @@ -397,15 +398,12 @@ script { Record::save(record); } }"; - let deps = vec![ - stdlib_mod("signer.move"), - stdlib_mod("record.move") - ]; + let deps = vec![stdlib_mod("signer.move"), modules_mod("record.move")]; let initial_chain_state = serde_json::json!([{ "account": "0x1", "ty": { - "address": "0x1", + "address": "0x2", "module": "Record", "name": "T", "ty_args": [], @@ -417,7 +415,7 @@ script { (get_script_path(), script_text.to_string()), &deps, "libra", - "0x2", + "0x3", initial_chain_state, vec![], ) @@ -429,7 +427,7 @@ script { { "account": "0x1", "ty": { - "address": "0x1", + "address": "0x0000000000000000000000000000000000000002", "module": "Record", "name": "T", "ty_args": [], @@ -438,9 +436,9 @@ script { "op": {"type": "Delete"}, }, { - "account": "0x2", + "account": "0x3", "ty": { - "address": "0x2", + "address": "0x0000000000000000000000000000000000000002", "module": "Record", "name": "T", "ty_args": [], @@ -485,18 +483,18 @@ script { fn test_bech32_in_genesis_json() { let script_text = r" script { - use 0x1111111111111111::Record; + use 0x2::Record; - fun main() { - let record = Record::with_doubled_age(); + fun main(s: &signer) { + let record = Record::with_doubled_age(s); Record::save(record); } }"; - let deps = vec![stdlib_transaction_mod(), record_mod()]; + let deps = vec![stdlib_mod("signer.move"), modules_mod("record.move")]; let initial_chain_state = serde_json::json!([{ "account": "wallet1pxqfjvnu0utauj8fctw2s7j4mfyvrsjd59c2u8", "ty": { - "address": "0x0000000000000000000000001111111111111111", + "address": "0x0000000000000000000000000000000000000002", "module": "Record", "name": "T", "ty_args": [], @@ -519,7 +517,7 @@ script { serde_json::json!([{ "account": "wallet1pxqfjvnu0utauj8fctw2s7j4mfyvrsjd59c2u8", "ty": { - "address": "0x0000000000000000000000001111111111111111", + "address": "0x0000000000000000000000000000000000000002", "module": "Record", "name": "T", "ty_args": [], @@ -534,71 +532,15 @@ script { fn test_show_executor_gas_in_genesis_if_gas_flag_is_present() { let text = r" script { - use 0x0::Transaction; - - fun main() { - let _ = Transaction::sender(); - } -}"; - let deps = vec![stdlib_transaction_mod()]; - let chain_state = compile_and_execute_script( - (existing_module_file_abspath(), text.to_string()), - &deps, - "libra", - "0x1111111111111111", - serde_json::json!([]), - vec![], - ) - .unwrap(); - assert_eq!(chain_state["gas_spent"], 88); -} - -#[test] -fn test_show_events() { - let payment_events = r" -address 0x0 { - module Payments { - use 0x0::Event; - - struct PaymentEvent { - value: u64 - } - - public fun send_payment_event(s: &signer) { - Event::publish_generator(s); - let sent_events = Event::new_event_handle(s); - - - let payment_event = PaymentEvent { value: 10 }; - Event::emit_event(&mut sent_events, payment_event); - - Event::destroy_handle(sent_events); - } - } -} - "; - let text = r" -script { - use 0x0::Payments; + use 0x1::Signer; fun main(s: &signer) { - Payments::send_payment_event(s); + let _ = Signer::address_of(s); } }"; - let script = (get_script_path(), text.to_string()); - let deps = vec![ - stdlib_transaction_mod(), - stdlib_mod("LCS.move"), - stdlib_mod("Signer.move"), - stdlib_mod("Vector.move"), - stdlib_mod("Event.move"), - ( - leaked_fpath(get_modules_path().join("payments.move")), - payment_events.to_string(), - ), - ]; + let deps = vec![stdlib_mod("signer.move")]; let chain_state = compile_and_execute_script( - script, + (existing_module_file_abspath(), text.to_string()), &deps, "libra", "0x1111111111111111", @@ -606,18 +548,7 @@ script { vec![], ) .unwrap(); - let events = chain_state["events"].as_array().unwrap(); - assert_eq!(events.len(), 1); - assert_eq!( - events[0]["type_tag"], - serde_json::json!({ - "Struct": { - "address": "0000000000000000000000000000000000000000", - "module": "Payments", - "name": "PaymentEvent", - "type_params": [] - }}) - ); + assert_eq!(chain_state["gas_spent"], 1606); } #[test] @@ -646,36 +577,3 @@ script { ) .unwrap(); } - -#[test] -fn test_oracle_native_function() { - let script_text = r" -script { - use 0x0::Oracle; - use 0x0::Event; - use 0x0::Coins; - - fun main(account: &signer) { - let price = Oracle::get_price(); - let event_handle = Event::new_event_handle(account); - Event::emit_event(&mut event_handle, price); - Event::destroy_handle(event_handle); - } -} - "; - let script = (get_script_path(), script_text.to_string()); - let deps = io::load_move_module_files(vec![get_stdlib_path()]).unwrap(); - let chain_state = compile_and_execute_script( - script, - &deps, - "dfinance", - "0x0", - serde_json::json!([]), - vec![], - ) - .unwrap_err(); - assert_eq!( - chain_state.downcast::().unwrap().status, - "STORAGE_ERROR" - ); -} diff --git a/resources/tests/stdlib/signer.move b/resources/tests/stdlib/signer.move index e85885b5..f690f2b3 100644 --- a/resources/tests/stdlib/signer.move +++ b/resources/tests/stdlib/signer.move @@ -13,9 +13,5 @@ module Signer { public fun address_of(s: &signer): address { *borrow_address(s) } - - spec module { - native define get_address(account: signer): address; - } } } From 8ebd8b63ad8a41a271b1a63913b09d5f3d97ee6f Mon Sep 17 00:00:00 2001 From: Maksim Kurnikov Date: Tue, 23 Jun 2020 15:24:47 +0300 Subject: [PATCH 6/6] fix address conversion tests --- check_project.sh | 2 +- crates/dialects/src/shared/addresses.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/check_project.sh b/check_project.sh index 339c7293..287bf3cd 100755 --- a/check_project.sh +++ b/check_project.sh @@ -18,4 +18,4 @@ fi # clippy available in stable channel only cargo +stable clippy --tests --workspace -- -Dwarnings -cargo test --package integration_tests +cargo test diff --git a/crates/dialects/src/shared/addresses.rs b/crates/dialects/src/shared/addresses.rs index b19f52b8..6c331213 100644 --- a/crates/dialects/src/shared/addresses.rs +++ b/crates/dialects/src/shared/addresses.rs @@ -36,7 +36,7 @@ mod tests { fn replace_libra_16_byte_address() { let source = "use 0x00000000000000001111111111111111;"; let replaced = replace_16_bytes_libra(source, &mut FileSourceMap::default()); - assert_eq!(replaced, "use 0x0000000000000000111111111111111100000000;"); + assert_eq!(replaced, "use 0x0000000000000000000000001111111111111111;"); } #[test] @@ -44,14 +44,14 @@ mod tests { let source = "use 0x00000000000000001111111111111111; \n use 0x00000000000000001111111111111112;"; let replaced = replace_16_bytes_libra(source, &mut FileSourceMap::default()); - assert_eq!(replaced, "use 0x0000000000000000111111111111111100000000; \n use 0x0000000000000000111111111111111200000000;"); + assert_eq!(replaced, "use 0x0000000000000000000000001111111111111111; \n use 0x0000000000000000000000001111111111111112;"); } #[test] fn dont_replace_20_bytes_address() { - let source = "use 0x0000000000000000111111111111111100000000;"; + let source = "use 0x0000000000000000000000001111111111111111;"; let replaced = replace_16_bytes_libra(source, &mut FileSourceMap::default()); - assert_eq!(replaced, "use 0x0000000000000000111111111111111100000000;"); + assert_eq!(replaced, "use 0x0000000000000000000000001111111111111111;"); } #[test]