diff --git a/.circleci/config.yml b/.circleci/config.yml index d5ec3054c2..4451b81210 100755 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -50,7 +50,7 @@ commands: jobs: check-style: docker: - - image: cimg/rust:1.65 + - image: cimg/rust:1.69 resource_class: xlarge steps: - checkout @@ -66,7 +66,7 @@ jobs: clippy: docker: - - image: cimg/rust:1.65 + - image: cimg/rust:1.69 resource_class: xlarge steps: - checkout @@ -83,7 +83,7 @@ jobs: leo-executable: docker: - - image: cimg/rust:1.65 + - image: cimg/rust:1.69 resource_class: xlarge steps: - checkout @@ -102,7 +102,7 @@ jobs: leo-new: docker: - - image: cimg/rust:1.65 + - image: cimg/rust:1.69 resource_class: xlarge steps: - attach_workspace: @@ -115,7 +115,7 @@ jobs: leo-clean: docker: - - image: cimg/rust:1.65 + - image: cimg/rust:1.69 resource_class: xlarge steps: - attach_workspace: @@ -128,7 +128,7 @@ jobs: test-examples: docker: - - image: cimg/rust:1.65 + - image: cimg/rust:1.69 resource_class: xlarge steps: - attach_workspace: diff --git a/Cargo.lock b/Cargo.lock index fee5f21c0f..52d0021db8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -121,7 +121,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6118baab6285accf088b31d5ea5029c37bbf9d98e62b4d8720a0a5a66bc2e427" dependencies = [ "proc-macro2 1.0.56", - "quote 1.0.26", + "quote 1.0.27", "syn 1.0.109", ] @@ -212,7 +212,7 @@ dependencies = [ "cc", "cfg-if", "libc", - "miniz_oxide", + "miniz_oxide 0.6.2", "object", "rustc-demangle", ] @@ -305,9 +305,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.12.0" +version = "3.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" +checksum = "3c6ed94e98ecff0c12dd1b04c15ec0d7d9458ca8fe806cea6f12954efe74c63b" [[package]] name = "byteorder" @@ -374,9 +374,9 @@ dependencies = [ [[package]] name = "ciborium" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0c137568cc60b904a7724001b35ce2630fd00d5d84805fbb608ab89509d788f" +checksum = "effd91f6c78e5a4ace8a5d3c0b6bfaec9e2baaef55f3efc00e45fb2e477ee926" dependencies = [ "ciborium-io", "ciborium-ll", @@ -385,15 +385,15 @@ dependencies = [ [[package]] name = "ciborium-io" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "346de753af073cc87b52b2083a506b38ac176a44cfb05497b622e27be899b369" +checksum = "cdf919175532b369853f5d5e20b26b43112613fd6fe7aee757e35f7a44642656" [[package]] name = "ciborium-ll" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213030a2b5a4e0c0892b6652260cf6ccac84827b83a85a534e178e3906c4cf1b" +checksum = "defaa24ecc093c77630e6c15e17c51f5e187bf35ee514f4e2d67baaa96dae22b" dependencies = [ "ciborium-io", "half", @@ -410,9 +410,9 @@ dependencies = [ [[package]] name = "clap" -version = "3.2.23" +version = "3.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71655c45cb9845d3270c9d6df84ebe72b4dad3c2ba3f7023ad47c144e4e473a5" +checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" dependencies = [ "atty", "bitflags", @@ -427,14 +427,14 @@ dependencies = [ [[package]] name = "clap_derive" -version = "3.2.18" +version = "3.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65" +checksum = "ae6371b8bdc8b7d3959e9cf7b22d4435ef3e79e138688421ec654acf8c81b008" dependencies = [ "heck", "proc-macro-error", "proc-macro2 1.0.56", - "quote 1.0.26", + "quote 1.0.27", "syn 1.0.109", ] @@ -512,9 +512,9 @@ checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] name = "cpufeatures" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "280a9f2d8b3a38871a3c8a46fb80db65e5e5ed97da80c4d08bf27fb63e35e181" +checksum = "3e4c1eaa2012c47becbbad2ab175484c2a84d1185b566fb2cc5b8707343dfe58" dependencies = [ "libc", ] @@ -654,7 +654,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ "proc-macro2 1.0.56", - "quote 1.0.26", + "quote 1.0.27", "syn 1.0.109", ] @@ -686,11 +686,11 @@ dependencies = [ [[package]] name = "dirs" -version = "5.0.0" +version = "5.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dece029acd3353e3a58ac2e3eb3c8d6c35827a892edc6cc4138ef9c33df46ecd" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" dependencies = [ - "dirs-sys 0.4.0", + "dirs-sys 0.4.1", ] [[package]] @@ -706,13 +706,14 @@ dependencies = [ [[package]] name = "dirs-sys" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04414300db88f70d74c5ff54e50f9e1d1737d9a5b90f53fcf2e95ca2a9ab554b" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" dependencies = [ "libc", + "option-ext", "redox_users", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -800,12 +801,12 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.25" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" +checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" dependencies = [ "crc32fast", - "miniz_oxide", + "miniz_oxide 0.7.1", ] [[package]] @@ -1123,7 +1124,7 @@ checksum = "cef509aa9bc73864d6756f0d34d35504af3cf0844373afe9b8669a5b8005a729" dependencies = [ "console", "number_prefix", - "portable-atomic", + "portable-atomic 0.3.20", "unicode-width", ] @@ -1179,9 +1180,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.61" +version = "0.3.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" +checksum = "68c16e1bfd491478ab155fd8b4896b86f9ede344949b641e61501e07c2b8b4d5" dependencies = [ "wasm-bindgen", ] @@ -1258,7 +1259,7 @@ dependencies = [ "color-backtrace", "colored", "console", - "dirs 5.0.0", + "dirs 5.0.1", "indexmap", "lazy_static", "leo-ast", @@ -1358,15 +1359,15 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.141" +version = "0.2.144" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3304a64d199bb964be99741b7a14d26972741915b3649639149b2479bb46f4b5" +checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1" [[package]] name = "libz-sys" -version = "1.1.8" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9702761c3935f8cc2f101793272e202c72b99da8f4224a19ddcf1279a6450bbf" +checksum = "56ee889ecc9568871456d42f603d6a0ce59ff328d291063a45cbdf0036baf6db" dependencies = [ "cc", "libc", @@ -1382,9 +1383,9 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.3.2" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f508063cc7bb32987c71511216bd5a32be15bccb6a80b52df8b9d7f01fc3aa2" +checksum = "ece97ea872ece730aed82664c424eb4c8291e1ff2480247ccf7409044bc6479f" [[package]] name = "lock_api" @@ -1451,6 +1452,15 @@ dependencies = [ "adler", ] +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", +] + [[package]] name = "mio" version = "0.8.6" @@ -1525,7 +1535,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" dependencies = [ "proc-macro2 1.0.56", - "quote 1.0.26", + "quote 1.0.27", "syn 1.0.109", ] @@ -1603,9 +1613,9 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "openssl" -version = "0.10.50" +version = "0.10.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e30d8bc91859781f0a943411186324d580f2bbeb71b452fe91ae344806af3f1" +checksum = "01b8574602df80f7b85fdfc5392fa884a4e3b3f4f35402c070ab34c3d3f78d56" dependencies = [ "bitflags", "cfg-if", @@ -1623,7 +1633,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2 1.0.56", - "quote 1.0.26", + "quote 1.0.27", "syn 2.0.15", ] @@ -1635,9 +1645,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.85" +version = "0.9.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d3d193fb1488ad46ffe3aaabc912cc931d02ee8518fe2959aea8ef52718b0c0" +checksum = "8e17f59264b2809d77ae94f0e1ebabc434773f370d6ca667bd223ea10e06cc7e" dependencies = [ "cc", "libc", @@ -1645,6 +1655,12 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + [[package]] name = "os_str_bytes" version = "6.5.0" @@ -1729,9 +1745,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" [[package]] name = "plotters" @@ -1763,9 +1779,18 @@ dependencies = [ [[package]] name = "portable-atomic" -version = "0.3.19" +version = "0.3.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26f6a7b87c2e435a3241addceeeff740ff8b7e76b74c13bf9acb17fa454ea00b" +checksum = "e30165d31df606f5726b090ec7592c308a0eaf61721ff64c9a3018e344a8753e" +dependencies = [ + "portable-atomic 1.3.2", +] + +[[package]] +name = "portable-atomic" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc59d1bcc64fc5d021d67521f818db868368028108d37f0e98d74e33f68297b5" [[package]] name = "ppv-lite86" @@ -1809,7 +1834,7 @@ checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", "proc-macro2 1.0.56", - "quote 1.0.26", + "quote 1.0.27", "syn 1.0.109", "version_check", ] @@ -1821,7 +1846,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ "proc-macro2 1.0.56", - "quote 1.0.26", + "quote 1.0.27", "version_check", ] @@ -1869,9 +1894,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.26" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" +checksum = "8f4f29d145265ec1c483c7c654450edde0bfe043d3938d6972630663356d9500" dependencies = [ "proc-macro2 1.0.56", ] @@ -2059,9 +2084,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.37.12" +version = "0.37.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "722529a737f5a942fdbac3a46cee213053196737c5eaa3386d52e85b786f2659" +checksum = "acf8729d8542766f1b2cf77eb034d52f40d375bb8b615d0b147089946e16613d" dependencies = [ "bitflags", "errno", @@ -2205,7 +2230,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2a0814352fd64b58489904a44ea8d90cb1a91dcb6b4f5ebabc32c8318e93cb6" dependencies = [ "proc-macro2 1.0.56", - "quote 1.0.26", + "quote 1.0.27", "syn 2.0.15", ] @@ -2305,9 +2330,9 @@ dependencies = [ [[package]] name = "snarkvm" -version = "0.10.3" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afa4e5022a91f912bb9c2c74cb77a7057cdfea1b9b59340cfba4ba04da5f48c2" +checksum = "0733747b27c0c13370ef71c33d206e2e788677d4a863c4828cb489f83aeea5a3" dependencies = [ "anyhow", "clap", @@ -2322,6 +2347,7 @@ dependencies = [ "serde_json", "snarkvm-circuit", "snarkvm-console", + "snarkvm-ledger", "snarkvm-parameters", "snarkvm-synthesizer", "snarkvm-utilities", @@ -2332,12 +2358,13 @@ dependencies = [ [[package]] name = "snarkvm-algorithms" -version = "0.10.3" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daec4f2739a764af807573fbd862380f25e397b9679b3a62a8ed2681c5d17c40" +checksum = "c4539b42557946f73772158fe360e1f0e61e59839e329bfe34f8e31c0beaa57f" dependencies = [ "aleo-std", "anyhow", + "blake2", "hashbrown 0.13.2", "hex", "itertools", @@ -2359,9 +2386,9 @@ dependencies = [ [[package]] name = "snarkvm-circuit" -version = "0.10.3" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bc05d23a7439a2b70dbb6da9b5722d7fd46740bdbbd0806ca5c077ebfa22db6" +checksum = "db542b81a0d995266e102eb0a70ec4e18c92889cba3bbe8f7ec7a27b96808c5d" dependencies = [ "snarkvm-circuit-account", "snarkvm-circuit-algorithms", @@ -2374,9 +2401,9 @@ dependencies = [ [[package]] name = "snarkvm-circuit-account" -version = "0.10.3" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5009a900db17484e15fffa22d86fbcd39ed0f407bf1754cb44e9c56469a0004" +checksum = "9d0c9a441ade145328897c288b390b3f000e52cf9b03b03be9845a139577ce7b" dependencies = [ "snarkvm-circuit-algorithms", "snarkvm-circuit-network", @@ -2386,9 +2413,9 @@ dependencies = [ [[package]] name = "snarkvm-circuit-algorithms" -version = "0.10.3" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0cea5f64a3d32a2469ccf0aa460241e1f4c7128a0151789404eb0efbf11f5a8" +checksum = "40b74e1e320c4fc610bdd1348f09ba2c74268d28366555a06398c4dec87c4d32" dependencies = [ "snarkvm-circuit-types", "snarkvm-console-algorithms", @@ -2397,9 +2424,9 @@ dependencies = [ [[package]] name = "snarkvm-circuit-collections" -version = "0.10.3" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "989bb0f4a566995780b44c831e7494d4532cc6f0011f2e51f88efc5e059ec063" +checksum = "341214de970c417f21f797c6171a0be1cbc2b72837621c50623cb5c5eeb204a1" dependencies = [ "snarkvm-circuit-algorithms", "snarkvm-circuit-types", @@ -2408,9 +2435,9 @@ dependencies = [ [[package]] name = "snarkvm-circuit-environment" -version = "0.10.3" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a66dcfe220b1e603f6fd926ab313ca7d956db920ac04d40ea1ede9cc4cf0c9f0" +checksum = "25f1f88211ba3bf1be034bfda9dddd46a607fa954beda48abd297c203c0e40e1" dependencies = [ "indexmap", "itertools", @@ -2427,15 +2454,15 @@ dependencies = [ [[package]] name = "snarkvm-circuit-environment-witness" -version = "0.10.3" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23c0ca3db62f3cd3aed0e681dc94fa066c5469e2db7ef53d6cc5100a32e9dbe8" +checksum = "86cf62b7b8b91a536aee870d29dcd9ff2576281b77a0eeab43b6845ace576d5f" [[package]] name = "snarkvm-circuit-network" -version = "0.10.3" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35748c03088c414603f5f32201071a7562dcc2cec71f369ff6e99e93a9d19ac5" +checksum = "f4215138642ed88395ea9401632b72c392b034e85d315382e11e372617b4e2b1" dependencies = [ "snarkvm-circuit-algorithms", "snarkvm-circuit-collections", @@ -2445,9 +2472,9 @@ dependencies = [ [[package]] name = "snarkvm-circuit-program" -version = "0.10.3" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faeb830329d433b223ad371d43d606e49909cbe7ef0e649ee78d2101711bda72" +checksum = "e683f81eb66050c5cb90ac3f19f71c21d8ea3482c6c8b5ce7cee19a2824d579a" dependencies = [ "snarkvm-circuit-account", "snarkvm-circuit-collections", @@ -2459,9 +2486,9 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types" -version = "0.10.3" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be2cca147b12e931df0974a56977125f9ce9a9ae558061409291561aa7d8b220" +checksum = "fa0155f65e22e4d6e4012fad98c82e64b3c9fd541841917c813f205be14673ae" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-address", @@ -2475,9 +2502,9 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-address" -version = "0.10.3" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b855bffea2677103a4b9b04716c29e82d75b8fb4180326945deffa564055ac2" +checksum = "98ef3979802caabfd4445248a008e9d3ee8e80eeaac93185d8b3640c22f61d78" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -2489,9 +2516,9 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-boolean" -version = "0.10.3" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "257e8e0874dcc5666f584dc736bf22303c3768334fa0159f314c4df1b07f3b91" +checksum = "d7e75f004bc9942f6d521f8e463e449c890e27a0ca7a7a4fb5c2c3846baec8a1" dependencies = [ "snarkvm-circuit-environment", "snarkvm-console-types-boolean", @@ -2499,9 +2526,9 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-field" -version = "0.10.3" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67f1775ffcc509af58d35c801c832702b38522a8027f96dc481a9ab923987e16" +checksum = "f9169a67fc4225ce3b2c7d7378145206ab07edc352f571e95c9eb3c8dd21d7d2" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -2510,9 +2537,9 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-group" -version = "0.10.3" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "556dc70be48930d14455c78641cbb1178b7b85a3be974de3a875600c91a65ba6" +checksum = "ea1c1218c91a3f5951d71b0b8ea9aaab67bd2ecd8d5c84d2e272f6a4502637d7" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -2523,9 +2550,9 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-integers" -version = "0.10.3" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05207505c1b29aa7ec68d6f1c7b53e500ef31b4b28b5b402141b5ee712c5a749" +checksum = "6ba94b3e6ca71aeff076edf8f07146dad579c3946695c9ca89680ff00b92844c" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -2535,9 +2562,9 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-scalar" -version = "0.10.3" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a652f64d69286d7b55b64eac7075bc9b8b20cc22638d32393846006118b697" +checksum = "33e4a201fd7feab9ebd96dd2ecbfccfa67262a8933892bbc5009fbd461cf19d7" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -2547,9 +2574,9 @@ dependencies = [ [[package]] name = "snarkvm-circuit-types-string" -version = "0.10.3" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87b3b784c26fdd1b03460c08d76f4f371ba94e109dace1f578b49a5c9f4a060d" +checksum = "b34b61dd184847607e3e027beaadc3682d3f556039ec5edc72e63c018171cab6" dependencies = [ "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", @@ -2560,9 +2587,9 @@ dependencies = [ [[package]] name = "snarkvm-console" -version = "0.10.3" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e052aff3b4b7dd87e40649e1a67c32607a28862f3996e521ffbaa6d47ca05627" +checksum = "ae962985291e21c808a8f8e802e246a9903983de16a45cc50ba671f6a50f820e" dependencies = [ "snarkvm-console-account", "snarkvm-console-algorithms", @@ -2574,9 +2601,9 @@ dependencies = [ [[package]] name = "snarkvm-console-account" -version = "0.10.3" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc13177feb779755695125fe4019c9d2462d2d539a634b2c0926bc774b575fed" +checksum = "304e440c35509b8bc1dacb2a2cd930f3568bc22102e5da8ff64a8bd166e04cf4" dependencies = [ "bs58", "snarkvm-console-network", @@ -2585,9 +2612,9 @@ dependencies = [ [[package]] name = "snarkvm-console-algorithms" -version = "0.10.3" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7076dfeda91ea69a650581f403174971927ade3414e7be442b09b78d762dc66d" +checksum = "8aada08749da25dda8e18234735689e4464f9277ac4b73af2f4d9fb94d36ba53" dependencies = [ "blake2s_simd", "smallvec", @@ -2598,9 +2625,9 @@ dependencies = [ [[package]] name = "snarkvm-console-collections" -version = "0.10.3" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02d2604ecdacc5b8e0a29bb7e5fda1c2280cfc072b80d43c158131935d0725e4" +checksum = "7405b94ac9eb410584c7b9ad17b649ff34b547a631e4840fdaff4fd6c023b3a9" dependencies = [ "aleo-std", "rayon", @@ -2610,9 +2637,9 @@ dependencies = [ [[package]] name = "snarkvm-console-network" -version = "0.10.3" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "579e985d06b339671fe73cdca7462a5f73d06054a5289ad8a3044176c31f8e35" +checksum = "bf099f492f017ac2fbef86e56b46f0f7bda96d15ef92d86fafde78d3c334d597" dependencies = [ "anyhow", "indexmap", @@ -2634,9 +2661,9 @@ dependencies = [ [[package]] name = "snarkvm-console-network-environment" -version = "0.10.3" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27aa18e99237860f742c3a288bfbcd8247fd8c824333f95b08c365a341c1b783" +checksum = "7a0731b2e6ace0646044d015eb1c87b21a2af46a274f72b292cff10f717cba38" dependencies = [ "anyhow", "bech32", @@ -2652,9 +2679,9 @@ dependencies = [ [[package]] name = "snarkvm-console-program" -version = "0.10.3" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab20c7ff68c38ae1ac598eb318fc3da375eddecafaaaed8dd173feff09e1aa25" +checksum = "02d531ff830506c0db0af2c55cf35deb6a8fab70e7d1fc703cf028a922d4f623" dependencies = [ "enum_index", "enum_index_derive", @@ -2672,9 +2699,9 @@ dependencies = [ [[package]] name = "snarkvm-console-types" -version = "0.10.3" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6cdb36b1f7ad121aa01ef3bfcf35e40daef5d034ad59150249b97b8938b00d1" +checksum = "bdda5e625be7419925b5bc902a16562506e68b154b21d276f90efcc8f27b2ab0" dependencies = [ "snarkvm-console-network-environment", "snarkvm-console-types-address", @@ -2688,9 +2715,9 @@ dependencies = [ [[package]] name = "snarkvm-console-types-address" -version = "0.10.3" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50fd1809336ac21b8456dfb5552a29e9688e67cd3a4d4d2b8e4fce60d28e7642" +checksum = "289f431784fa3c0b5090326a42ea7344d6c8e3fc9a30702361bb68958ed53706" dependencies = [ "snarkvm-console-network-environment", "snarkvm-console-types-boolean", @@ -2700,18 +2727,18 @@ dependencies = [ [[package]] name = "snarkvm-console-types-boolean" -version = "0.10.3" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83640747b79eaeaf0c9a6349b9d8ade8d8b02fb6d39bd99cffc6d1cccb55151f" +checksum = "2a0ee78beaa195ee4f69eecb8692517675688d2a9ffaabf82dbe5ad90a8320e7" dependencies = [ "snarkvm-console-network-environment", ] [[package]] name = "snarkvm-console-types-field" -version = "0.10.3" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f83f1703d964ce81bce1022a4f2baea1abcac109fd72d71166cce8264facbf8" +checksum = "3521f238eb524123cbe38621ebbaa15edb75e8f5a732a2a7a51a6d99d45e1319" dependencies = [ "snarkvm-console-network-environment", "snarkvm-console-types-boolean", @@ -2719,9 +2746,9 @@ dependencies = [ [[package]] name = "snarkvm-console-types-group" -version = "0.10.3" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f2c0986e76846910b8f36a4c7135cecd2ce1520847832d560a6ed8fc8c1b541" +checksum = "7d944f762b85aac0da09f50535c4c0499c5281d8abfbc25b954de23ad1a8a617" dependencies = [ "snarkvm-console-network-environment", "snarkvm-console-types-boolean", @@ -2731,9 +2758,9 @@ dependencies = [ [[package]] name = "snarkvm-console-types-integers" -version = "0.10.3" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ade39308512bdc6964490702eeac6b417821ab45608719cb9e11ee8931f1a1bf" +checksum = "c42fffddf75c4cb0721a9adbe7b222f1874f6ba914fb766033df1a7b3376230d" dependencies = [ "snarkvm-console-network-environment", "snarkvm-console-types-boolean", @@ -2742,9 +2769,9 @@ dependencies = [ [[package]] name = "snarkvm-console-types-scalar" -version = "0.10.3" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "100997bb14a22277a5d416cae94b7378450834e3331adb042debbe8a9daae226" +checksum = "eae492eaa2ab9ccefa8446bf6c0ad84d095f9270c27d098237e243fcf6baa1eb" dependencies = [ "snarkvm-console-network-environment", "snarkvm-console-types-boolean", @@ -2753,9 +2780,9 @@ dependencies = [ [[package]] name = "snarkvm-console-types-string" -version = "0.10.3" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0a19a6f25af80508e85e897d6fb2e3f7b1bae6128d59830d42b3cf395f41f96" +checksum = "b0e2301ede80e3d79839fbe0ec8e00cb886f6d8d24b75a97d5927efbc3413d54" dependencies = [ "snarkvm-console-network-environment", "snarkvm-console-types-boolean", @@ -2765,9 +2792,9 @@ dependencies = [ [[package]] name = "snarkvm-curves" -version = "0.10.3" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8c63a96e1dde07d43c98bd1a99827f7c966ea9990cc3da3a161cd3af9b53a71" +checksum = "293df029bd87fde1ec68252c43076146b3b9ff3022591320570121c87930ea53" dependencies = [ "rand", "rayon", @@ -2780,9 +2807,9 @@ dependencies = [ [[package]] name = "snarkvm-fields" -version = "0.10.3" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c678435d564afc5ef9fd223b5205429ee793abc20eb04ce4f20207ebf1c35a6b" +checksum = "a0190dea38fee2d4407ad7be2e8e50c29a5676738454d9d989ea46f16771fca9" dependencies = [ "aleo-std", "anyhow", @@ -2797,10 +2824,28 @@ dependencies = [ ] [[package]] -name = "snarkvm-parameters" -version = "0.10.3" +name = "snarkvm-ledger" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bee37fdeaa5aa8d73c3f4cb53aaa46448b3797e45c67abba7ef81d42232ce846" +checksum = "93bd3a52c80c9ccf1fc4ffea85a3743dcdca6f50b9ed2c80f10e14f3fab3de3c" +dependencies = [ + "aleo-std", + "anyhow", + "indexmap", + "once_cell", + "parking_lot", + "rand", + "rayon", + "snarkvm-console", + "snarkvm-synthesizer", + "tracing", +] + +[[package]] +name = "snarkvm-parameters" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e570f7227d29d2da4c85b59950bf9169a817898b22968f499d11911c58388d5" dependencies = [ "aleo-std", "anyhow", @@ -2824,9 +2869,9 @@ dependencies = [ [[package]] name = "snarkvm-r1cs" -version = "0.10.3" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ee5c0ea55bc636cbcf63c76a88473790a0273ad307771d7dd8a0d0f1d5c0c44" +checksum = "e88e491876274dfb786145883d5c3719025cf831aab2ca26dff5ec1508abd7d8" dependencies = [ "anyhow", "cfg-if", @@ -2841,9 +2886,9 @@ dependencies = [ [[package]] name = "snarkvm-synthesizer" -version = "0.10.3" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59c77ba98bee558b0b646dfa876cfb0d71525ffee65b97ce32b92e2a21946d16" +checksum = "e03cb926f6c814d8ef661292bcc60f3f5cb8ad8fbddcb5b1eb12fa0d99b61a2d" dependencies = [ "aleo-std", "anyhow", @@ -2871,9 +2916,9 @@ dependencies = [ [[package]] name = "snarkvm-utilities" -version = "0.10.3" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "650db36f474fd2f7b845f54caa24c27323b84f721c55b05efb88e85520fe14fa" +checksum = "f8eade2bdb33028c435ffe10e2c9f34141f9c28c97369f40ba09e3dccccf68e8" dependencies = [ "aleo-std", "anyhow", @@ -2891,12 +2936,12 @@ dependencies = [ [[package]] name = "snarkvm-utilities-derives" -version = "0.10.3" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9562030dcbb00da42a6500eca56d8d660d17c2be8aa40a6032697903023ce74e" +checksum = "213ddab62fca16db98ad9159e4db6c71f24294e43c5e3d0dbe031ce048b1dc3c" dependencies = [ "proc-macro2 1.0.56", - "quote 1.0.26", + "quote 1.0.27", "syn 2.0.15", ] @@ -2957,7 +3002,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2 1.0.56", - "quote 1.0.26", + "quote 1.0.27", "unicode-ident", ] @@ -2968,7 +3013,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822" dependencies = [ "proc-macro2 1.0.56", - "quote 1.0.26", + "quote 1.0.27", "unicode-ident", ] @@ -3050,7 +3095,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2 1.0.56", - "quote 1.0.26", + "quote 1.0.27", "syn 2.0.15", ] @@ -3066,9 +3111,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.20" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd0cbfecb4d19b5ea75bb31ad904eb5b9fa13f21079c3b92017ebdf4999a5890" +checksum = "8f3403384eaacbca9923fa06940178ac13e4edb725486d70e8e15881d0c836cc" dependencies = [ "serde", "time-core", @@ -3076,9 +3121,9 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" +checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" [[package]] name = "tinytemplate" @@ -3107,9 +3152,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.27.0" +version = "1.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0de47a4eecbe11f498978a9b29d792f0d2692d1dd003650c24c76510e3bc001" +checksum = "0aa32867d44e6f2ce3385e89dceb990188b8bb0fb25b0cf576647a6f98ac5105" dependencies = [ "autocfg", "bytes", @@ -3118,7 +3163,7 @@ dependencies = [ "num_cpus", "pin-project-lite", "socket2", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -3133,9 +3178,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.7" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5427d89453009325de0d8f342c9490009f76e999cb7672d77e46267448f7e6b2" +checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" dependencies = [ "bytes", "futures-core", @@ -3208,13 +3253,13 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" +checksum = "0f57e3ca2a01450b1a921183a9c9cbfda207fd822cef4ccb00a65402cbba7a74" dependencies = [ "proc-macro2 1.0.56", - "quote 1.0.26", - "syn 1.0.109", + "quote 1.0.27", + "syn 2.0.15", ] [[package]] @@ -3408,9 +3453,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.84" +version = "0.2.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" +checksum = "5b6cb788c4e39112fbe1822277ef6fb3c55cd86b95cb3d3c4c1c9597e4ac74b4" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -3418,24 +3463,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.84" +version = "0.2.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" +checksum = "35e522ed4105a9d626d885b35d62501b30d9666283a5c8be12c14a8bdafe7822" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2 1.0.56", - "quote 1.0.26", - "syn 1.0.109", + "quote 1.0.27", + "syn 2.0.15", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.34" +version = "0.4.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f219e0d211ba40266969f6dbdd90636da12f75bee4fc9d6c23d1260dadb51454" +checksum = "083abe15c5d88556b77bdf7aef403625be9e327ad37c62c4e4129af740168163" dependencies = [ "cfg-if", "js-sys", @@ -3445,38 +3490,38 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.84" +version = "0.2.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" +checksum = "358a79a0cb89d21db8120cbfb91392335913e4890665b1a7981d9e956903b434" dependencies = [ - "quote 1.0.26", + "quote 1.0.27", "wasm-bindgen-macro-support", ] [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.84" +version = "0.2.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" +checksum = "4783ce29f09b9d93134d41297aded3a712b7b979e9c6f28c32cb88c973a94869" dependencies = [ "proc-macro2 1.0.56", - "quote 1.0.26", - "syn 1.0.109", + "quote 1.0.27", + "syn 2.0.15", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.84" +version = "0.2.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" +checksum = "a901d592cafaa4d711bc324edfaff879ac700b19c3dfd60058d2b445be2691eb" [[package]] name = "web-sys" -version = "0.3.61" +version = "0.3.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e33b99f4b23ba3eec1a53ac264e35a755f00e966e0065077d6027c0f575b0b97" +checksum = "16b5f940c7edfdc6d12126d98c9ef4d1b3d470011c47c76a6581df47ad9ba721" dependencies = [ "js-sys", "wasm-bindgen", @@ -3681,9 +3726,9 @@ checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" [[package]] name = "winnow" -version = "0.4.1" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae8970b36c66498d8ff1d66685dc86b91b29db0c7739899012f63a63814b4b28" +checksum = "61de7bac303dc551fe038e2b3cef0f571087a47571ea6e79a87692ac99b99699" dependencies = [ "memchr", ] diff --git a/Cargo.toml b/Cargo.toml index 47011fe003..1862b0e7c6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,10 +31,10 @@ members = [ ] [workspace.dependencies.snarkvm] -version = "0.10.3" +version = "0.11.0" [workspace.dependencies.snarkvm-console] -version = "0.10.3" +version = "0.11.0" [lib] path = "leo/lib.rs" diff --git a/compiler/ast/src/expressions/struct_init.rs b/compiler/ast/src/expressions/struct_init.rs index 4c32f3f71f..1bcc6f1179 100644 --- a/compiler/ast/src/expressions/struct_init.rs +++ b/compiler/ast/src/expressions/struct_init.rs @@ -57,7 +57,7 @@ impl StructExpression { pub fn check_record(&self) -> bool { let has_member = |symbol| self.members.iter().any(|variable| variable.identifier.name == symbol); - has_member(sym::owner) && has_member(sym::gates) && has_member(sym::_nonce) + has_member(sym::owner) && has_member(sym::_nonce) } /// Returns the struct as a record interface with visibility. diff --git a/compiler/compiler/tests/finalize.rs b/compiler/compiler/tests/finalize.rs deleted file mode 100644 index fbd5431f09..0000000000 --- a/compiler/compiler/tests/finalize.rs +++ /dev/null @@ -1,262 +0,0 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. -// This file is part of the Leo library. - -// The Leo library is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// The Leo library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with the Leo library. If not, see . - -mod utilities; -use utilities::{buffer_if_err, compile_and_process, get_cwd_option, parse_program, BufferEmitter, Network}; - -use crate::utilities::{get_build_options, hash_asts, hash_content, Aleo}; - -use leo_errors::emitter::Handler; -use leo_span::symbol::create_session_if_not_set_then; -use leo_test_framework::{ - runner::{Namespace, ParseType, Runner}, - Test, -}; - -use snarkvm::{console, prelude::*}; - -use leo_compiler::{CompilerOptions, OutputOptions}; -use leo_test_framework::test::TestExpectationMode; -use regex::Regex; -use serde::{Deserialize, Serialize}; -use serde_yaml::Value; -use std::{collections::BTreeMap, fs, path::Path, rc::Rc}; - -struct FinalizeNamespace; - -impl Namespace for FinalizeNamespace { - fn parse_type(&self) -> ParseType { - ParseType::Whole - } - - fn run_test(&self, test: Test) -> Result { - let buf = BufferEmitter(Rc::default(), Rc::default()); - let handler = Handler::new(Box::new(buf.clone())); - create_session_if_not_set_then(|_| { - run_test(test, &handler, &buf).map_err(|()| buf.0.take().to_string() + &buf.1.take().to_string()) - }) - } -} - -// TODO: Format this better. -#[derive(Deserialize, PartialEq, Eq, Serialize)] -struct FinalizeOutput { - pub initial_ast: String, - pub unrolled_ast: String, - pub ssa_ast: String, - pub flattened_ast: String, - pub inlined_ast: String, - pub dce_ast: String, - pub bytecode: String, - pub warnings: String, - pub initial_state: String, - pub results: BTreeMap>>, -} - -fn run_test(test: Test, handler: &Handler, err_buf: &BufferEmitter) -> Result { - // Check that config expectation is always pass. - if test.config.expectation != TestExpectationMode::Pass { - buffer_if_err(err_buf, Err("Test expectation must be `Pass` for `Finalize` tests.".to_string()))?; - } - - // Check for CWD option: - let cwd = get_cwd_option(&test); - - // Extract the compiler build configurations from the config file. - let build_options = get_build_options(&test.config); - - let mut outputs = Vec::with_capacity(build_options.len()); - - for build in build_options { - let compiler_options = CompilerOptions { - build, - output: OutputOptions { - spans_enabled: false, - initial_input_ast: true, - initial_ast: true, - unrolled_ast: true, - ssa_ast: true, - flattened_ast: true, - inlined_ast: true, - dce_ast: true, - }, - }; - - // Parse the program. - let mut parsed = - handler.extend_if_error(parse_program(handler, &test.content, cwd.clone(), Some(compiler_options)))?; - - // Compile the program to bytecode. - let bytecode = handler.extend_if_error(compile_and_process(&mut parsed))?; - println!("Bytecode: {}", bytecode); - let program = Program::::from_str(&bytecode).unwrap(); - let program_id = program.id(); - - // Extract the cases from the test config. - let all_cases = test - .config - .extra - .get("cases") - .expect("An `Finalize` config must have a `cases` field.") - .as_mapping() - .unwrap(); - - // Extract the initial state from the test config. - let initial_state = test - .config - .extra - .get("initial_state") - .expect("A `Finalize` config must have a `initial_state` field.") - .as_mapping() - .unwrap(); - - // Initialize the program storage. - let store = ProgramStore::<_, ProgramMemory>::open(None).unwrap(); - for (mapping_id, key_value_pairs) in initial_state { - // Initialize the mapping. - let mapping_name = Identifier::from_str(mapping_id.as_str().unwrap()).unwrap(); - store.initialize_mapping(program_id, &mapping_name).unwrap(); - - // Insert the key value pairs. - let key_value_pairs = key_value_pairs.as_sequence().unwrap(); - for pair in key_value_pairs { - let pair = pair.as_sequence().unwrap(); - assert!(pair.len() == 2); - store - .insert_key_value( - program_id, - &mapping_name, - Plaintext::::from_str(pair[0].as_str().unwrap()).unwrap(), - console::program::Value::::from_str(pair[1].as_str().unwrap()).unwrap(), - ) - .unwrap(); - } - } - - // Initialize a process. - let mut process = Process::load().unwrap(); - process.add_program(&program).unwrap(); - - // Initialize an rng. - let rng = &mut TestRng::default(); - - // Initialize a private key. - let private_key = PrivateKey::::new(rng).unwrap(); - - // Initialize a map for the expected results. - let mut results = BTreeMap::new(); - - // Run each test case for each function. - for (function_name, function_cases) in all_cases { - let function_name = Identifier::from_str(function_name.as_str().unwrap()).unwrap(); - let cases = function_cases.as_sequence().unwrap(); - let mut function_results = Vec::with_capacity(cases.len()); - - for case in cases { - let case = case.as_mapping().unwrap(); - let inputs: Vec<_> = case - .get(&Value::from("input")) - .unwrap() - .as_sequence() - .unwrap() - .iter() - .map(|input| console::program::Value::::from_str(input.as_str().unwrap()).unwrap()) - .collect(); - let input_string = format!("[{}]", inputs.iter().map(|input| input.to_string()).join(", ")); - - // Authorize the function call. - let authorization = - process.authorize::(&private_key, program_id, function_name, inputs.iter(), rng).unwrap(); - // Execute the function call. - let (response, execution, _, _) = process.execute::(authorization, rng).unwrap(); - // Finalize the function call. - let finalize_output_string = match process.finalize_execution(&store, &execution) { - Ok(_) => "Finalize was successful.".to_string(), - Err(err) => format!("SnarkVMError({err})"), - }; - - // TODO: Add support for custom config like custom private keys. - // Execute the program and get the outputs. - let execute_output = format!( - "[{}]", - response - .outputs() - .iter() - .map(|output| { - match output { - // Remove the `_nonce` from the record string. - console::program::Value::Record(record) => { - let pattern = Regex::new(r"_nonce: \d+group.public").unwrap(); - pattern.replace(&record.to_string(), "").to_string() - } - _ => output.to_string(), - } - }) - .join(", ") - ); - - // Store the inputs and outputs in a map. - let mut result = BTreeMap::new(); - result.insert("input".to_string(), input_string); - result.insert("execute_output".to_string(), execute_output); - result.insert("finalize_output".to_string(), finalize_output_string); - - // Add the hashes of the inputs and outputs to the function results. - function_results.push(result); - } - results.insert(function_name.to_string(), function_results); - } - - // Hash the ast files. - let (initial_ast, unrolled_ast, ssa_ast, flattened_ast, inlined_ast, dce_ast) = hash_asts(); - - // Clean up the output directory. - if fs::read_dir("/tmp/output").is_ok() { - fs::remove_dir_all(Path::new("/tmp/output")).expect("Error failed to clean up output dir."); - } - - let final_output = FinalizeOutput { - initial_ast, - unrolled_ast, - ssa_ast, - flattened_ast, - inlined_ast, - dce_ast, - bytecode: hash_content(&bytecode), - warnings: err_buf.1.take().to_string(), - initial_state: hash_content(&serde_yaml::to_string(&initial_state).unwrap()), - results, - }; - outputs.push(final_output) - } - Ok(serde_yaml::to_value(outputs).expect("serialization failed")) -} - -struct TestRunner; - -impl Runner for TestRunner { - fn resolve_namespace(&self, name: &str) -> Option> { - Some(match name { - "Finalize" => Box::new(FinalizeNamespace), - _ => return None, - }) - } -} - -#[test] -pub fn finalize_tests() { - leo_test_framework::run_tests(&TestRunner, "finalize"); -} diff --git a/compiler/passes/src/static_single_assignment/rename_expression.rs b/compiler/passes/src/static_single_assignment/rename_expression.rs index 1c63636005..d14cbbb195 100644 --- a/compiler/passes/src/static_single_assignment/rename_expression.rs +++ b/compiler/passes/src/static_single_assignment/rename_expression.rs @@ -193,21 +193,18 @@ impl ExpressionConsumer for StaticSingleAssigner<'_> { let mut member_map: IndexMap = members.into_iter().map(|member| (member.identifier.name, member)).collect(); - // If we are initializing a record, add the `owner` and `gates` fields, first and second respectively. + // If we are initializing a record, add the `owner` first. // Note that type checking guarantees that the above fields exist. if struct_definition.is_record { // Add the `owner` field. // Note that the `unwrap` is safe, since type checking guarantees that the member exists. reordered_members.push(member_map.remove(&sym::owner).unwrap()); - // Add the `gates` field. - // Note that the `unwrap` is safe, since type checking guarantees that the member exists. - reordered_members.push(member_map.remove(&sym::gates).unwrap()); } // For each member of the struct definition, push the corresponding member of the init expression. for member in &struct_definition.members { - // If the member is part of a record and it is `owner` or `gates`, then we have already added it. - if !(struct_definition.is_record && matches!(member.identifier.name, sym::owner | sym::gates)) { + // If the member is part of a record and it is `owner` then we have already added it. + if !(struct_definition.is_record && matches!(member.identifier.name, sym::owner)) { // Lookup and push the member of the init expression. // Note that the `unwrap` is safe, since type checking guarantees that the member exists. reordered_members.push(member_map.remove(&member.identifier.name).unwrap()); diff --git a/compiler/passes/src/static_single_assignment/rename_program.rs b/compiler/passes/src/static_single_assignment/rename_program.rs index 8ea86d587d..152e2db04c 100644 --- a/compiler/passes/src/static_single_assignment/rename_program.rs +++ b/compiler/passes/src/static_single_assignment/rename_program.rs @@ -37,7 +37,7 @@ use indexmap::IndexMap; impl StructConsumer for StaticSingleAssigner<'_> { type Output = Struct; - /// Reconstructs records in the program, ordering its fields such that `owner` and `gates` are the first and second fields, respectively. + /// Reconstructs records in the program, ordering its fields such that `owner` and is the first field. fn consume_struct(&mut self, struct_: Struct) -> Self::Output { match struct_.is_record { false => struct_, @@ -50,10 +50,6 @@ impl StructConsumer for StaticSingleAssigner<'_> { // Note that type checking ensures that the owner field exists. members.push(member_map.shift_remove(&sym::owner).unwrap()); - // Add the gates field to the beginning of the members list. - // Note that type checking ensures that the gates field exists. - members.push(member_map.shift_remove(&sym::gates).unwrap()); - // Add the remaining fields to the members list. members.extend(member_map.into_iter().map(|(_, member)| member)); diff --git a/compiler/passes/src/type_checking/check_program.rs b/compiler/passes/src/type_checking/check_program.rs index dd324396d2..f5a9588683 100644 --- a/compiler/passes/src/type_checking/check_program.rs +++ b/compiler/passes/src/type_checking/check_program.rs @@ -62,7 +62,19 @@ impl<'a> ProgramVisitor<'a> for TypeChecker<'a> { } // Typecheck each mapping definition. - input.mappings.values().for_each(|mapping| self.visit_mapping(mapping)); + let mut mapping_count = 0; + for mapping in input.mappings.values() { + self.visit_mapping(mapping); + mapping_count += 1; + } + + // Check that the number of mappings does not exceed the maximum. + if mapping_count > Testnet3::MAX_MAPPINGS { + self.emit_err(TypeCheckerError::too_many_mappings( + Testnet3::MAX_MAPPINGS, + input.program_id.name.span + input.program_id.network.span, + )); + } // Typecheck each function definitions. let mut transition_count = 0; @@ -104,7 +116,7 @@ impl<'a> ProgramVisitor<'a> for TypeChecker<'a> { }); } - // For records, enforce presence of `owner: Address` and `gates: u64` members. + // For records, enforce presence of the `owner: Address` member. if input.is_record { let check_has_field = |need, expected_ty: Type| match input.members.iter().find_map(|Member { identifier, type_, .. }| { diff --git a/compiler/span/src/symbol.rs b/compiler/span/src/symbol.rs index 373d941f3d..7fb48193aa 100644 --- a/compiler/span/src/symbol.rs +++ b/compiler/span/src/symbol.rs @@ -219,7 +219,6 @@ symbols! { public, private, owner, - gates, _nonce, program, diff --git a/errors/src/errors/type_checker/type_checker_error.rs b/errors/src/errors/type_checker/type_checker_error.rs index 8cb1335bac..ab9cf36ea2 100644 --- a/errors/src/errors/type_checker/type_checker_error.rs +++ b/errors/src/errors/type_checker/type_checker_error.rs @@ -594,4 +594,11 @@ create_messages!( msg: format!("A finalize block cannot return a value."), help: None, } + + @formatted + too_many_mappings { + args: (max: impl Display), + msg: format!("The number of mappings exceeds the maximum. snarkVM allows up to {max} mappings within a single program."), + help: None, + } ); diff --git a/examples/auction/inputs/auction.in b/examples/auction/inputs/auction.in index fa0d259904..c3471d4116 100644 --- a/examples/auction/inputs/auction.in +++ b/examples/auction/inputs/auction.in @@ -9,7 +9,6 @@ amount: u64 = 90u64; [resolve] first: Bid = Bid { owner: aleo1fxs9s0w97lmkwlcmgn0z3nuxufdee5yck9wqrs0umevp7qs0sg9q5xxxzh, - gates: 0u64, bidder: aleo1fxs9s0w97lmkwlcmgn0z3nuxufdee5yck9wqrs0umevp7qs0sg9q5xxxzh, amount: 10u64, is_winner: false, @@ -17,7 +16,6 @@ first: Bid = Bid { }; second: Bid = Bid { owner: aleo1fxs9s0w97lmkwlcmgn0z3nuxufdee5yck9wqrs0umevp7qs0sg9q5xxxzh, - gates: 0u64, bidder: aleo1fxs9s0w97lmkwlcmgn0z3nuxufdee5yck9wqrs0umevp7qs0sg9q5xxxzh, amount: 90u64, is_winner: false, @@ -27,7 +25,6 @@ second: Bid = Bid { [finish] bid: Bid = Bid { owner: aleo1fxs9s0w97lmkwlcmgn0z3nuxufdee5yck9wqrs0umevp7qs0sg9q5xxxzh, - gates: 0u64, bidder: aleo1fxs9s0w97lmkwlcmgn0z3nuxufdee5yck9wqrs0umevp7qs0sg9q5xxxzh, amount: 90u64, is_winner: false, diff --git a/examples/auction/run.sh b/examples/auction/run.sh index 7fd9f8d95e..88f1aeb1d9 100755 --- a/examples/auction/run.sh +++ b/examples/auction/run.sh @@ -112,14 +112,12 @@ echo " " leo run resolve "{ owner: aleo1fxs9s0w97lmkwlcmgn0z3nuxufdee5yck9wqrs0umevp7qs0sg9q5xxxzh.private, - gates: 0u64.private, bidder: aleo1yzlta2q5h8t0fqe0v6dyh9mtv4aggd53fgzr068jvplqhvqsnvzq7pj2ke.private, amount: 10u64.private, is_winner: false.private, _nonce: 4668394794828730542675887906815309351994017139223602571716627453741502624516group.public }" "{ owner: aleo1fxs9s0w97lmkwlcmgn0z3nuxufdee5yck9wqrs0umevp7qs0sg9q5xxxzh.private, - gates: 0u64.private, bidder: aleo1esqchvevwn7n5p84e735w4dtwt2hdtu4dpguwgwy94tsxm2p7qpqmlrta4.private, amount: 90u64.private, is_winner: false.private, @@ -142,7 +140,6 @@ echo " " leo run finish "{ owner: aleo1fxs9s0w97lmkwlcmgn0z3nuxufdee5yck9wqrs0umevp7qs0sg9q5xxxzh.private, - gates: 0u64.private, bidder: aleo1esqchvevwn7n5p84e735w4dtwt2hdtu4dpguwgwy94tsxm2p7qpqmlrta4.private, amount: 90u64.private, is_winner: false.private, diff --git a/examples/auction/src/main.leo b/examples/auction/src/main.leo index 0f1c30066d..873d361f0d 100644 --- a/examples/auction/src/main.leo +++ b/examples/auction/src/main.leo @@ -2,13 +2,11 @@ program auction.aleo { // A bid in an auction. // - `owner` : The address of the account that owns the record associated with this bid. // This is separate from the address of the account that placed the bid. - // - `gates` : The value associated with the record (always zero). // - `bidder` : The address of the account that placed the bid. // - `amount` : The amount of the bid. // - `is_winner` : Whether the bid is the winning bid. record Bid { owner: address, - gates: u64, bidder: address, amount: u64, is_winner: bool, @@ -26,7 +24,6 @@ program auction.aleo { // Return a new 'Bid' record for the auction bidder. return Bid { owner: aleo1fxs9s0w97lmkwlcmgn0z3nuxufdee5yck9wqrs0umevp7qs0sg9q5xxxzh, - gates: 0u64, bidder: bidder, amount: amount, is_winner: false, @@ -60,7 +57,6 @@ program auction.aleo { // Return 'is_winner' as 'true' in the winning 'Bid'. return Bid { owner: bid.bidder, - gates: bid.gates, bidder: bid.bidder, amount: bid.amount, is_winner: true, diff --git a/examples/basic_bank/inputs/basic_bank.in b/examples/basic_bank/inputs/basic_bank.in index cbac6c3fe4..69429846bb 100644 --- a/examples/basic_bank/inputs/basic_bank.in +++ b/examples/basic_bank/inputs/basic_bank.in @@ -7,7 +7,6 @@ amount: u64 = 1234u64; [deposit] token: Token = Token { owner: aleo1t0uer3jgtsgmx5tq6x6f9ecu8tr57rzzfnc2dgmcqldceal0ls9qf6st7a, - gates: 0u64, amount: 1234u64, _nonce: 0group, }; diff --git a/examples/basic_bank/run.sh b/examples/basic_bank/run.sh index b06c0e4554..c45b81c8ac 100755 --- a/examples/basic_bank/run.sh +++ b/examples/basic_bank/run.sh @@ -118,7 +118,6 @@ echo " " leo run deposit "{ owner: aleo1zeklp6dd8e764spe74xez6f8w27dlua3w7hl4z2uln03re52egpsv46ngg.private, - gates: 0u64.private, amount: 100u64.private, _nonce: 4668394794828730542675887906815309351994017139223602571716627453741502624516group.public }" 50u64 || exit diff --git a/examples/basic_bank/src/main.leo b/examples/basic_bank/src/main.leo index 218b7ea161..c0521caf65 100644 --- a/examples/basic_bank/src/main.leo +++ b/examples/basic_bank/src/main.leo @@ -1,11 +1,9 @@ program basic_bank.aleo { // A token, issued by a bank. // - 'owner' : The address of the account that owns the record associated with this token. - // - 'gates' : The value associated with the record (always zero). // - 'amount' : The amount of tokens owned by the account. record Token { owner: address, - gates: u64, amount: u64, } @@ -22,7 +20,6 @@ program basic_bank.aleo { assert_eq(self.caller, aleo1t0uer3jgtsgmx5tq6x6f9ecu8tr57rzzfnc2dgmcqldceal0ls9qf6st7a); return Token { owner: owner, - gates: 0u64, amount: amount, }; } @@ -36,7 +33,6 @@ program basic_bank.aleo { let remaining: Token = Token { owner: token.owner, - gates: token.gates, amount: difference, }; @@ -68,7 +64,6 @@ program basic_bank.aleo { let token: Token = Token { owner: recipient, - gates: 0u64, amount: total, }; diff --git a/examples/battleship/README.md b/examples/battleship/README.md index 9b24b07bf2..1b22a8e208 100644 --- a/examples/battleship/README.md +++ b/examples/battleship/README.md @@ -88,7 +88,6 @@ leo run initialize_board 34084860461056u64 551911718912u64 7u64 1157425104234217 • { owner: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private, - gates: 0u64.private, hits_and_misses: 0u64.private, played_tiles: 0u64.private, ships: 1157459741006397447u64.private, @@ -122,7 +121,6 @@ Now, we can offer a battleship game to player 2. Run `leo run offer_battleship ' ``` leo run offer_battleship '{ owner: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private, - gates: 0u64.private, hits_and_misses: 0u64.private, played_tiles: 0u64.private, ships: 1157459741006397447u64.private, @@ -139,7 +137,6 @@ leo run offer_battleship '{ • { owner: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private, - gates: 0u64.private, hits_and_misses: 0u64.private, played_tiles: 0u64.private, ships: 1157459741006397447u64.private, @@ -150,7 +147,6 @@ leo run offer_battleship '{ } • { owner: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private, - gates: 0u64.private, incoming_fire_coordinate: 0u64.private, player_1: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private, player_2: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private, @@ -198,7 +194,6 @@ leo run initialize_board 31u64 2207646875648u64 224u64 9042383626829824u64 aleo1 • { owner: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private, - gates: 0u64.private, hits_and_misses: 0u64.private, played_tiles: 0u64.private, ships: 9044591273705727u64.private, @@ -228,7 +223,6 @@ Now, we can accept Player 1's offer. Run `leo run start_battleship 'board_state. ```bash leo run start_battleship '{ owner: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private, - gates: 0u64.private, hits_and_misses: 0u64.private, played_tiles: 0u64.private, ships: 9044591273705727u64.private, @@ -238,7 +232,6 @@ leo run start_battleship '{ _nonce: 1549419609469324182591325047490602235361156298832591378925133482196483208807group.public }' '{ owner: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private, - gates: 0u64.private, incoming_fire_coordinate: 0u64.private, player_1: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private, player_2: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private, @@ -253,7 +246,6 @@ leo run start_battleship '{ • { owner: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private, - gates: 0u64.private, hits_and_misses: 0u64.private, played_tiles: 0u64.private, ships: 9044591273705727u64.private, @@ -264,7 +256,6 @@ leo run start_battleship '{ } • { owner: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private, - gates: 0u64.private, incoming_fire_coordinate: 0u64.private, player_1: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private, player_2: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private, @@ -287,7 +278,6 @@ Player 1 now makes the first real move: `leo run play 'board_state.record' 'move ```bash leo run play '{ owner: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private, - gates: 0u64.private, hits_and_misses: 0u64.private, played_tiles: 0u64.private, ships: 1157459741006397447u64.private, @@ -297,7 +287,6 @@ leo run play '{ _nonce: 6563064852163330630334088854834332804417910882908622526775624018226782316843group.public }' '{ owner: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private, - gates: 0u64.private, incoming_fire_coordinate: 0u64.private, player_1: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private, player_2: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private, @@ -311,7 +300,6 @@ leo run play '{ • { owner: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private, - gates: 0u64.private, hits_and_misses: 0u64.private, played_tiles: 1u64.private, ships: 1157459741006397447u64.private, @@ -322,7 +310,6 @@ leo run play '{ } • { owner: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private, - gates: 0u64.private, incoming_fire_coordinate: 1u64.private, player_1: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private, player_2: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private, @@ -346,7 +333,6 @@ and they will also let Player 1 know whether their fire coordinate hit or miss P ```bash leo run play '{ owner: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private, - gates: 0u64.private, hits_and_misses: 0u64.private, played_tiles: 0u64.private, ships: 9044591273705727u64.private, @@ -356,7 +342,6 @@ leo run play '{ _nonce: 6222383571142756260765569201308836492199048237638652378826141459336360362251group.public }' '{ owner: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private, - gates: 0u64.private, incoming_fire_coordinate: 1u64.private, player_1: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private, player_2: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private, @@ -372,7 +357,6 @@ leo run play '{ • { owner: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private, - gates: 0u64.private, hits_and_misses: 0u64.private, played_tiles: 2048u64.private, ships: 9044591273705727u64.private, @@ -383,7 +367,6 @@ leo run play '{ } • { owner: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private, - gates: 0u64.private, incoming_fire_coordinate: 2048u64.private, player_1: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private, player_2: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private, @@ -416,7 +399,6 @@ For example, running `aleo run play 'board_state.record' 'move.record' 1u64` wil ```bash leo run play '{ owner: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private, - gates: 0u64.private, hits_and_misses: 0u64.private, played_tiles: 1u64.private, ships: 1157459741006397447u64.private, @@ -426,7 +408,6 @@ leo run play '{ _nonce: 1474170213684980843727833284550698461565286563122422722760769547002894080093group.public }' '{ owner: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private, - gates: 0u64.private, incoming_fire_coordinate: 2048u64.private, player_1: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private, player_2: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private, @@ -441,7 +422,6 @@ leo run play '{ • { owner: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private, - gates: 0u64.private, hits_and_misses: 1u64.private, played_tiles: 3u64.private, ships: 1157459741006397447u64.private, @@ -452,7 +432,6 @@ leo run play '{ } • { owner: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private, - gates: 0u64.private, incoming_fire_coordinate: 2u64.private, player_1: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private, player_2: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private, @@ -485,7 +464,6 @@ The `board_state` record `hits_and_misses` component has also been updated with ```bash leo run play '{ owner: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private, - gates: 0u64.private, hits_and_misses: 0u64.private, played_tiles: 2048u64.private, ships: 9044591273705727u64.private, @@ -495,7 +473,6 @@ leo run play '{ _nonce: 5254963165391133332409074172682159033621708071536429341861038147524454777097group.public }' '{ owner: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private, - gates: 0u64.private, incoming_fire_coordinate: 2u64.private, player_1: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private, player_2: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private, @@ -510,7 +487,6 @@ leo run play '{ • { owner: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private, - gates: 0u64.private, hits_and_misses: 0u64.private, played_tiles: 2052u64.private, ships: 9044591273705727u64.private, @@ -521,7 +497,6 @@ leo run play '{ } • { owner: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private, - gates: 0u64.private, incoming_fire_coordinate: 4u64.private, player_1: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private, player_2: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private, diff --git a/examples/battleship/imports/board.leo b/examples/battleship/imports/board.leo index e9724f5342..70f82cde13 100644 --- a/examples/battleship/imports/board.leo +++ b/examples/battleship/imports/board.leo @@ -8,7 +8,6 @@ program board.aleo { // unplayed squares. record board_state { owner: address, - gates: u64, // The hits and misses registered on the opponent's board. hits_and_misses: u64, // The squares that have been played on the opponent's board. @@ -27,7 +26,6 @@ program board.aleo { ) -> board_state { return board_state { owner: self.caller, - gates: 0u64, hits_and_misses: 0u64, played_tiles: 0u64, ships, @@ -48,7 +46,6 @@ program board.aleo { return board_state { owner: board.owner, - gates: board.gates, hits_and_misses: board.hits_and_misses, played_tiles: board.played_tiles, ships: board.ships, @@ -81,7 +78,6 @@ program board.aleo { return board_state { owner: board.owner, - gates: board.gates, hits_and_misses: board.hits_and_misses, played_tiles, ships: board.ships, @@ -103,7 +99,6 @@ program board.aleo { return board_state { owner: board.owner, - gates: board.gates, hits_and_misses, played_tiles: board.played_tiles, ships: board.ships, diff --git a/examples/battleship/imports/move.leo b/examples/battleship/imports/move.leo index 412431e71c..f9676435d0 100644 --- a/examples/battleship/imports/move.leo +++ b/examples/battleship/imports/move.leo @@ -1,7 +1,6 @@ program move.aleo { record move { owner: address, - gates: u64, incoming_fire_coordinate: u64, player_1: address, player_2: address, @@ -24,7 +23,6 @@ program move.aleo { return move { owner: opponent, - gates: move_record.gates, incoming_fire_coordinate, player_1: move_record.player_2, player_2: move_record.player_1, @@ -37,7 +35,6 @@ program move.aleo { transition start_game(player_2: address) -> move { return move { owner: player_2, - gates: 0u64, incoming_fire_coordinate: 0u64, player_1: self.caller, player_2: player_2, diff --git a/examples/battleship/run.sh b/examples/battleship/run.sh index eb0596d833..6528cb36ae 100755 --- a/examples/battleship/run.sh +++ b/examples/battleship/run.sh @@ -45,7 +45,6 @@ echo " " leo run offer_battleship '{ owner: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private, - gates: 0u64.private, hits_and_misses: 0u64.private, played_tiles: 0u64.private, ships: 1157459741006397447u64.private, @@ -94,7 +93,6 @@ echo " " leo run start_battleship '{ owner: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private, - gates: 0u64.private, hits_and_misses: 0u64.private, played_tiles: 0u64.private, ships: 9044591273705727u64.private, @@ -104,7 +102,6 @@ leo run start_battleship '{ _nonce: 1549419609469324182591325047490602235361156298832591378925133482196483208807group.public }' '{ owner: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private, - gates: 0u64.private, incoming_fire_coordinate: 0u64.private, player_1: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private, player_2: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private, @@ -137,7 +134,6 @@ echo " leo run play '{ owner: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private, - gates: 0u64.private, hits_and_misses: 0u64.private, played_tiles: 0u64.private, ships: 1157459741006397447u64.private, @@ -147,7 +143,6 @@ echo " _nonce: 6563064852163330630334088854834332804417910882908622526775624018226782316843group.public }' '{ owner: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private, - gates: 0u64.private, incoming_fire_coordinate: 0u64.private, player_1: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private, player_2: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private, @@ -181,7 +176,6 @@ echo " leo run play '{ owner: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private, - gates: 0u64.private, hits_and_misses: 0u64.private, played_tiles: 0u64.private, ships: 9044591273705727u64.private, @@ -191,7 +185,6 @@ echo " _nonce: 6222383571142756260765569201308836492199048237638652378826141459336360362251group.public }' '{ owner: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private, - gates: 0u64.private, incoming_fire_coordinate: 1u64.private, player_1: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private, player_2: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private, @@ -225,7 +218,6 @@ echo " leo run play '{ owner: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private, - gates: 0u64.private, hits_and_misses: 0u64.private, played_tiles: 1u64.private, ships: 1157459741006397447u64.private, @@ -235,7 +227,6 @@ echo " _nonce: 1474170213684980843727833284550698461565286563122422722760769547002894080093group.public }' '{ owner: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private, - gates: 0u64.private, incoming_fire_coordinate: 2048u64.private, player_1: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private, player_2: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private, @@ -269,7 +260,6 @@ echo " leo run play '{ owner: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private, - gates: 0u64.private, hits_and_misses: 0u64.private, played_tiles: 2048u64.private, ships: 9044591273705727u64.private, @@ -279,7 +269,6 @@ echo " _nonce: 5254963165391133332409074172682159033621708071536429341861038147524454777097group.public }' '{ owner: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private, - gates: 0u64.private, incoming_fire_coordinate: 2u64.private, player_1: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private, player_2: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private, diff --git a/examples/simple_token/inputs/simple_token.in b/examples/simple_token/inputs/simple_token.in index 79c0455f11..1d12e9dcc2 100644 --- a/examples/simple_token/inputs/simple_token.in +++ b/examples/simple_token/inputs/simple_token.in @@ -6,7 +6,6 @@ amount: u64 = 100u64; [transfer] token: Token = Token { owner: aleo1ht2a9q0gsd38j0se4t9lsfulxgqrens2vgzgry3pkvs93xrrzu8s892zn7, - gates: 0u64, amount: 100u64, _nonce: 0group, }; diff --git a/examples/simple_token/src/main.leo b/examples/simple_token/src/main.leo index 7d14c063a2..de3012b069 100644 --- a/examples/simple_token/src/main.leo +++ b/examples/simple_token/src/main.leo @@ -4,8 +4,6 @@ program simple_token.aleo { record Token { // The token owner. owner: address, - // The Aleo balance (in gates). - gates: u64, // The token amount. amount: u64, } @@ -15,7 +13,6 @@ program simple_token.aleo { transition mint(owner: address, amount: u64) -> Token { return Token { owner: owner, - gates: 0u64, amount: amount, }; } @@ -33,14 +30,12 @@ program simple_token.aleo { // Produce a token record with the change amount for the sender. let remaining: Token = Token { owner: token.owner, - gates: token.gates, amount: difference, }; // Produce a token record for the specified receiver. let transferred: Token = Token { owner: to, - gates: 0u64, amount: amount, }; diff --git a/examples/token/build/main.aleo b/examples/token/build/main.aleo deleted file mode 100644 index 907bc1bb78..0000000000 --- a/examples/token/build/main.aleo +++ /dev/null @@ -1,77 +0,0 @@ -program token.aleo; - -record token: - owner as address.private; - gates as u64.private; - amount as u64.private; - -mapping account: - key left as address.public; - value right as u64.public; -function mint_public: - input r0 as address.public; - input r1 as u64.public; - - finalize r0 r1; - -finalize mint_public: - input r0 as address.public; - input r1 as u64.public; - increment account[r0] by r1; - -function mint_private: - input r0 as address.private; - input r1 as u64.private; - cast r0 0u64 r1 into r2 as token.record; - output r2 as token.record; - -function transfer_public: - input r0 as address.public; - input r1 as u64.public; - - finalize self.caller r0 r1; - -finalize transfer_public: - input r0 as address.public; - input r1 as address.public; - input r2 as u64.public; - decrement account[r0] by r2; - increment account[r1] by r2; - -function transfer_private: - input r0 as token.record; - input r1 as address.private; - input r2 as u64.private; - sub r0.amount r2 into r3; - cast r0.owner r0.gates r3 into r4 as token.record; - cast r1 0u64 r2 into r5 as token.record; - output r4 as token.record; - output r5 as token.record; - -function transfer_private_to_public: - input r0 as token.record; - input r1 as address.public; - input r2 as u64.public; - sub r0.amount r2 into r3; - cast r0.owner r0.gates r3 into r4 as token.record; - output r4 as token.record; - - finalize r1 r2; - -finalize transfer_private_to_public: - input r0 as address.public; - input r1 as u64.public; - increment account[r0] by r1; - -function transfer_public_to_private: - input r0 as address.public; - input r1 as u64.public; - cast r0 0u64 r1 into r2 as token.record; - output r2 as token.record; - - finalize self.caller r1; - -finalize transfer_public_to_private: - input r0 as address.public; - input r1 as u64.public; - decrement account[r0] by r1; diff --git a/examples/token/build/program.json b/examples/token/build/program.json deleted file mode 100644 index b0e2cf8fd9..0000000000 --- a/examples/token/build/program.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "program": "token.aleo", - "version": "0.0.0", - "description": "", - "development": { - "private_key": "APrivateKey1zkpBdMNxDsVVK1nHykGg6tKCpuqN6f1QqbKSMvL22BnmjGA", - "address": "aleo1pvmhrzm5tevxg7rrj65z6txpvm9stfgex05v4lfs05677n7e0cxqdk46jr" - }, - "license": "MIT" -} diff --git a/examples/token/inputs/token.in b/examples/token/inputs/token.in index f77a6905ff..54269295fb 100644 --- a/examples/token/inputs/token.in +++ b/examples/token/inputs/token.in @@ -14,7 +14,6 @@ amount: u64 = 50u64; [transfer_private] sender: token = token { owner: aleo1pvmhrzm5tevxg7rrj65z6txpvm9stfgex05v4lfs05677n7e0cxqdk46jr, - gates: 0u64, amount: 100u64, _nonce: 0group, }; @@ -24,7 +23,6 @@ amount: u64 = 50u64; [transfer_private_to_public] sender: token = token { owner: aleo1pvmhrzm5tevxg7rrj65z6txpvm9stfgex05v4lfs05677n7e0cxqdk46jr, - gates: 0u64, amount: 100u64, _nonce: 0group, }; diff --git a/examples/token/src/main.leo b/examples/token/src/main.leo index 74b2ca34ad..2f89bd8f8e 100644 --- a/examples/token/src/main.leo +++ b/examples/token/src/main.leo @@ -6,8 +6,6 @@ program token.aleo { record token { // The token owner. owner: address, - // The Aleo balance (in gates). - gates: u64, // The token amount. amount: u64, } @@ -32,7 +30,6 @@ program token.aleo { transition mint_private(receiver: address, amount: u64) -> token { return token { owner: receiver, - gates: 0u64, amount: amount, }; } @@ -66,14 +63,12 @@ program token.aleo { // Produce a token record with the change amount for the sender. let remaining: token = token { owner: sender.owner, - gates: sender.gates, amount: difference, }; // Produce a token record for the specified receiver. let transferred: token = token { owner: receiver, - gates: 0u64, amount: amount, }; @@ -92,7 +87,6 @@ program token.aleo { // Produces a token record with the change amount for the caller. let remaining: token = token { owner: sender.owner, - gates: sender.gates, amount: difference, }; @@ -115,7 +109,6 @@ program token.aleo { // Produces a token record for the token receiver. let transferred: token = token { owner: receiver, - gates: 0u64, amount: amount, }; diff --git a/examples/vote/README.md b/examples/vote/README.md index b92829ef7e..dedf9e1c39 100644 --- a/examples/vote/README.md +++ b/examples/vote/README.md @@ -40,7 +40,6 @@ Output sample: ``` { owner: aleo1kkk52quhnxgn2nfrcd9jqk7c9x27c23f2wvw7fyzcze56yahvcgszgttu2.private, - gates: 0u64.private, id: 2805252584833208809872967597325381727971256629741137995614832105537063464740field.private, info: { title: 2077160157502449938194577302446444field.private, @@ -70,7 +69,6 @@ Output sample: ``` { owner: aleo1kkk52quhnxgn2nfrcd9jqk7c9x27c23f2wvw7fyzcze56yahvcgszgttu2.private, - gates: 0u64.private, pid: 2264670486490520844857553240576860973319410481267184439818180411609250173817field.private, _nonce: 1637267040221574073903539416642641433705357302885235345311606754421919550724group.public } diff --git a/examples/vote/inputs/vote.in b/examples/vote/inputs/vote.in index 6b75b0b36a..bebf867d4c 100644 --- a/examples/vote/inputs/vote.in +++ b/examples/vote/inputs/vote.in @@ -13,7 +13,6 @@ voter: address = aleo1kkk52quhnxgn2nfrcd9jqk7c9x27c23f2wvw7fyzcze56yahvcgszgttu2 [agree] ticket: Ticket = Ticket { owner: aleo1kkk52quhnxgn2nfrcd9jqk7c9x27c23f2wvw7fyzcze56yahvcgszgttu2, - gates: 0u64, pid: 2264670486490520844857553240576860973319410481267184439818180411609250173817field, _nonce: 1637267040221574073903539416642641433705357302885235345311606754421919550724group }; @@ -21,7 +20,6 @@ ticket: Ticket = Ticket { [disagree] ticket: Ticket = Ticket { owner: aleo1kkk52quhnxgn2nfrcd9jqk7c9x27c23f2wvw7fyzcze56yahvcgszgttu2, - gates: 0u64, pid: 2264670486490520844857553240576860973319410481267184439818180411609250173817field, _nonce: 1637267040221574073903539416642641433705357302885235345311606754421919550724group -}; \ No newline at end of file +}; diff --git a/examples/vote/src/main.leo b/examples/vote/src/main.leo index ce9070f1ea..4ab3d785a8 100644 --- a/examples/vote/src/main.leo +++ b/examples/vote/src/main.leo @@ -10,7 +10,6 @@ program vote.aleo { // Proposal record records proposal info publicly record Proposal { owner: address, - gates: u64, id: field, info: ProposalInfo, } @@ -21,7 +20,6 @@ program vote.aleo { // Privacy tickets to vote record Ticket { owner: address, - gates: u64, pid: field, } @@ -45,7 +43,6 @@ program vote.aleo { // Finalize the proposal id. return Proposal { owner: self.caller, - gates: 0u64, id, info, } then finalize(id); @@ -64,7 +61,6 @@ program vote.aleo { // Finalize the proposal id for the ticket. return Ticket { owner: voter, - gates: 0u64, pid, } then finalize(pid); } diff --git a/tests/expectations/compiler/console/assert.out b/tests/expectations/compiler/console/assert.out index 5492102bc9..f8c3e1d9b0 100644 --- a/tests/expectations/compiler/console/assert.out +++ b/tests/expectations/compiler/console/assert.out @@ -2,11 +2,11 @@ namespace: Compile expectation: Pass outputs: - - - initial_ast: 75a36838e40b40528abbeb2a752b51db98a9eb6537aa3ec5d812a0e0ce3c64b9 - unrolled_ast: 75a36838e40b40528abbeb2a752b51db98a9eb6537aa3ec5d812a0e0ce3c64b9 - ssa_ast: 0c66a00da3384b853fd83ecb3747abf1101af0c39849fd75af793a68537f714d - flattened_ast: 7a2b73a748d86babab5ca7a4f9e513cfd028dcbadc7df8baeb7774ffb54c1b43 - inlined_ast: 7a2b73a748d86babab5ca7a4f9e513cfd028dcbadc7df8baeb7774ffb54c1b43 - dce_ast: 7a2b73a748d86babab5ca7a4f9e513cfd028dcbadc7df8baeb7774ffb54c1b43 - bytecode: 2d96971b7ff11cd865ed1b79ca417d062b970f3442cf9e6f53f033b5f258c556 + - - initial_ast: 2fcf759a6b067a1ab144a067c2a4ea41c49499febb7e6a5056dc25db633dd37c + unrolled_ast: 2fcf759a6b067a1ab144a067c2a4ea41c49499febb7e6a5056dc25db633dd37c + ssa_ast: a55cc6f9a1abaaa66e51ee6e9e946f6fbab282cc2e0ea1a48d6f1aa7da88dda1 + flattened_ast: fbb82b282d5fb0864a21f3a0f0271fdefa2b58fe80a3aba5c7307d5a9c5bfa68 + inlined_ast: fbb82b282d5fb0864a21f3a0f0271fdefa2b58fe80a3aba5c7307d5a9c5bfa68 + dce_ast: fbb82b282d5fb0864a21f3a0f0271fdefa2b58fe80a3aba5c7307d5a9c5bfa68 + bytecode: 3c391009be59588562aa4a34d1b00508cd253c94d35a66741962352c76a92633 warnings: "" diff --git a/tests/expectations/compiler/finalize/get_incorrect_num_operands.out b/tests/expectations/compiler/finalize/get_incorrect_num_operands.out index a152d762a4..6fdfe5ed98 100644 --- a/tests/expectations/compiler/finalize/get_incorrect_num_operands.out +++ b/tests/expectations/compiler/finalize/get_incorrect_num_operands.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EPAR0370021]: The type of `tokens` has no associated function `get` that takes 2 argument(s).\n --> compiler-test:19:9\n |\n 19 | tokens.get(true, true);\n | ^^^^^^^^^^^^^^^^^^^^^^\nError [EPAR0370021]: The type of `amounts` has no associated function `get` that takes 0 argument(s).\n --> compiler-test:21:9\n |\n 21 | amounts.get();\n | ^^^^^^^^^^^^^" + - "Error [EPAR0370021]: The type of `tokens` has no associated function `get` that takes 2 argument(s).\n --> compiler-test:18:9\n |\n 18 | tokens.get(true, true);\n | ^^^^^^^^^^^^^^^^^^^^^^\nError [EPAR0370021]: The type of `amounts` has no associated function `get` that takes 0 argument(s).\n --> compiler-test:20:9\n |\n 20 | amounts.get();\n | ^^^^^^^^^^^^^" diff --git a/tests/expectations/compiler/finalize/get_incorrect_type_fail.out b/tests/expectations/compiler/finalize/get_incorrect_type_fail.out index 571989b609..b578c81be1 100644 --- a/tests/expectations/compiler/finalize/get_incorrect_type_fail.out +++ b/tests/expectations/compiler/finalize/get_incorrect_type_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372030]: A mapping's value cannot be a record\n --> compiler-test:11:5\n |\n 11 | mapping tokens: address => Token;\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372007]: Expected one type from `address`, but got `boolean`\n --> compiler-test:18:30\n |\n 18 | Mapping::get(tokens, true);\n | ^^^^\nError [ETYC0372007]: Expected one type from `address`, but got `boolean`\n --> compiler-test:19:20\n |\n 19 | tokens.get(true);\n | ^^^^\nError [ETYC0372007]: Expected one type from `address`, but got `u8`\n --> compiler-test:20:31\n |\n 20 | Mapping::get(amounts, 1u8);\n | ^^^\nError [ETYC0372007]: Expected one type from `address`, but got `u8`\n --> compiler-test:21:21\n |\n 21 | amounts.get(1u8);\n | ^^^\n" + - "Error [ETYC0372030]: A mapping's value cannot be a record\n --> compiler-test:10:5\n |\n 10 | mapping tokens: address => Token;\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372007]: Expected one type from `address`, but got `boolean`\n --> compiler-test:17:30\n |\n 17 | Mapping::get(tokens, true);\n | ^^^^\nError [ETYC0372007]: Expected one type from `address`, but got `boolean`\n --> compiler-test:18:20\n |\n 18 | tokens.get(true);\n | ^^^^\nError [ETYC0372007]: Expected one type from `address`, but got `u8`\n --> compiler-test:19:31\n |\n 19 | Mapping::get(amounts, 1u8);\n | ^^^\nError [ETYC0372007]: Expected one type from `address`, but got `u8`\n --> compiler-test:20:21\n |\n 20 | amounts.get(1u8);\n | ^^^\n" diff --git a/tests/expectations/compiler/finalize/get_or_incorrect_num_operands.out b/tests/expectations/compiler/finalize/get_or_incorrect_num_operands.out index f809ce2522..fdadaf4ae0 100644 --- a/tests/expectations/compiler/finalize/get_or_incorrect_num_operands.out +++ b/tests/expectations/compiler/finalize/get_or_incorrect_num_operands.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EPAR0370021]: The type of `tokens` has no associated function `get_or_init` that takes 3 argument(s).\n --> compiler-test:19:9\n |\n 19 | tokens.get_or_init(addr, amount, 1u128);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nError [EPAR0370021]: The type of `amounts` has no associated function `get_or_init` that takes 1 argument(s).\n --> compiler-test:21:9\n |\n 21 | amounts.get_or_init(1u8);\n | ^^^^^^^^^^^^^^^^^^^^^^^^\nError [EPAR0370021]: The type of `amounts` has no associated function `get_or_init` that takes 0 argument(s).\n --> compiler-test:23:9\n |\n 23 | amounts.get_or_init();\n | ^^^^^^^^^^^^^^^^^^^^^" + - "Error [EPAR0370021]: The type of `tokens` has no associated function `get_or_init` that takes 3 argument(s).\n --> compiler-test:18:9\n |\n 18 | tokens.get_or_init(addr, amount, 1u128);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nError [EPAR0370021]: The type of `amounts` has no associated function `get_or_init` that takes 1 argument(s).\n --> compiler-test:20:9\n |\n 20 | amounts.get_or_init(1u8);\n | ^^^^^^^^^^^^^^^^^^^^^^^^\nError [EPAR0370021]: The type of `amounts` has no associated function `get_or_init` that takes 0 argument(s).\n --> compiler-test:22:9\n |\n 22 | amounts.get_or_init();\n | ^^^^^^^^^^^^^^^^^^^^^" diff --git a/tests/expectations/compiler/finalize/get_or_incorrect_type_fail.out b/tests/expectations/compiler/finalize/get_or_incorrect_type_fail.out index 448bfb2e68..ffb3469725 100644 --- a/tests/expectations/compiler/finalize/get_or_incorrect_type_fail.out +++ b/tests/expectations/compiler/finalize/get_or_incorrect_type_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372030]: A mapping's value cannot be a record\n --> compiler-test:11:5\n |\n 11 | mapping tokens: address => Token;\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372007]: Expected one type from `Token`, but got `u128`\n --> compiler-test:18:44\n |\n 18 | Mapping::get_or_init(tokens, addr, amount);\n | ^^^^^^\nError [ETYC0372007]: Expected one type from `Token`, but got `u128`\n --> compiler-test:19:34\n |\n 19 | tokens.get_or_init(addr, amount);\n | ^^^^^^\nError [ETYC0372007]: Expected one type from `address`, but got `u8`\n --> compiler-test:20:39\n |\n 20 | Mapping::get_or_init(amounts, 1u8, amount);\n | ^^^\nError [ETYC0372007]: Expected one type from `address`, but got `u8`\n --> compiler-test:21:29\n |\n 21 | amounts.get_or_init(1u8, amount);\n | ^^^\nError [ETYC0372007]: Expected one type from `u128`, but got `u8`\n --> compiler-test:22:45\n |\n 22 | Mapping::get_or_init(amounts, addr, 1u8);\n | ^^^\nError [ETYC0372007]: Expected one type from `u128`, but got `u8`\n --> compiler-test:23:35\n |\n 23 | amounts.get_or_init(addr, 1u8);\n | ^^^\nError [ETYC0372003]: Expected type `u64` but type `u8` was found\n --> compiler-test:24:72\n |\n 24 | Mapping::get_or_init(tokens, addr, Token { owner: addr, gates: 1u8, amount: 1u8 });\n | ^^^\nError [ETYC0372003]: Expected type `u128` but type `u8` was found\n --> compiler-test:24:85\n |\n 24 | Mapping::get_or_init(tokens, addr, Token { owner: addr, gates: 1u8, amount: 1u8 });\n | ^^^\nError [ETYC0372003]: Expected type `u64` but type `u8` was found\n --> compiler-test:25:62\n |\n 25 | tokens.get_or_init(addr, Token { owner: addr, gates: 1u8, amount: 1u8 });\n | ^^^\nError [ETYC0372003]: Expected type `u128` but type `u8` was found\n --> compiler-test:25:75\n |\n 25 | tokens.get_or_init(addr, Token { owner: addr, gates: 1u8, amount: 1u8 });\n | ^^^\nError [ETYC0372005]: Unknown variable `foo`\n --> compiler-test:26:30\n |\n 26 | Mapping::get_or_init(foo, addr, amount);\n | ^^^\nError [ETYC0372005]: Unknown variable `foo`\n --> compiler-test:27:9\n |\n 27 | foo.get_or_init(addr, amount);\n | ^^^\n" + - "Error [ETYC0372030]: A mapping's value cannot be a record\n --> compiler-test:10:5\n |\n 10 | mapping tokens: address => Token;\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372007]: Expected one type from `Token`, but got `u128`\n --> compiler-test:17:44\n |\n 17 | Mapping::get_or_init(tokens, addr, amount);\n | ^^^^^^\nError [ETYC0372007]: Expected one type from `Token`, but got `u128`\n --> compiler-test:18:34\n |\n 18 | tokens.get_or_init(addr, amount);\n | ^^^^^^\nError [ETYC0372007]: Expected one type from `address`, but got `u8`\n --> compiler-test:19:39\n |\n 19 | Mapping::get_or_init(amounts, 1u8, amount);\n | ^^^\nError [ETYC0372007]: Expected one type from `address`, but got `u8`\n --> compiler-test:20:29\n |\n 20 | amounts.get_or_init(1u8, amount);\n | ^^^\nError [ETYC0372007]: Expected one type from `u128`, but got `u8`\n --> compiler-test:21:45\n |\n 21 | Mapping::get_or_init(amounts, addr, 1u8);\n | ^^^\nError [ETYC0372007]: Expected one type from `u128`, but got `u8`\n --> compiler-test:22:35\n |\n 22 | amounts.get_or_init(addr, 1u8);\n | ^^^\nError [ETYC0372003]: Expected type `u128` but type `u8` was found\n --> compiler-test:23:73\n |\n 23 | Mapping::get_or_init(tokens, addr, Token { owner: addr, amount: 1u8 });\n | ^^^\nError [ETYC0372003]: Expected type `u128` but type `u8` was found\n --> compiler-test:24:63\n |\n 24 | tokens.get_or_init(addr, Token { owner: addr, amount: 1u8 });\n | ^^^\nError [ETYC0372005]: Unknown variable `foo`\n --> compiler-test:25:30\n |\n 25 | Mapping::get_or_init(foo, addr, amount);\n | ^^^\nError [ETYC0372005]: Unknown variable `foo`\n --> compiler-test:26:9\n |\n 26 | foo.get_or_init(addr, amount);\n | ^^^\n" diff --git a/tests/expectations/compiler/finalize/mapping_fail.out b/tests/expectations/compiler/finalize/mapping_fail.out index f6890bf304..7290cc5683 100644 --- a/tests/expectations/compiler/finalize/mapping_fail.out +++ b/tests/expectations/compiler/finalize/mapping_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372030]: A mapping's key cannot be a tuple\n --> compiler-test:4:5\n |\n 4 | mapping foo: (u32, u32) => u32;\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372017]: The type `baz` is not found in the current scope.\n --> compiler-test:6:5\n |\n 6 | mapping floo: baz => u8;\n | ^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372017]: The type `foo` is not found in the current scope.\n --> compiler-test:8:5\n |\n 8 | mapping floop: foo => foo;\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372017]: The type `foo` is not found in the current scope.\n --> compiler-test:8:5\n |\n 8 | mapping floop: foo => foo;\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372017]: The type `foo` is not found in the current scope.\n --> compiler-test:10:5\n |\n 10 | mapping bar: foo => baz;\n | ^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372017]: The type `baz` is not found in the current scope.\n --> compiler-test:10:5\n |\n 10 | mapping bar: foo => baz;\n | ^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372030]: A mapping's value cannot be a record\n --> compiler-test:21:5\n |\n 21 | mapping real_tokens: address => RealToken;\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372030]: A mapping's key cannot be a record\n --> compiler-test:23:5\n |\n 23 | mapping owners: RealToken => address;\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + - "Error [ETYC0372030]: A mapping's key cannot be a tuple\n --> compiler-test:4:5\n |\n 4 | mapping foo: (u32, u32) => u32;\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372017]: The type `baz` is not found in the current scope.\n --> compiler-test:6:5\n |\n 6 | mapping floo: baz => u8;\n | ^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372017]: The type `foo` is not found in the current scope.\n --> compiler-test:8:5\n |\n 8 | mapping floop: foo => foo;\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372017]: The type `foo` is not found in the current scope.\n --> compiler-test:8:5\n |\n 8 | mapping floop: foo => foo;\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372017]: The type `foo` is not found in the current scope.\n --> compiler-test:10:5\n |\n 10 | mapping bar: foo => baz;\n | ^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372017]: The type `baz` is not found in the current scope.\n --> compiler-test:10:5\n |\n 10 | mapping bar: foo => baz;\n | ^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372030]: A mapping's value cannot be a record\n --> compiler-test:19:5\n |\n 19 | mapping real_tokens: address => RealToken;\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372030]: A mapping's key cannot be a record\n --> compiler-test:21:5\n |\n 21 | mapping owners: RealToken => address;\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" diff --git a/tests/expectations/compiler/finalize/set_incorrect_num_operands.out b/tests/expectations/compiler/finalize/set_incorrect_num_operands.out index 665d33f1d7..d87b1cf97d 100644 --- a/tests/expectations/compiler/finalize/set_incorrect_num_operands.out +++ b/tests/expectations/compiler/finalize/set_incorrect_num_operands.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [EPAR0370021]: The type of `tokens` has no associated function `set` that takes 3 argument(s).\n --> compiler-test:19:9\n |\n 19 | tokens.set(addr, amount, 1u128);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nError [EPAR0370021]: The type of `amounts` has no associated function `set` that takes 1 argument(s).\n --> compiler-test:21:9\n |\n 21 | amounts.set(1u8);\n | ^^^^^^^^^^^^^^^^\nError [EPAR0370021]: The type of `amounts` has no associated function `set` that takes 0 argument(s).\n --> compiler-test:23:9\n |\n 23 | amounts.set();\n | ^^^^^^^^^^^^^" + - "Error [EPAR0370021]: The type of `tokens` has no associated function `set` that takes 3 argument(s).\n --> compiler-test:18:9\n |\n 18 | tokens.set(addr, amount, 1u128);\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nError [EPAR0370021]: The type of `amounts` has no associated function `set` that takes 1 argument(s).\n --> compiler-test:20:9\n |\n 20 | amounts.set(1u8);\n | ^^^^^^^^^^^^^^^^\nError [EPAR0370021]: The type of `amounts` has no associated function `set` that takes 0 argument(s).\n --> compiler-test:22:9\n |\n 22 | amounts.set();\n | ^^^^^^^^^^^^^" diff --git a/tests/expectations/compiler/finalize/set_incorrect_type_fail.out b/tests/expectations/compiler/finalize/set_incorrect_type_fail.out index 86682547ab..b8f4234c82 100644 --- a/tests/expectations/compiler/finalize/set_incorrect_type_fail.out +++ b/tests/expectations/compiler/finalize/set_incorrect_type_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372030]: A mapping's value cannot be a record\n --> compiler-test:11:5\n |\n 11 | mapping tokens: address => Token;\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372007]: Expected one type from `Token`, but got `u128`\n --> compiler-test:18:36\n |\n 18 | Mapping::set(tokens, addr, amount);\n | ^^^^^^\nError [ETYC0372007]: Expected one type from `Token`, but got `u128`\n --> compiler-test:19:26\n |\n 19 | tokens.set(addr, amount);\n | ^^^^^^\nError [ETYC0372007]: Expected one type from `address`, but got `u8`\n --> compiler-test:20:31\n |\n 20 | Mapping::set(amounts, 1u8, amount);\n | ^^^\nError [ETYC0372007]: Expected one type from `address`, but got `u8`\n --> compiler-test:21:21\n |\n 21 | amounts.set(1u8, amount);\n | ^^^\nError [ETYC0372007]: Expected one type from `u128`, but got `u8`\n --> compiler-test:22:37\n |\n 22 | Mapping::set(amounts, addr, 1u8);\n | ^^^\nError [ETYC0372007]: Expected one type from `u128`, but got `u8`\n --> compiler-test:23:27\n |\n 23 | amounts.set(addr, 1u8);\n | ^^^\nError [ETYC0372003]: Expected type `u64` but type `u8` was found\n --> compiler-test:24:64\n |\n 24 | Mapping::set(tokens, addr, Token { owner: addr, gates: 1u8, amount: 1u8 });\n | ^^^\nError [ETYC0372003]: Expected type `u128` but type `u8` was found\n --> compiler-test:24:77\n |\n 24 | Mapping::set(tokens, addr, Token { owner: addr, gates: 1u8, amount: 1u8 });\n | ^^^\nError [ETYC0372003]: Expected type `u64` but type `u8` was found\n --> compiler-test:25:54\n |\n 25 | tokens.set(addr, Token { owner: addr, gates: 1u8, amount: 1u8 });\n | ^^^\nError [ETYC0372003]: Expected type `u128` but type `u8` was found\n --> compiler-test:25:67\n |\n 25 | tokens.set(addr, Token { owner: addr, gates: 1u8, amount: 1u8 });\n | ^^^\nError [ETYC0372005]: Unknown variable `foo`\n --> compiler-test:26:22\n |\n 26 | Mapping::set(foo, addr, amount);\n | ^^^\nError [ETYC0372005]: Unknown variable `foo`\n --> compiler-test:27:9\n |\n 27 | foo.set(addr, amount);\n | ^^^\n" + - "Error [ETYC0372030]: A mapping's value cannot be a record\n --> compiler-test:10:5\n |\n 10 | mapping tokens: address => Token;\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nError [ETYC0372007]: Expected one type from `Token`, but got `u128`\n --> compiler-test:17:36\n |\n 17 | Mapping::set(tokens, addr, amount);\n | ^^^^^^\nError [ETYC0372007]: Expected one type from `Token`, but got `u128`\n --> compiler-test:18:26\n |\n 18 | tokens.set(addr, amount);\n | ^^^^^^\nError [ETYC0372007]: Expected one type from `address`, but got `u8`\n --> compiler-test:19:31\n |\n 19 | Mapping::set(amounts, 1u8, amount);\n | ^^^\nError [ETYC0372007]: Expected one type from `address`, but got `u8`\n --> compiler-test:20:21\n |\n 20 | amounts.set(1u8, amount);\n | ^^^\nError [ETYC0372007]: Expected one type from `u128`, but got `u8`\n --> compiler-test:21:37\n |\n 21 | Mapping::set(amounts, addr, 1u8);\n | ^^^\nError [ETYC0372007]: Expected one type from `u128`, but got `u8`\n --> compiler-test:22:27\n |\n 22 | amounts.set(addr, 1u8);\n | ^^^\nError [ETYC0372003]: Expected type `u128` but type `u8` was found\n --> compiler-test:23:65\n |\n 23 | Mapping::set(tokens, addr, Token { owner: addr, amount: 1u8 });\n | ^^^\nError [ETYC0372003]: Expected type `u128` but type `u8` was found\n --> compiler-test:24:55\n |\n 24 | tokens.set(addr, Token { owner: addr, amount: 1u8 });\n | ^^^\nError [ETYC0372005]: Unknown variable `foo`\n --> compiler-test:25:22\n |\n 25 | Mapping::set(foo, addr, amount);\n | ^^^\nError [ETYC0372005]: Unknown variable `foo`\n --> compiler-test:26:9\n |\n 26 | foo.set(addr, amount);\n | ^^^\n" diff --git a/tests/expectations/compiler/function/dead_code_elimination.out b/tests/expectations/compiler/function/dead_code_elimination.out index 56e35bbf3b..ff55cf8070 100644 --- a/tests/expectations/compiler/function/dead_code_elimination.out +++ b/tests/expectations/compiler/function/dead_code_elimination.out @@ -2,11 +2,11 @@ namespace: Compile expectation: Pass outputs: - - - initial_ast: d7414ef76b5d83ba8daed6e65487425048596937d5a6f783a313d3264d5db267 - unrolled_ast: d7414ef76b5d83ba8daed6e65487425048596937d5a6f783a313d3264d5db267 - ssa_ast: 6722ef50ccdf19eaaa57f68a249a6eb01ba78ec8ec60da0d8d664613324287aa - flattened_ast: 58ed29011b87aad89fe50f62402f441c9aa53fc2e18c3a188d94d0a88734236d - inlined_ast: 7ce8d6b0f22068cd9cf428040b3b55f08f7f890b09ed77c5f35d4ce10ed9232b - dce_ast: 48e52aa4ba7d5f4c5126ec93a14ec29772f80c73cc2d6ab5c77001f920b4c65b - bytecode: 737502f330fc737a1341eec9a9ac6c0abfc6a97e7ea588b082e4300ffb62380f + - - initial_ast: b9322b2961727d9350f00a48e478cd7cc3305e8b24d1a95f3daebb89979cdcd4 + unrolled_ast: b9322b2961727d9350f00a48e478cd7cc3305e8b24d1a95f3daebb89979cdcd4 + ssa_ast: a68e5b3047e2ae4e8a1a3293210794c1009a8cf85aee9f5a27f844c7e55b6ac4 + flattened_ast: f9b740fe83fe345f9341ba97ee2704917bf57f65ac442c98aca90f41457c8726 + inlined_ast: 98140fbd0bbf811404a993d34c80b08e352196fdfceec3e77683f7e78559f75b + dce_ast: 97bf25a5c2d84cec2332dbda4c1803c33abcc37eedfcabfb2019f42bf3b075ca + bytecode: 68f3c939bd54966a95293dd018927a50887a633eea6d5dc60fca8a1ba5400607 warnings: "" diff --git a/tests/expectations/compiler/function/function_returns_record_fail.out b/tests/expectations/compiler/function/function_returns_record_fail.out index fb11bef5d6..8d6c808c6f 100644 --- a/tests/expectations/compiler/function/function_returns_record_fail.out +++ b/tests/expectations/compiler/function/function_returns_record_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372064]: A `function` cannot output a record.\n --> compiler-test:10:45\n |\n 10 | function foo(board: Board, data: u8) -> Board {\n | ^^^^^\n" + - "Error [ETYC0372064]: A `function` cannot output a record.\n --> compiler-test:9:45\n |\n 9 | function foo(board: Board, data: u8) -> Board {\n | ^^^^^\n" diff --git a/tests/expectations/compiler/function/record_in_conditional_return.out b/tests/expectations/compiler/function/record_in_conditional_return.out index 4d1f2881dd..a37cf78310 100644 --- a/tests/expectations/compiler/function/record_in_conditional_return.out +++ b/tests/expectations/compiler/function/record_in_conditional_return.out @@ -2,11 +2,11 @@ namespace: Compile expectation: Pass outputs: - - - initial_ast: ab72e59b7e40857582bf8889a6e55d742d5c06dc7097883a25e040a8fe59ecb7 - unrolled_ast: ab72e59b7e40857582bf8889a6e55d742d5c06dc7097883a25e040a8fe59ecb7 - ssa_ast: e106c271385dba67b63dbaca5e89089ba7a311daaf82df652e61dab290e744a1 - flattened_ast: 0aac34997b32ff0aff5cdb3f62d6e5abe3de9bbb692ca8715d98b234b0e09633 - inlined_ast: 0aac34997b32ff0aff5cdb3f62d6e5abe3de9bbb692ca8715d98b234b0e09633 - dce_ast: 0aac34997b32ff0aff5cdb3f62d6e5abe3de9bbb692ca8715d98b234b0e09633 - bytecode: e6c71668ee7ddf9c510f9e4ab97c58fdff6c19cfd9923565a354e068d1439e55 + - - initial_ast: 1c9131af8bec6870a83ff8bf17753dc991709a9b89fadc15759f2910ef0f2f76 + unrolled_ast: 1c9131af8bec6870a83ff8bf17753dc991709a9b89fadc15759f2910ef0f2f76 + ssa_ast: 998f181b5d511b7de65ce5adc45128ed1bb179556379a8fe54536e88f9a6c961 + flattened_ast: eec4e32ae81554f04f5fd719f84ebc31570a2354af0d8ba06c8368f08c3202b9 + inlined_ast: eec4e32ae81554f04f5fd719f84ebc31570a2354af0d8ba06c8368f08c3202b9 + dce_ast: eec4e32ae81554f04f5fd719f84ebc31570a2354af0d8ba06c8368f08c3202b9 + bytecode: df0b33177844b8a8ca6a013bcf1de0535bb8b38b16bfcc9766d120af2bfc98d1 warnings: "" diff --git a/tests/expectations/compiler/mappings/max_mappings.out b/tests/expectations/compiler/mappings/max_mappings.out new file mode 100644 index 0000000000..7a03386f8c --- /dev/null +++ b/tests/expectations/compiler/mappings/max_mappings.out @@ -0,0 +1,12 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_ast: 439b99c38658af7a6e0a44900fd711923b4da86aed80839bc627fe210ba3ec26 + unrolled_ast: 439b99c38658af7a6e0a44900fd711923b4da86aed80839bc627fe210ba3ec26 + ssa_ast: 3cc47540dd38142f6f31534e0c55e3011c2b194bbe2069c9bcf68e58fa40d9b2 + flattened_ast: a9e8114a3220086ec1268259ddc538ec62abc68b20a0eaaf79228af03c8d5007 + inlined_ast: a9e8114a3220086ec1268259ddc538ec62abc68b20a0eaaf79228af03c8d5007 + dce_ast: a9e8114a3220086ec1268259ddc538ec62abc68b20a0eaaf79228af03c8d5007 + bytecode: b9f4013449f0c0c754435af754f6c68df5c36f26454f2a054e72e08e452cb891 + warnings: "" diff --git a/tests/expectations/compiler/mappings/too_many_mappings_fail.out b/tests/expectations/compiler/mappings/too_many_mappings_fail.out new file mode 100644 index 0000000000..0843ecf42c --- /dev/null +++ b/tests/expectations/compiler/mappings/too_many_mappings_fail.out @@ -0,0 +1,5 @@ +--- +namespace: Compile +expectation: Fail +outputs: + - "Error [ETYC0372072]: The number of mappings exceeds the maximum. snarkVM allows up to 31 mappings within a single program.\n --> compiler-test:3:9\n |\n 3 | program test.aleo {\n | ^^^^^^^^^\n" diff --git a/tests/expectations/compiler/records/balance_wrong_ty.out b/tests/expectations/compiler/records/balance_wrong_ty.out index 269a14b31d..69f4d12860 100644 --- a/tests/expectations/compiler/records/balance_wrong_ty.out +++ b/tests/expectations/compiler/records/balance_wrong_ty.out @@ -2,11 +2,11 @@ namespace: Compile expectation: Pass outputs: - - - initial_ast: bc6c3d26d53e50c2d9e55ca513f9f9ca5a51243e168abdabc519b6ab284ab4ca - unrolled_ast: bc6c3d26d53e50c2d9e55ca513f9f9ca5a51243e168abdabc519b6ab284ab4ca - ssa_ast: 9dec3f9ffc327edcbca8cd41fc43ed0ea547b2a21a83011561dcfa4eddc6f805 - flattened_ast: 14a0045dc7123f83d6ab8563c0ea931de77226a5debb18eb4f897e3a94c271ed - inlined_ast: 14a0045dc7123f83d6ab8563c0ea931de77226a5debb18eb4f897e3a94c271ed - dce_ast: 14a0045dc7123f83d6ab8563c0ea931de77226a5debb18eb4f897e3a94c271ed - bytecode: 4352ef3dcfd2e624a555a365a9f307cee9a66cf0efb3c7681eb4c0b0014fa403 + - - initial_ast: d10773343fac6c3799d719a277bcc88acba4dceadd46beb8243dd77bad469994 + unrolled_ast: d10773343fac6c3799d719a277bcc88acba4dceadd46beb8243dd77bad469994 + ssa_ast: 4c59ee1269dbd8a5e5b48192d93d427abe2f06f20bb1cc41d895bc620ba730a3 + flattened_ast: ad850f9ef141493ca7ce60c03e46ebf9ddc2aaf7bceed3f6592bad2849846f47 + inlined_ast: ad850f9ef141493ca7ce60c03e46ebf9ddc2aaf7bceed3f6592bad2849846f47 + dce_ast: ad850f9ef141493ca7ce60c03e46ebf9ddc2aaf7bceed3f6592bad2849846f47 + bytecode: c0e06b094899a8b986048ec322e2fccaf4812febf185e635cb734797a25a7626 warnings: "" diff --git a/tests/expectations/compiler/records/declaration.out b/tests/expectations/compiler/records/declaration.out index 77a28f4324..e9173ddcd2 100644 --- a/tests/expectations/compiler/records/declaration.out +++ b/tests/expectations/compiler/records/declaration.out @@ -2,11 +2,11 @@ namespace: Compile expectation: Pass outputs: - - - initial_ast: 706d6b698209729ccc81f63bfe77a4baf572bfbda4d4165b51ed2fd1bbf34442 - unrolled_ast: 706d6b698209729ccc81f63bfe77a4baf572bfbda4d4165b51ed2fd1bbf34442 - ssa_ast: 06ce227a097baf4d7c73465d58710ab217a1ce7c8d49c8e9ca644627e607703a - flattened_ast: 2f2798034c971938c91ed4422def44932cb6f657c62a56b79de431ca1f542fc2 - inlined_ast: 2f2798034c971938c91ed4422def44932cb6f657c62a56b79de431ca1f542fc2 - dce_ast: 2f2798034c971938c91ed4422def44932cb6f657c62a56b79de431ca1f542fc2 - bytecode: 07dc4694b8c8cff94cef0a4ea9ed3aaf27e874d9b26a91d8d5784cab20187bfb + - - initial_ast: d916e07c1b3a408ea44688618ba390cfe2e96122204a09ef7ea95aecf5b39153 + unrolled_ast: d916e07c1b3a408ea44688618ba390cfe2e96122204a09ef7ea95aecf5b39153 + ssa_ast: 9f7aafbfadc1500c575646f76695393748b81686ba78ae356a58ab93b4afd257 + flattened_ast: 6b35d3908459a4dc46ea617bfba1fab4bf1519fcfb0728f8fda1a4bb6bc903e1 + inlined_ast: 6b35d3908459a4dc46ea617bfba1fab4bf1519fcfb0728f8fda1a4bb6bc903e1 + dce_ast: 6b35d3908459a4dc46ea617bfba1fab4bf1519fcfb0728f8fda1a4bb6bc903e1 + bytecode: 567f936a9f498a3648860fa0c7028b9fe84c93e9843fc82865e39298bc99c525 warnings: "" diff --git a/tests/expectations/compiler/records/duplicate_var_fail.out b/tests/expectations/compiler/records/duplicate_var_fail.out index ec46e2156b..b0251f5aec 100644 --- a/tests/expectations/compiler/records/duplicate_var_fail.out +++ b/tests/expectations/compiler/records/duplicate_var_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372016]: Record Token defined with more than one variable with the same name.\n --> compiler-test:4:5\n |\n 4 | record Token {\n 5 | // The token owner.\n 6 | owner: address,\n 7 | // The token owner.\n 8 | owner: address, // Cannot define two record variables with the same name.\n 9 | // The Aleo balance (in gates).\n 10 | gates: u64,\n 11 | // The token amount.\n 12 | amount: u64,\n 13 | }\n | ^\n" + - "Error [ETYC0372016]: Record Token defined with more than one variable with the same name.\n --> compiler-test:4:5\n |\n 4 | record Token {\n 5 | // The token owner.\n 6 | owner: address,\n 7 | // The token owner.\n 8 | owner: address, // Cannot define two record variables with the same name.\n 9 | // The token amount.\n 10 | amount: u64,\n 11 | }\n | ^\n" diff --git a/tests/expectations/compiler/records/gates_is_allowed.out b/tests/expectations/compiler/records/gates_is_allowed.out new file mode 100644 index 0000000000..17adb777f6 --- /dev/null +++ b/tests/expectations/compiler/records/gates_is_allowed.out @@ -0,0 +1,12 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - - initial_ast: 3f8867e359f2447722d16322559bb75874ab823ebfb80f75b538865f64d28d93 + unrolled_ast: 3f8867e359f2447722d16322559bb75874ab823ebfb80f75b538865f64d28d93 + ssa_ast: 01d8390308277d2711be544ca4c4bf536df6a7a9ad5662093ae0635a50050d59 + flattened_ast: 72ba7fc102711bf3cb4f9d8c987edc766e7876bd24a0ec7794f6ddced0d35026 + inlined_ast: 72ba7fc102711bf3cb4f9d8c987edc766e7876bd24a0ec7794f6ddced0d35026 + dce_ast: 72ba7fc102711bf3cb4f9d8c987edc766e7876bd24a0ec7794f6ddced0d35026 + bytecode: 48e7881ab72ea8eaea757488386d315e8b5572f7ed34a5f1c70a5d19b2c4c481 + warnings: "" diff --git a/tests/expectations/compiler/records/init_expression.out b/tests/expectations/compiler/records/init_expression.out index 0a4466fda7..c4a9062fd2 100644 --- a/tests/expectations/compiler/records/init_expression.out +++ b/tests/expectations/compiler/records/init_expression.out @@ -2,11 +2,11 @@ namespace: Compile expectation: Pass outputs: - - - initial_ast: befe0cc5d37e961c86223e95440fc29b8eeda7f9e7b0573dc6d3f956d8a3ece6 - unrolled_ast: befe0cc5d37e961c86223e95440fc29b8eeda7f9e7b0573dc6d3f956d8a3ece6 - ssa_ast: d32dc9d291fad7846b373e76610e5e83f396126a90f40a7cf2f673cff6159a36 - flattened_ast: 93a108cdde1ece68c4c7c4a4f061bd14104dc985fda2fedaa3f4deab5dad6565 - inlined_ast: 93a108cdde1ece68c4c7c4a4f061bd14104dc985fda2fedaa3f4deab5dad6565 - dce_ast: 93a108cdde1ece68c4c7c4a4f061bd14104dc985fda2fedaa3f4deab5dad6565 - bytecode: a040c0026210ca23cfd255c7854d9ea01f1eebfaa58033a9ffb7f8dd99a4c8bb + - - initial_ast: e4233d80b488f02084141d66b4d3ad7ae78ad502d351801246f5d15b4cf838d7 + unrolled_ast: e4233d80b488f02084141d66b4d3ad7ae78ad502d351801246f5d15b4cf838d7 + ssa_ast: 8b4cd0a125a03d6d3ac37a577ec589fb0a1f03e5ecfd4d93efced590b4442f0c + flattened_ast: ce4433d4704259a6d569754a02bf47dca1b9324a787dd9c7a15118bf78b6b1db + inlined_ast: ce4433d4704259a6d569754a02bf47dca1b9324a787dd9c7a15118bf78b6b1db + dce_ast: 2aa5077b720b603dcc110365523db70743938b53bcfe017dc3ba3e54806709b2 + bytecode: f243717a23b7bcbf2e4656d741a9e43b8a60184892683964efb628e22e36e7f1 warnings: "" diff --git a/tests/expectations/compiler/records/init_expression_shorthand.out b/tests/expectations/compiler/records/init_expression_shorthand.out index b901ce8c18..1fc20c1718 100644 --- a/tests/expectations/compiler/records/init_expression_shorthand.out +++ b/tests/expectations/compiler/records/init_expression_shorthand.out @@ -2,11 +2,11 @@ namespace: Compile expectation: Pass outputs: - - - initial_ast: 5095cc2534f53b3d89023c125c9103d76ca3c32135c97cadb949db4474a28309 - unrolled_ast: 5095cc2534f53b3d89023c125c9103d76ca3c32135c97cadb949db4474a28309 - ssa_ast: 9cecc0f8f61a79f6c87a2c813e3af44ddd194a3433720689dcd5679d2a788443 - flattened_ast: d6db91d569b87edba60124cabfa970485d6dd0bc1767bf39109e91d2742eb22a - inlined_ast: d6db91d569b87edba60124cabfa970485d6dd0bc1767bf39109e91d2742eb22a - dce_ast: d6db91d569b87edba60124cabfa970485d6dd0bc1767bf39109e91d2742eb22a - bytecode: a040c0026210ca23cfd255c7854d9ea01f1eebfaa58033a9ffb7f8dd99a4c8bb + - - initial_ast: a25c7677daae998b8d02bf909af9d1c2c801dc8a9f4add7e5b0aa41f8a189330 + unrolled_ast: a25c7677daae998b8d02bf909af9d1c2c801dc8a9f4add7e5b0aa41f8a189330 + ssa_ast: a73b178cb60383c00720f4c5c708ca4ec57f27c195edecbe14f9f043a816881d + flattened_ast: ad5af5e933d455ebd4cac33b02cddd682900375eda223f905a5ee7d940d99800 + inlined_ast: ad5af5e933d455ebd4cac33b02cddd682900375eda223f905a5ee7d940d99800 + dce_ast: cc5a25c7cee7a62ec59af5de109aa28d0013fd93648a28b20b13d6115884d81d + bytecode: 0df6e3d77f2b3503e1b948582ccf17e40ef1cc0ba784bfb0ee91dd6388003630 warnings: "" diff --git a/tests/expectations/compiler/records/init_expression_type_fail.out b/tests/expectations/compiler/records/init_expression_type_fail.out index ad910a9a39..ba4f409d51 100644 --- a/tests/expectations/compiler/records/init_expression_type_fail.out +++ b/tests/expectations/compiler/records/init_expression_type_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372064]: A `function` cannot output a record.\n --> compiler-test:13:44\n |\n 13 | function mint(r0: address, r1: u64) -> Token {\n | ^^^^^\nError [ETYC0372003]: Expected type `address` but type `u64` was found\n --> compiler-test:15:20\n |\n 15 | owner: r1, // This variable should be type address.\n | ^^\nError [ETYC0372003]: Expected type `u64` but type `address` was found\n --> compiler-test:17:21\n |\n 17 | amount: r0, // This variable should be type u64.\n | ^^\nError [ETYC0372047]: Only `inline` can be called from a `function` or `inline`.\n --> compiler-test:23:24\n |\n 23 | let t: Token = mint(x, c);\n | ^^^^^^^^^^\n" + - "Error [ETYC0372064]: A `function` cannot output a record.\n --> compiler-test:11:44\n |\n 11 | function mint(r0: address, r1: u64) -> Token {\n | ^^^^^\nError [ETYC0372003]: Expected type `address` but type `u64` was found\n --> compiler-test:13:20\n |\n 13 | owner: r1, // This variable should be type address.\n | ^^\nError [ETYC0372003]: Expected type `u64` but type `address` was found\n --> compiler-test:14:21\n |\n 14 | amount: r0, // This variable should be type u64.\n | ^^\nError [ETYC0372047]: Only `inline` can be called from a `function` or `inline`.\n --> compiler-test:20:24\n |\n 20 | let t: Token = mint(x, c);\n | ^^^^^^^^^^\n" diff --git a/tests/expectations/compiler/records/init_expression_var_fail.out b/tests/expectations/compiler/records/init_expression_var_fail.out index df65c10f76..66a1997647 100644 --- a/tests/expectations/compiler/records/init_expression_var_fail.out +++ b/tests/expectations/compiler/records/init_expression_var_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372064]: A `function` cannot output a record.\n --> compiler-test:13:44\n |\n 13 | function mint(r0: address, r1: u64) -> Token {\n | ^^^^^\nError [ETYC0372013]: Struct initialization expression for `Token` is missing member `owner`.\n --> compiler-test:14:16\n |\n 14 | return Token {\n 15 | sender: r0, // This variable should be named `owner`.\n 16 | gates: 0u64,\n 17 | amount: r1,\n 18 | };\n | ^^^^^^\nError [ETYC0372047]: Only `inline` can be called from a `function` or `inline`.\n --> compiler-test:23:24\n |\n 23 | let t: Token = mint(x, c);\n | ^^^^^^^^^^\n" + - "Error [ETYC0372064]: A `function` cannot output a record.\n --> compiler-test:11:44\n |\n 11 | function mint(r0: address, r1: u64) -> Token {\n | ^^^^^\nError [ETYC0372013]: Struct initialization expression for `Token` is missing member `owner`.\n --> compiler-test:12:16\n |\n 12 | return Token {\n 13 | sender: r0, // This variable should be named `owner`.\n 14 | amount: r1,\n 15 | };\n | ^^^^^^\nError [ETYC0372047]: Only `inline` can be called from a `function` or `inline`.\n --> compiler-test:20:24\n |\n 20 | let t: Token = mint(x, c);\n | ^^^^^^^^^^\n" diff --git a/tests/expectations/compiler/records/nested_record.out b/tests/expectations/compiler/records/nested_record.out index 4cf43a2854..5d4ffb6578 100644 --- a/tests/expectations/compiler/records/nested_record.out +++ b/tests/expectations/compiler/records/nested_record.out @@ -2,11 +2,11 @@ namespace: Compile expectation: Pass outputs: - - - initial_ast: c134c752949c62a183432f6a7f466e8270be5592ade20d634a99796689d6db30 - unrolled_ast: c134c752949c62a183432f6a7f466e8270be5592ade20d634a99796689d6db30 - ssa_ast: 8e601ac48d9fddfdae521a6ffaedfed1cbfaa802bf1b81530f58f26d5cf67ead - flattened_ast: f88ab1e7c351cd90b5f49150df221c7c53e032e166e9d178a4d3524084e66b17 - inlined_ast: f88ab1e7c351cd90b5f49150df221c7c53e032e166e9d178a4d3524084e66b17 - dce_ast: f88ab1e7c351cd90b5f49150df221c7c53e032e166e9d178a4d3524084e66b17 - bytecode: cf5ec964f29718bf4af63705e5037202cc0f007a9bd6fa6fc510ecbbd66cd401 + - - initial_ast: d879f1239bcfd241d83aa9b047ae7db135192b9db7e62329ffb3ee2fd61e6b4d + unrolled_ast: d879f1239bcfd241d83aa9b047ae7db135192b9db7e62329ffb3ee2fd61e6b4d + ssa_ast: dfdc551d05a705f9048a3621d204e3f5a745ac83724366f797269416236c21da + flattened_ast: ef37b08dd44f8827bb3b3828f01fccb04ef39ebaf0352d1235c2a8009aa6d196 + inlined_ast: ef37b08dd44f8827bb3b3828f01fccb04ef39ebaf0352d1235c2a8009aa6d196 + dce_ast: bc021a92a42dee742df74b827a22ec7336c325d0a497dc13362de6b4fbf67864 + bytecode: 9477487eb30939ab953ae2b069d924cc89d50b2b1062bfad64dcb7c79d817b6f warnings: "" diff --git a/tests/expectations/compiler/records/nested_record_1_fail.out b/tests/expectations/compiler/records/nested_record_1_fail.out index 6256a4cd6a..33f8ab8047 100644 --- a/tests/expectations/compiler/records/nested_record_1_fail.out +++ b/tests/expectations/compiler/records/nested_record_1_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372029]: A struct or record cannot contain another record.\n --> compiler-test:13:9\n |\n 13 | foo: Foo,\n | ^^^\n |\n = Remove the record `Foo` from `Token`.\n" + - "Error [ETYC0372029]: A struct or record cannot contain another record.\n --> compiler-test:11:9\n |\n 11 | foo: Foo,\n | ^^^\n |\n = Remove the record `Foo` from `Token`.\n" diff --git a/tests/expectations/compiler/records/nested_record_2_fail.out b/tests/expectations/compiler/records/nested_record_2_fail.out index 1ff3e45459..0f628f316c 100644 --- a/tests/expectations/compiler/records/nested_record_2_fail.out +++ b/tests/expectations/compiler/records/nested_record_2_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372055]: A record cannot contain a tuple.\n --> compiler-test:8:9\n |\n 8 | foo: (Foo, Foo),\n | ^^^\nError [ETYC0372029]: A struct or record cannot contain another record.\n --> compiler-test:8:9\n |\n 8 | foo: (Foo, Foo),\n | ^^^\n |\n = Remove the record `Foo` from `Token2`.\nError [ETYC0372029]: A struct or record cannot contain another record.\n --> compiler-test:8:9\n |\n 8 | foo: (Foo, Foo),\n | ^^^\n |\n = Remove the record `Foo` from `Token2`.\n" + - "Error [ETYC0372055]: A record cannot contain a tuple.\n --> compiler-test:7:9\n |\n 7 | foo: (Foo, Foo),\n | ^^^\nError [ETYC0372029]: A struct or record cannot contain another record.\n --> compiler-test:7:9\n |\n 7 | foo: (Foo, Foo),\n | ^^^\n |\n = Remove the record `Foo` from `Token2`.\nError [ETYC0372029]: A struct or record cannot contain another record.\n --> compiler-test:7:9\n |\n 7 | foo: (Foo, Foo),\n | ^^^\n |\n = Remove the record `Foo` from `Token2`.\n" diff --git a/tests/expectations/compiler/records/nested_record_3_fail.out b/tests/expectations/compiler/records/nested_record_3_fail.out index a63b32f138..be800efadb 100644 --- a/tests/expectations/compiler/records/nested_record_3_fail.out +++ b/tests/expectations/compiler/records/nested_record_3_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372029]: A struct or record cannot contain another record.\n --> compiler-test:12:9\n |\n 12 | bar: Foo,\n | ^^^\n |\n = Remove the record `Foo` from `Bar`.\n" + - "Error [ETYC0372029]: A struct or record cannot contain another record.\n --> compiler-test:11:9\n |\n 11 | bar: Foo,\n | ^^^\n |\n = Remove the record `Foo` from `Bar`.\n" diff --git a/tests/expectations/compiler/records/nested_record_4_fail.out b/tests/expectations/compiler/records/nested_record_4_fail.out index 61485f0ccc..0296559455 100644 --- a/tests/expectations/compiler/records/nested_record_4_fail.out +++ b/tests/expectations/compiler/records/nested_record_4_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372055]: A record cannot contain a tuple.\n --> compiler-test:7:9\n |\n 7 | bar: (Bar, Bar),\n | ^^^\nError [ETYC0372055]: A struct cannot contain a tuple.\n --> compiler-test:11:9\n |\n 11 | bar: (Token, Token),\n | ^^^\nError [ETYC0372029]: A struct or record cannot contain another record.\n --> compiler-test:11:9\n |\n 11 | bar: (Token, Token),\n | ^^^\n |\n = Remove the record `Token` from `Bar`.\nError [ETYC0372029]: A struct or record cannot contain another record.\n --> compiler-test:11:9\n |\n 11 | bar: (Token, Token),\n | ^^^\n |\n = Remove the record `Token` from `Bar`.\n" + - "Error [ETYC0372055]: A record cannot contain a tuple.\n --> compiler-test:6:9\n |\n 6 | bar: (Bar, Bar),\n | ^^^\nError [ETYC0372055]: A struct cannot contain a tuple.\n --> compiler-test:10:9\n |\n 10 | bar: (Token, Token),\n | ^^^\nError [ETYC0372029]: A struct or record cannot contain another record.\n --> compiler-test:10:9\n |\n 10 | bar: (Token, Token),\n | ^^^\n |\n = Remove the record `Token` from `Bar`.\nError [ETYC0372029]: A struct or record cannot contain another record.\n --> compiler-test:10:9\n |\n 10 | bar: (Token, Token),\n | ^^^\n |\n = Remove the record `Token` from `Bar`.\n" diff --git a/tests/expectations/compiler/records/no_owner_fail.out b/tests/expectations/compiler/records/no_owner_fail.out index aaa4223708..4b6e8151eb 100644 --- a/tests/expectations/compiler/records/no_owner_fail.out +++ b/tests/expectations/compiler/records/no_owner_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372019]: The `record` type requires the variable `owner: address`.\n --> compiler-test:5:5\n |\n 5 | record Token {\n 6 | // The Aleo balance (in gates).\n 7 | gates: u64,\n 8 | // The token amount.\n 9 | amount: u64,\n 10 | }\n | ^\n" + - "Error [ETYC0372019]: The `record` type requires the variable `owner: address`.\n --> compiler-test:5:5\n |\n 5 | record Token {\n 6 | // The token amount.\n 7 | amount: u64,\n 8 | }\n | ^\n" diff --git a/tests/expectations/compiler/records/owner_wrong_ty.out b/tests/expectations/compiler/records/owner_wrong_ty.out index 08715447d6..ee9df20525 100644 --- a/tests/expectations/compiler/records/owner_wrong_ty.out +++ b/tests/expectations/compiler/records/owner_wrong_ty.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372020]: The field `owner` in a `record` must have type `address`.\n --> compiler-test:5:5\n |\n 5 | record Token {\n 6 | gates: u64,\n 7 | owner: bool,\n 8 | }\n | ^\n" + - "Error [ETYC0372020]: The field `owner` in a `record` must have type `address`.\n --> compiler-test:5:5\n |\n 5 | record Token {\n 6 | owner: bool,\n 7 | }\n | ^\n" diff --git a/tests/expectations/compiler/records/record_declaration_out_of_order.out b/tests/expectations/compiler/records/record_declaration_out_of_order.out index bc1abd0eb3..cc9d0fef05 100644 --- a/tests/expectations/compiler/records/record_declaration_out_of_order.out +++ b/tests/expectations/compiler/records/record_declaration_out_of_order.out @@ -2,11 +2,11 @@ namespace: Compile expectation: Pass outputs: - - - initial_ast: 2752eaa8193dc950ae07dbd8277c03fb924546879912afdc7c4709eb92155a1d - unrolled_ast: 2752eaa8193dc950ae07dbd8277c03fb924546879912afdc7c4709eb92155a1d - ssa_ast: 03392a93fef2cf4ac477a5850335d8a37939903c92ea49e58974ac0573dd447a - flattened_ast: ea4f399821484f56da2ed384f7530428dcf91f5dfd227c83a785d6a50f33167f - inlined_ast: ea4f399821484f56da2ed384f7530428dcf91f5dfd227c83a785d6a50f33167f - dce_ast: ea4f399821484f56da2ed384f7530428dcf91f5dfd227c83a785d6a50f33167f - bytecode: 07dc4694b8c8cff94cef0a4ea9ed3aaf27e874d9b26a91d8d5784cab20187bfb + - - initial_ast: d0efb41bcfc2af8a34bd42fdcb3c45700737427977c4738fd70eb5d1379a9d02 + unrolled_ast: d0efb41bcfc2af8a34bd42fdcb3c45700737427977c4738fd70eb5d1379a9d02 + ssa_ast: b844a3275485038f2488afc671ab7e7b581a6ec8009a297993766fb6ac1477f0 + flattened_ast: 518269a0d8fb855e056c6b0bbc7439e68120ef8cf1eb393376efe2d5fba0f939 + inlined_ast: 518269a0d8fb855e056c6b0bbc7439e68120ef8cf1eb393376efe2d5fba0f939 + dce_ast: 518269a0d8fb855e056c6b0bbc7439e68120ef8cf1eb393376efe2d5fba0f939 + bytecode: 567f936a9f498a3648860fa0c7028b9fe84c93e9843fc82865e39298bc99c525 warnings: "" diff --git a/tests/expectations/compiler/records/record_init_out_of_order.out b/tests/expectations/compiler/records/record_init_out_of_order.out index cf5cf44bd2..f5351e9c17 100644 --- a/tests/expectations/compiler/records/record_init_out_of_order.out +++ b/tests/expectations/compiler/records/record_init_out_of_order.out @@ -2,11 +2,11 @@ namespace: Compile expectation: Pass outputs: - - - initial_ast: 20ad25142425e428387351b1eae95763cd2bafc2aea81270944cca08c058ece4 - unrolled_ast: 20ad25142425e428387351b1eae95763cd2bafc2aea81270944cca08c058ece4 - ssa_ast: a87e55fe349912264137c0ac31434a9b0623c8701997d6930ab6e3e04f67bbe3 - flattened_ast: 265092b725660652360db1d5995f28356d800d264a512511dbc70d31068e4e77 - inlined_ast: 265092b725660652360db1d5995f28356d800d264a512511dbc70d31068e4e77 - dce_ast: 265092b725660652360db1d5995f28356d800d264a512511dbc70d31068e4e77 - bytecode: 6e6bc5ede7d5fe2fe82ca47f48097138485a6f8f2e4fe3649d23f67a5ef32173 + - - initial_ast: 7c49d3c6a73a533f42970d6c0eb9068d75922a6cf6b6cf366a80c083dc65c42d + unrolled_ast: 7c49d3c6a73a533f42970d6c0eb9068d75922a6cf6b6cf366a80c083dc65c42d + ssa_ast: 61053db22674f27f7f2cefefda51fd0cbb1bfd1f69511e81399ead44b8df4194 + flattened_ast: d390010c4fc85bbf35c9bf6c9b4dd6cfed81b4c743a052d613bd2231a2e78c22 + inlined_ast: d390010c4fc85bbf35c9bf6c9b4dd6cfed81b4c743a052d613bd2231a2e78c22 + dce_ast: d390010c4fc85bbf35c9bf6c9b4dd6cfed81b4c743a052d613bd2231a2e78c22 + bytecode: 8c8992021f4a3ff29c9d5b1ddb3a34e14878b9cd822ac6e470018a4e268b2769 warnings: "" diff --git a/tests/expectations/compiler/records/record_with_visibility.out b/tests/expectations/compiler/records/record_with_visibility.out index 2257554fb8..86ccf7e58c 100644 --- a/tests/expectations/compiler/records/record_with_visibility.out +++ b/tests/expectations/compiler/records/record_with_visibility.out @@ -2,11 +2,11 @@ namespace: Compile expectation: Pass outputs: - - - initial_ast: e48fe7856ecd5c90b2e8d425feb01da0f0876cca5385a8d1757beb5cbbb63564 - unrolled_ast: e48fe7856ecd5c90b2e8d425feb01da0f0876cca5385a8d1757beb5cbbb63564 - ssa_ast: f32921e1ad3a516b4b01cf14c25416dac730e600fdc85c7d35328a4e5e74d62c - flattened_ast: 365d9ac45a96dfdb3fd84bd8d01e0e0ace194c61fb9acf901756cea7c7be402b - inlined_ast: 365d9ac45a96dfdb3fd84bd8d01e0e0ace194c61fb9acf901756cea7c7be402b - dce_ast: 365d9ac45a96dfdb3fd84bd8d01e0e0ace194c61fb9acf901756cea7c7be402b - bytecode: 76d814dbae331736a5349613302761136daa646913749a981d84983f56a7ed72 + - - initial_ast: 2690be4baa2d9b376942d0a10e0d2c152a5230d7c9d2aebff8ac9b3a3d62751e + unrolled_ast: 2690be4baa2d9b376942d0a10e0d2c152a5230d7c9d2aebff8ac9b3a3d62751e + ssa_ast: 45ad49325c4442c88f674bacd4291b674d10bede9940e23847593dba58bba75b + flattened_ast: f49cfa1d664d35e6840d75ecf216b0e0f86572977c0bcad9a7a9fd08c8d8fec2 + inlined_ast: f49cfa1d664d35e6840d75ecf216b0e0f86572977c0bcad9a7a9fd08c8d8fec2 + dce_ast: f49cfa1d664d35e6840d75ecf216b0e0f86572977c0bcad9a7a9fd08c8d8fec2 + bytecode: b028178300130b3ccbbce4d1d496a8feb1e4ac876572588e646c6e220105ff70 warnings: "" diff --git a/tests/expectations/compiler/records/return_record_instead_of_unit_fail.out b/tests/expectations/compiler/records/return_record_instead_of_unit_fail.out index fe213d4d10..1ae17e2493 100644 --- a/tests/expectations/compiler/records/return_record_instead_of_unit_fail.out +++ b/tests/expectations/compiler/records/return_record_instead_of_unit_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372003]: Expected type `()` but type `test_credits` was found\n --> compiler-test:11:16\n |\n 11 | return test_credits {\n | ^^^^^^^^^^^^\n" + - "Error [ETYC0372003]: Expected type `()` but type `test_credits` was found\n --> compiler-test:10:16\n |\n 10 | return test_credits {\n | ^^^^^^^^^^^^\n" diff --git a/tests/expectations/compiler/statements/loop_non_literal_bound_fail.out b/tests/expectations/compiler/statements/loop_non_literal_bound_fail.out index bd6b2e6f8e..b905462e13 100644 --- a/tests/expectations/compiler/statements/loop_non_literal_bound_fail.out +++ b/tests/expectations/compiler/statements/loop_non_literal_bound_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372049]: Loop bound must be a literal.\n --> compiler-test:12:28\n |\n 12 | for i:u64 in 0u64..amount {\n | ^^^^^^\n" + - "Error [ETYC0372049]: Loop bound must be a literal.\n --> compiler-test:11:28\n |\n 11 | for i:u64 in 0u64..amount {\n | ^^^^^^\n" diff --git a/tests/expectations/compiler/tuple/tuple_in_record_fail.out b/tests/expectations/compiler/tuple/tuple_in_record_fail.out index 1dae4627f2..dee4a62852 100644 --- a/tests/expectations/compiler/tuple/tuple_in_record_fail.out +++ b/tests/expectations/compiler/tuple/tuple_in_record_fail.out @@ -2,4 +2,4 @@ namespace: Compile expectation: Fail outputs: - - "Error [ETYC0372055]: A record cannot contain a tuple.\n --> compiler-test:7:9\n |\n 7 | amounts: (u64, u64),\n | ^^^^^^^\n" + - "Error [ETYC0372055]: A record cannot contain a tuple.\n --> compiler-test:6:9\n |\n 6 | amounts: (u64, u64),\n | ^^^^^^^\n" diff --git a/tests/expectations/finalize/counter.out b/tests/expectations/execution/counter.out similarity index 54% rename from tests/expectations/finalize/counter.out rename to tests/expectations/execution/counter.out index e3c21c7353..6fa9ccf604 100644 --- a/tests/expectations/finalize/counter.out +++ b/tests/expectations/execution/counter.out @@ -1,5 +1,5 @@ --- -namespace: Finalize +namespace: Execute expectation: Pass outputs: - - initial_ast: 26abbb0ef61c47bd69f82f4ed0357583bad2ba031ee028400504bfc1f856e0bb @@ -10,18 +10,13 @@ outputs: dce_ast: 5cef23d00b994c5f0dc715ede94edae006730bebec809d1425d83418b287a811 bytecode: 2f96ec3248782d1a90f9b223eb25bce3770fb9894ecd8ee89d685936ba1ea86b warnings: "" - initial_state: c9ec5ff008d56bc287af2e780cc50f7132cc8c1feea397a90f86ed825e782454 results: dubble: - - execute_output: "[]" - finalize_output: Finalize was successful. - input: "[]" - - execute_output: "[]" - finalize_output: Finalize was successful. - input: "[]" - - execute_output: "[]" - finalize_output: Finalize was successful. - input: "[]" - - execute_output: "[]" - finalize_output: Finalize was successful. - input: "[]" + - input: "[]" + output: "[]" + - input: "[]" + output: "[]" + - input: "[]" + output: "[]" + - input: "[]" + output: "[]" diff --git a/tests/expectations/execution/mint.out b/tests/expectations/execution/mint.out index 703a1e031f..383265fbf7 100644 --- a/tests/expectations/execution/mint.out +++ b/tests/expectations/execution/mint.out @@ -2,17 +2,17 @@ namespace: Execute expectation: Pass outputs: - - - initial_ast: e192c70186fda9dc009e023b648bf336b7ebdfed0ec157fdaa7990776a3cbd89 - unrolled_ast: e192c70186fda9dc009e023b648bf336b7ebdfed0ec157fdaa7990776a3cbd89 - ssa_ast: 558e95d5d2b7baa877a0ad1278dfda0df761be90c58721fe3210fe4a89469a73 - flattened_ast: 23880e52eb60934d5bbf37d7a404435ff54f12eba673787df7c844dc37035f80 - inlined_ast: 23880e52eb60934d5bbf37d7a404435ff54f12eba673787df7c844dc37035f80 - dce_ast: 23880e52eb60934d5bbf37d7a404435ff54f12eba673787df7c844dc37035f80 - bytecode: d1f79755d5d49e093fefa3bed2a2e81482a103f4f0411fe8989868a3ac4fcf4c + - - initial_ast: d280acb4697e7a9ec03f4d4e59857240a0e5da3eabd475b0c24d3f40fc3eed92 + unrolled_ast: d280acb4697e7a9ec03f4d4e59857240a0e5da3eabd475b0c24d3f40fc3eed92 + ssa_ast: 1e5b51578e41dff5543775bf266034e7b502d48393a7c841e07583fac9949755 + flattened_ast: 808ad6aad5b5dc657fd57540169f09b9dcbace46e39df88a4ce9e31802273aff + inlined_ast: 808ad6aad5b5dc657fd57540169f09b9dcbace46e39df88a4ce9e31802273aff + dce_ast: 808ad6aad5b5dc657fd57540169f09b9dcbace46e39df88a4ce9e31802273aff + bytecode: d47819ba59e730eb159ee9e33fef5a35aac6062e70c743a749157d54824a45d9 warnings: "" results: mint: - input: "[aleo14lskz87tkqwwkyt2z44h64ave5gcwqs6yyfdztus37nupxsj8ypsmqsqcs, 0u64]" - output: "[{\n owner: aleo14lskz87tkqwwkyt2z44h64ave5gcwqs6yyfdztus37nupxsj8ypsmqsqcs.private,\n gates: 0u64.public,\n amount: 0u64.private,\n flag: true.constant,\n \n}]" + output: "[{\n owner: aleo14lskz87tkqwwkyt2z44h64ave5gcwqs6yyfdztus37nupxsj8ypsmqsqcs.private,\n amount: 0u64.private,\n flag: true.constant,\n \n}]" - input: "[aleo12keuztkg4cjzxx7hwwmrnnv85dkeqf8pjm877lf6f6lupma2pqrqcl2d8q, 1u64]" - output: "[{\n owner: aleo12keuztkg4cjzxx7hwwmrnnv85dkeqf8pjm877lf6f6lupma2pqrqcl2d8q.private,\n gates: 0u64.public,\n amount: 1u64.private,\n flag: true.constant,\n \n}]" + output: "[{\n owner: aleo12keuztkg4cjzxx7hwwmrnnv85dkeqf8pjm877lf6f6lupma2pqrqcl2d8q.private,\n amount: 1u64.private,\n flag: true.constant,\n \n}]" diff --git a/tests/expectations/parser/program/record_with_visibility.out b/tests/expectations/parser/program/record_with_visibility.out index ee190cc9cb..6e49bac08f 100644 --- a/tests/expectations/parser/program/record_with_visibility.out +++ b/tests/expectations/parser/program/record_with_visibility.out @@ -16,19 +16,12 @@ outputs: span: lo: 57 hi: 71 - - mode: Private - identifier: "{\"name\":\"gates\",\"span\":\"{\\\"lo\\\":89,\\\"hi\\\":94}\"}" - type_: - Integer: U64 - span: - lo: 89 - hi: 99 is_record: true span: lo: 26 - hi: 106 + hi: 78 mappings: {} functions: {} span: lo: 2 - hi: 108 + hi: 80 diff --git a/tests/tests/compiler/console/assert.leo b/tests/tests/compiler/console/assert.leo index 3d1df1ec8a..64c739e2e0 100644 --- a/tests/tests/compiler/console/assert.leo +++ b/tests/tests/compiler/console/assert.leo @@ -11,8 +11,6 @@ program test.aleo { record Token { // The token owner. owner: address, - // The Aleo balance (in gates). - gates: u64, // The token amount. amount: u64, } @@ -27,7 +25,6 @@ program test.aleo { assert_neq(token, Token { owner: aleo1lfapwg53y5enqpt0d8cnef4g8lj7l6g9uhkkma23qyv6jm4ppyfq50regr, - gates: 0u64, amount: 0u64, }); return a == true; diff --git a/tests/tests/compiler/finalize/get_incorrect_num_operands.leo b/tests/tests/compiler/finalize/get_incorrect_num_operands.leo index 6f9e2d6c72..625e2ff785 100644 --- a/tests/tests/compiler/finalize/get_incorrect_num_operands.leo +++ b/tests/tests/compiler/finalize/get_incorrect_num_operands.leo @@ -6,7 +6,6 @@ expectation: Fail program test.aleo { record Token { owner: address, - gates: u64, amount: u128, } diff --git a/tests/tests/compiler/finalize/get_incorrect_type_fail.leo b/tests/tests/compiler/finalize/get_incorrect_type_fail.leo index 68269771fb..76a913cb90 100644 --- a/tests/tests/compiler/finalize/get_incorrect_type_fail.leo +++ b/tests/tests/compiler/finalize/get_incorrect_type_fail.leo @@ -6,7 +6,6 @@ expectation: Fail program test.aleo { record Token { owner: address, - gates: u64, amount: u128, } diff --git a/tests/tests/compiler/finalize/get_or_incorrect_num_operands.leo b/tests/tests/compiler/finalize/get_or_incorrect_num_operands.leo index 9f40701f71..93ba83cac4 100644 --- a/tests/tests/compiler/finalize/get_or_incorrect_num_operands.leo +++ b/tests/tests/compiler/finalize/get_or_incorrect_num_operands.leo @@ -6,7 +6,6 @@ expectation: Fail program test.aleo { record Token { owner: address, - gates: u64, amount: u128, } diff --git a/tests/tests/compiler/finalize/get_or_incorrect_type_fail.leo b/tests/tests/compiler/finalize/get_or_incorrect_type_fail.leo index f2ef76f176..d53b747daa 100644 --- a/tests/tests/compiler/finalize/get_or_incorrect_type_fail.leo +++ b/tests/tests/compiler/finalize/get_or_incorrect_type_fail.leo @@ -6,7 +6,6 @@ expectation: Fail program test.aleo { record Token { owner: address, - gates: u64, amount: u128, } @@ -24,8 +23,8 @@ program test.aleo { amounts.get_or_init(1u8, amount); Mapping::get_or_init(amounts, addr, 1u8); amounts.get_or_init(addr, 1u8); - Mapping::get_or_init(tokens, addr, Token { owner: addr, gates: 1u8, amount: 1u8 }); - tokens.get_or_init(addr, Token { owner: addr, gates: 1u8, amount: 1u8 }); + Mapping::get_or_init(tokens, addr, Token { owner: addr, amount: 1u8 }); + tokens.get_or_init(addr, Token { owner: addr, amount: 1u8 }); Mapping::get_or_init(foo, addr, amount); foo.get_or_init(addr, amount); } diff --git a/tests/tests/compiler/finalize/mapping_fail.leo b/tests/tests/compiler/finalize/mapping_fail.leo index 12b3c360e9..452d5e5bd6 100644 --- a/tests/tests/compiler/finalize/mapping_fail.leo +++ b/tests/tests/compiler/finalize/mapping_fail.leo @@ -15,8 +15,6 @@ program test.aleo { record RealToken { // The token owner. owner: address, - // The Aleo balance (in gates). - gates: u64, // The token amount. amount: u64, } diff --git a/tests/tests/compiler/finalize/set_incorrect_num_operands.leo b/tests/tests/compiler/finalize/set_incorrect_num_operands.leo index 177d711146..88d7d8476f 100644 --- a/tests/tests/compiler/finalize/set_incorrect_num_operands.leo +++ b/tests/tests/compiler/finalize/set_incorrect_num_operands.leo @@ -6,7 +6,6 @@ expectation: Fail program test.aleo { record Token { owner: address, - gates: u64, amount: u128, } diff --git a/tests/tests/compiler/finalize/set_incorrect_type_fail.leo b/tests/tests/compiler/finalize/set_incorrect_type_fail.leo index fec5a1baec..41a71973cb 100644 --- a/tests/tests/compiler/finalize/set_incorrect_type_fail.leo +++ b/tests/tests/compiler/finalize/set_incorrect_type_fail.leo @@ -6,7 +6,6 @@ expectation: Fail program test.aleo { record Token { owner: address, - gates: u64, amount: u128, } @@ -24,8 +23,8 @@ program test.aleo { amounts.set(1u8, amount); Mapping::set(amounts, addr, 1u8); amounts.set(addr, 1u8); - Mapping::set(tokens, addr, Token { owner: addr, gates: 1u8, amount: 1u8 }); - tokens.set(addr, Token { owner: addr, gates: 1u8, amount: 1u8 }); + Mapping::set(tokens, addr, Token { owner: addr, amount: 1u8 }); + tokens.set(addr, Token { owner: addr, amount: 1u8 }); Mapping::set(foo, addr, amount); foo.set(addr, amount); } diff --git a/tests/tests/compiler/function/dead_code_elimination.leo b/tests/tests/compiler/function/dead_code_elimination.leo index 73d3ea66e4..1065368f81 100644 --- a/tests/tests/compiler/function/dead_code_elimination.leo +++ b/tests/tests/compiler/function/dead_code_elimination.leo @@ -10,7 +10,6 @@ program test.aleo; record dummy: owner as address.private; - gates as u64.private; data as u8.private; closure eliminate_unused_function_call: @@ -30,7 +29,6 @@ program test.aleo { record dummy { owner: address, - gates: u64, data: u8, } @@ -51,7 +49,6 @@ program test.aleo { } let f: dummy = dummy { owner: self.caller, - gates: 0u64, data: e, }; return a + b; diff --git a/tests/tests/compiler/function/function_returns_record_fail.leo b/tests/tests/compiler/function/function_returns_record_fail.leo index c4896f06be..55fbabb269 100644 --- a/tests/tests/compiler/function/function_returns_record_fail.leo +++ b/tests/tests/compiler/function/function_returns_record_fail.leo @@ -6,20 +6,18 @@ expectation: Fail program test.aleo { record Board { owner: address, - gates: u64, data: u8, } function foo(board: Board, data: u8) -> Board { return Board { owner: board.owner, - gates: board.gates, data: data, }; } function bar(board: Board) { - assert_eq(board.gates, 0u64); + assert_eq(board.data, 0u8); } transition main(board: Board) -> Board { diff --git a/tests/tests/compiler/function/record_in_conditional_return.leo b/tests/tests/compiler/function/record_in_conditional_return.leo index 52887fd967..f3085ba235 100644 --- a/tests/tests/compiler/function/record_in_conditional_return.leo +++ b/tests/tests/compiler/function/record_in_conditional_return.leo @@ -6,7 +6,6 @@ expectation: Pass program test.aleo { record Token { owner: address, - gates: u64, amount: u64 } @@ -18,14 +17,12 @@ program test.aleo { if(password_hash == password_hash_from_input){ return Token { owner: owner, - gates: 0u64, amount: amount }; } else { return Token { owner: owner, - gates: 0u64, amount: 0u64 }; } @@ -39,14 +36,12 @@ program test.aleo { if(password_hash == password_hash_from_input){ let token: Token = Token { owner: owner, - gates: 0u64, amount: amount }; return token; } return Token { owner: owner, - gates: 0u64, amount: 0u64 }; } diff --git a/tests/tests/compiler/mappings/max_mappings.leo b/tests/tests/compiler/mappings/max_mappings.leo new file mode 100644 index 0000000000..ab3e8947ca --- /dev/null +++ b/tests/tests/compiler/mappings/max_mappings.leo @@ -0,0 +1,43 @@ +/* +namespace: Compile +expectation: Pass +*/ + +program test.aleo { + + mapping one: field => field; + mapping two: field => field; + mapping three: field => field; + mapping four: field => field; + mapping five: field => field; + mapping six: field => field; + mapping seven: field => field; + mapping eight: field => field; + mapping nine: field => field; + mapping ten: field => field; + mapping eleven: field => field; + mapping twelve: field => field; + mapping thirteen: field => field; + mapping fourteen: field => field; + mapping fifteen: field => field; + mapping sixteen: field => field; + mapping seventeen: field => field; + mapping eighteen: field => field; + mapping nineteen: field => field; + mapping twenty: field => field; + mapping twentyone: field => field; + mapping twentytwo: field => field; + mapping twentythree: field => field; + mapping twentyfour: field => field; + mapping twentyfive: field => field; + mapping twentysix: field => field; + mapping twentyseven: field => field; + mapping twentyeight: field => field; + mapping twentynine: field => field; + mapping thirty: field => field; + mapping thirtyone: field => field; + + transition foo() -> u8 { + return 1u8 + 1u8; + } +} diff --git a/tests/tests/compiler/mappings/too_many_mappings_fail.leo b/tests/tests/compiler/mappings/too_many_mappings_fail.leo new file mode 100644 index 0000000000..d89c0e0468 --- /dev/null +++ b/tests/tests/compiler/mappings/too_many_mappings_fail.leo @@ -0,0 +1,44 @@ +/* +namespace: Compile +expectation: Fail +*/ + +program test.aleo { + + mapping one: field => field; + mapping two: field => field; + mapping three: field => field; + mapping four: field => field; + mapping five: field => field; + mapping six: field => field; + mapping seven: field => field; + mapping eight: field => field; + mapping nine: field => field; + mapping ten: field => field; + mapping eleven: field => field; + mapping twelve: field => field; + mapping thirteen: field => field; + mapping fourteen: field => field; + mapping fifteen: field => field; + mapping sixteen: field => field; + mapping seventeen: field => field; + mapping eighteen: field => field; + mapping nineteen: field => field; + mapping twenty: field => field; + mapping twentyone: field => field; + mapping twentytwo: field => field; + mapping twentythree: field => field; + mapping twentyfour: field => field; + mapping twentyfive: field => field; + mapping twentysix: field => field; + mapping twentyseven: field => field; + mapping twentyeight: field => field; + mapping twentynine: field => field; + mapping thirty: field => field; + mapping thirtyone: field => field; + mapping thirtytwo: field => field; + + transition foo() -> u8 { + return 1u8 + 1u8; + } +} diff --git a/tests/tests/compiler/records/balance_wrong_ty.leo b/tests/tests/compiler/records/balance_wrong_ty.leo index f2fba8d08a..b2f5033a94 100644 --- a/tests/tests/compiler/records/balance_wrong_ty.leo +++ b/tests/tests/compiler/records/balance_wrong_ty.leo @@ -5,7 +5,6 @@ expectation: Pass program test.aleo { record Token { - gates: address, owner: address, } diff --git a/tests/tests/compiler/records/declaration.leo b/tests/tests/compiler/records/declaration.leo index 5192dd87ee..d9563653ce 100644 --- a/tests/tests/compiler/records/declaration.leo +++ b/tests/tests/compiler/records/declaration.leo @@ -8,8 +8,6 @@ program test.aleo { record Token { // The token owner. owner: address, - // The Aleo balance (in gates). - gates: u64, // The token amount. amount: u64, } diff --git a/tests/tests/compiler/records/duplicate_circuit_name_fail.leo b/tests/tests/compiler/records/duplicate_circuit_name_fail.leo index d6331948a5..a2b543f646 100644 --- a/tests/tests/compiler/records/duplicate_circuit_name_fail.leo +++ b/tests/tests/compiler/records/duplicate_circuit_name_fail.leo @@ -7,8 +7,6 @@ program test.aleo { record Token { // The token owner. owner: address, - // The Aleo balance (in gates). - gates: u64, // The token amount. amount: u64, } diff --git a/tests/tests/compiler/records/duplicate_var_fail.leo b/tests/tests/compiler/records/duplicate_var_fail.leo index 0dfff92858..28149a2c41 100644 --- a/tests/tests/compiler/records/duplicate_var_fail.leo +++ b/tests/tests/compiler/records/duplicate_var_fail.leo @@ -9,8 +9,6 @@ program test.aleo { owner: address, // The token owner. owner: address, // Cannot define two record variables with the same name. - // The Aleo balance (in gates). - gates: u64, // The token amount. amount: u64, } diff --git a/tests/tests/compiler/records/gates_is_allowed.leo b/tests/tests/compiler/records/gates_is_allowed.leo new file mode 100644 index 0000000000..5e84acbfa8 --- /dev/null +++ b/tests/tests/compiler/records/gates_is_allowed.leo @@ -0,0 +1,19 @@ +/* +namespace: Compile +expectation: Pass +*/ + +program test.aleo { + record Token { + // The token owner. + owner: address, + // The token amount. + amount: u64, + // `gates` as a normal field. + gates: u64, + } + + transition main(a: u8, b:u8) -> u8 { + return a + b; + } +} diff --git a/tests/tests/compiler/records/init_expression.leo b/tests/tests/compiler/records/init_expression.leo index 7a8d679bad..5648fd874c 100644 --- a/tests/tests/compiler/records/init_expression.leo +++ b/tests/tests/compiler/records/init_expression.leo @@ -7,8 +7,6 @@ program test.aleo { record Token { // The token owner. owner: address, - // The Aleo balance (in gates). - gates: u64, // The token amount. amount: u64, } @@ -16,14 +14,13 @@ program test.aleo { transition mint(r0: address, r1: u64) -> Token { return Token { owner: r0, - gates: 0u64, amount: r1, }; } transition main(x: address) -> u64 { let c: u64 = 1u64; - let t: Token = Token { owner: x, gates: 0u64, amount: c}; - - return t.gates; + let t: Token = Token { owner: x, amount: c}; + + return c * c; }} diff --git a/tests/tests/compiler/records/init_expression_shorthand.leo b/tests/tests/compiler/records/init_expression_shorthand.leo index fb5cdd888c..575599dded 100644 --- a/tests/tests/compiler/records/init_expression_shorthand.leo +++ b/tests/tests/compiler/records/init_expression_shorthand.leo @@ -7,8 +7,6 @@ program test.aleo { record Token { // The token owner. owner: address, - // The Aleo balance (in gates). - gates: u64, // The token amount. amount: u64, } @@ -16,14 +14,13 @@ program test.aleo { transition mint(owner: address, amount: u64) -> Token { return Token { owner, - gates: 0u64, amount, }; } transition main(x: address) -> u64 { let c: u64 = 1u64; - let t: Token = Token { owner: x, gates: 0u64, amount: c}; - - return t.gates; + let t: Token = Token { owner: x, amount: c}; + + return c + c; }} diff --git a/tests/tests/compiler/records/init_expression_type_fail.leo b/tests/tests/compiler/records/init_expression_type_fail.leo index a14bc70a0d..a586b17266 100644 --- a/tests/tests/compiler/records/init_expression_type_fail.leo +++ b/tests/tests/compiler/records/init_expression_type_fail.leo @@ -7,8 +7,6 @@ program test.aleo { record Token { // The token owner. owner: address, - // The Aleo balance (in gates). - gates: u64, // The token amount. amount: u64, } @@ -16,7 +14,6 @@ program test.aleo { function mint(r0: address, r1: u64) -> Token { return Token { owner: r1, // This variable should be type address. - gates: 0u64, amount: r0, // This variable should be type u64. }; } @@ -24,6 +21,6 @@ program test.aleo { function main(x: address) -> u64 { let c: u64 = 1u64; let t: Token = mint(x, c); - - return t.gates; + + return c; }} diff --git a/tests/tests/compiler/records/init_expression_var_fail.leo b/tests/tests/compiler/records/init_expression_var_fail.leo index 2a7390d127..d78d36aeb7 100644 --- a/tests/tests/compiler/records/init_expression_var_fail.leo +++ b/tests/tests/compiler/records/init_expression_var_fail.leo @@ -7,8 +7,6 @@ program test.aleo { record Token { // The token owner. owner: address, - // The Aleo balance (in gates). - gates: u64, // The token amount. amount: u64, } @@ -16,7 +14,6 @@ program test.aleo { function mint(r0: address, r1: u64) -> Token { return Token { sender: r0, // This variable should be named `owner`. - gates: 0u64, amount: r1, }; } @@ -24,6 +21,6 @@ program test.aleo { function main(x: address) -> u64 { let c: u64 = 1u64; let t: Token = mint(x, c); - - return t.gates; + + return c; }} diff --git a/tests/tests/compiler/records/nested_record.leo b/tests/tests/compiler/records/nested_record.leo index c15dfdc458..ebebd1be7e 100644 --- a/tests/tests/compiler/records/nested_record.leo +++ b/tests/tests/compiler/records/nested_record.leo @@ -12,8 +12,6 @@ program test.aleo { record Token { // The token owner. owner: address, - // The Aleo balance (in gates). - gates: u64, // The token amount. amount: Amount, } @@ -21,15 +19,14 @@ program test.aleo { transition mint(r0: address, r1: u64) -> Token { return Token { owner: r0, - gates: 0u64, amount: Amount { amount: r1, amt: r1 }, }; } transition main(x: address) -> u64 { let c: u64 = 1u64; - let t: Token = Token { owner: x, gates: 0u64, amount: Amount { amount: c, amt: c } }; - - return t.gates; + let t: Token = Token { owner: x, amount: Amount { amount: c, amt: c } }; + + return c + c; } } diff --git a/tests/tests/compiler/records/nested_record_1_fail.leo b/tests/tests/compiler/records/nested_record_1_fail.leo index f32716d67d..e7b1559d91 100644 --- a/tests/tests/compiler/records/nested_record_1_fail.leo +++ b/tests/tests/compiler/records/nested_record_1_fail.leo @@ -6,13 +6,11 @@ expectation: Fail program test.aleo { record Foo { owner: address, - gates: u64, amount: u64, } record Token { owner: address, - gates: u64, foo: Foo, } } diff --git a/tests/tests/compiler/records/nested_record_2_fail.leo b/tests/tests/compiler/records/nested_record_2_fail.leo index 092aed0a0a..564f8ebada 100644 --- a/tests/tests/compiler/records/nested_record_2_fail.leo +++ b/tests/tests/compiler/records/nested_record_2_fail.leo @@ -7,13 +7,11 @@ program test.aleo { record Token2 { owner: address, - gates: u64, foo: (Foo, Foo), } record Foo { owner: address, - gates: u64, amount: u64, } } diff --git a/tests/tests/compiler/records/nested_record_3_fail.leo b/tests/tests/compiler/records/nested_record_3_fail.leo index 43a6641ad5..6e2a8df0a2 100644 --- a/tests/tests/compiler/records/nested_record_3_fail.leo +++ b/tests/tests/compiler/records/nested_record_3_fail.leo @@ -6,7 +6,6 @@ expectation: Fail program test.aleo { record Token { owner: address, - gates: u64, bar: Bar, } @@ -17,7 +16,6 @@ program test.aleo { record Foo { owner: address, - gates: u64, amount: u64, } } diff --git a/tests/tests/compiler/records/nested_record_4_fail.leo b/tests/tests/compiler/records/nested_record_4_fail.leo index 58fa69a12c..48f4e6513c 100644 --- a/tests/tests/compiler/records/nested_record_4_fail.leo +++ b/tests/tests/compiler/records/nested_record_4_fail.leo @@ -6,7 +6,6 @@ expectation: Fail program test.aleo { record Token3 { owner: address, - gates: u64, bar: (Bar, Bar), } @@ -16,7 +15,6 @@ program test.aleo { record Token { owner: address, - gates: u64, amount: u64, } diff --git a/tests/tests/compiler/records/no_owner_fail.leo b/tests/tests/compiler/records/no_owner_fail.leo index 62edbbd5c2..493f5fbcf5 100644 --- a/tests/tests/compiler/records/no_owner_fail.leo +++ b/tests/tests/compiler/records/no_owner_fail.leo @@ -6,8 +6,6 @@ expectation: Fail program test.aleo { // This record does not define the `owner` variable required for a record type. record Token { - // The Aleo balance (in gates). - gates: u64, // The token amount. amount: u64, } diff --git a/tests/tests/compiler/records/owner_wrong_ty.leo b/tests/tests/compiler/records/owner_wrong_ty.leo index be2b3508ec..44326c1c68 100644 --- a/tests/tests/compiler/records/owner_wrong_ty.leo +++ b/tests/tests/compiler/records/owner_wrong_ty.leo @@ -6,7 +6,6 @@ expectation: Fail program test.aleo { // This record does define the `owner` variable but with the wrong type. record Token { - gates: u64, owner: bool, } diff --git a/tests/tests/compiler/records/record_declaration_out_of_order.leo b/tests/tests/compiler/records/record_declaration_out_of_order.leo index 154f480382..7558c5123d 100644 --- a/tests/tests/compiler/records/record_declaration_out_of_order.leo +++ b/tests/tests/compiler/records/record_declaration_out_of_order.leo @@ -7,8 +7,6 @@ program test.aleo { record Token { // The token amount. amount: u64, - // The Aleo balance (in gates). - gates: u64, // The token owner. owner: address, } @@ -16,4 +14,4 @@ program test.aleo { transition main(a: u8, b:u8) -> u8 { return a + b; } -} \ No newline at end of file +} diff --git a/tests/tests/compiler/records/record_init_out_of_order.leo b/tests/tests/compiler/records/record_init_out_of_order.leo index 55b6a9c537..37fda56ddd 100644 --- a/tests/tests/compiler/records/record_init_out_of_order.leo +++ b/tests/tests/compiler/records/record_init_out_of_order.leo @@ -9,8 +9,6 @@ program test.aleo { record Token { // The token owner. owner: address, - // The Aleo balance (in gates). - gates: u64, // The token amount. amount: u64, } @@ -19,8 +17,7 @@ program test.aleo { let amount: u64 = a * a; return Token { amount, - gates: 0u64, owner, }; } -} \ No newline at end of file +} diff --git a/tests/tests/compiler/records/record_with_visibility.leo b/tests/tests/compiler/records/record_with_visibility.leo index b706b3f06b..fad48f1dcf 100644 --- a/tests/tests/compiler/records/record_with_visibility.leo +++ b/tests/tests/compiler/records/record_with_visibility.leo @@ -7,8 +7,6 @@ program test.aleo { record Token { // The token amount. private amount: u64, - // The Aleo balance (in gates). - public gates: u64, // The token owner. private owner: address, // A constant value. diff --git a/tests/tests/compiler/records/return_record_instead_of_unit_fail.leo b/tests/tests/compiler/records/return_record_instead_of_unit_fail.leo index 4eb46ba89c..5472ebd29a 100644 --- a/tests/tests/compiler/records/return_record_instead_of_unit_fail.leo +++ b/tests/tests/compiler/records/return_record_instead_of_unit_fail.leo @@ -6,15 +6,13 @@ expectation: Fail program test.aleo { record test_credits { owner: address, - gates: u64, amount: u64 } transition mint_credits(to: address, amount: u64) { return test_credits { owner: self.caller, - gates: 0u64, amount }; } -} \ No newline at end of file +} diff --git a/tests/tests/compiler/statements/loop_non_literal_bound_fail.leo b/tests/tests/compiler/statements/loop_non_literal_bound_fail.leo index 8f2b8b6857..5ee02314c4 100644 --- a/tests/tests/compiler/statements/loop_non_literal_bound_fail.leo +++ b/tests/tests/compiler/statements/loop_non_literal_bound_fail.leo @@ -6,7 +6,6 @@ expectation: Fail program test.aleo { record Token { owner: address, - gates: u64, amount: u64, } @@ -17,7 +16,6 @@ program test.aleo { } return Token { owner: owner, - gates: 0u64, amount: amount, }; } diff --git a/tests/tests/compiler/structs/struct_contains_record_fail.leo b/tests/tests/compiler/structs/struct_contains_record_fail.leo index 3c1bafe384..193af47ff9 100644 --- a/tests/tests/compiler/structs/struct_contains_record_fail.leo +++ b/tests/tests/compiler/structs/struct_contains_record_fail.leo @@ -12,8 +12,6 @@ program test.aleo { record Token { // The token owner. owner: address, - // The Aleo balance (in gates). - gates: u64, // The token amount. foo: Foo, } diff --git a/tests/tests/compiler/tuple/tuple_in_record_fail.leo b/tests/tests/compiler/tuple/tuple_in_record_fail.leo index befebdff66..d1ba072ad3 100644 --- a/tests/tests/compiler/tuple/tuple_in_record_fail.leo +++ b/tests/tests/compiler/tuple/tuple_in_record_fail.leo @@ -6,7 +6,6 @@ expectation: Fail program test.aleo { record Token { owner: address, - gates: u64, amounts: (u64, u64), } } diff --git a/tests/tests/finalize/counter.leo b/tests/tests/execution/counter.leo similarity index 97% rename from tests/tests/finalize/counter.leo rename to tests/tests/execution/counter.leo index dd0032364a..f0f0b7cde6 100644 --- a/tests/tests/finalize/counter.leo +++ b/tests/tests/execution/counter.leo @@ -1,5 +1,5 @@ /* -namespace: Finalize +namespace: Execute expectation: Pass initial_state: counter: [] @@ -33,4 +33,4 @@ program test.aleo { let current_value: u64 = Mapping::get(counter, addr); Mapping::set(counter, addr, current_value + 1u64); } -} \ No newline at end of file +} diff --git a/tests/tests/execution/mint.leo b/tests/tests/execution/mint.leo index bfff9f1758..cee6c14935 100644 --- a/tests/tests/execution/mint.leo +++ b/tests/tests/execution/mint.leo @@ -12,8 +12,6 @@ program test.aleo { record Token { // The token owner. private owner: address, - // The Aleo balance (in gates). - public gates: u64, // The token amount. amount: u64, // The flag. @@ -23,7 +21,6 @@ program test.aleo { transition mint(owner: address, amount: u64) -> Token { return Token { owner, - gates: 0u64, amount: amount, flag: true, }; diff --git a/tests/tests/parser/program/record_with_visibility.leo b/tests/tests/parser/program/record_with_visibility.leo index 61b206d435..05e9a8f5fa 100644 --- a/tests/tests/parser/program/record_with_visibility.leo +++ b/tests/tests/parser/program/record_with_visibility.leo @@ -6,6 +6,5 @@ expectation: Pass program test.aleo { record token { private owner: address, - private gates: u64, } }