Merge branch 'testnet2' into leo-parser-inputs

This commit is contained in:
damirka 2022-02-09 17:13:11 +03:00
commit 466c41809c
164 changed files with 1305 additions and 1560 deletions

View File

@ -133,58 +133,58 @@ jobs:
paths: project/
- clear_environment:
cache_key: leo-executable-cache
leo-new:
docker:
- image: cimg/rust:1.56.1
resource_class: xlarge
steps:
- attach_workspace:
at: /home/circleci/project/
- run:
name: leo new
command: |
export LEO=/home/circleci/project/project/bin/leo
./project/.circleci/leo-new.sh
leo-init:
docker:
- image: cimg/rust:1.56.1
resource_class: xlarge
steps:
- attach_workspace:
at: /home/circleci/project/
- run:
name: leo init
command: |
export LEO=/home/circleci/project/project/bin/leo
./project/.circleci/leo-init.sh
leo-clean:
docker:
- image: cimg/rust:1.56.1
resource_class: xlarge
steps:
- attach_workspace:
at: /home/circleci/project/
- run:
name: leo clean
command: |
export LEO=/home/circleci/project/project/bin/leo
./project/.circleci/leo-clean.sh
leo-setup:
docker:
- image: cimg/rust:1.56.1
resource_class: xlarge
steps:
- attach_workspace:
at: /home/circleci/project/
- run:
name: leo setup
command: |
export LEO=/home/circleci/project/project/bin/leo
./project/.circleci/leo-setup.sh
#
# leo-new:
# docker:
# - image: cimg/rust:1.56.1
# resource_class: xlarge
# steps:
# - attach_workspace:
# at: /home/circleci/project/
# - run:
# name: leo new
# command: |
# export LEO=/home/circleci/project/project/bin/leo
# ./project/.circleci/leo-new.sh
#
# leo-init:
# docker:
# - image: cimg/rust:1.56.1
# resource_class: xlarge
# steps:
# - attach_workspace:
# at: /home/circleci/project/
# - run:
# name: leo init
# command: |
# export LEO=/home/circleci/project/project/bin/leo
# ./project/.circleci/leo-init.sh
#
# leo-clean:
# docker:
# - image: cimg/rust:1.56.1
# resource_class: xlarge
# steps:
# - attach_workspace:
# at: /home/circleci/project/
# - run:
# name: leo clean
# command: |
# export LEO=/home/circleci/project/project/bin/leo
# ./project/.circleci/leo-clean.sh
#
# leo-setup:
# docker:
# - image: cimg/rust:1.56.1
# resource_class: xlarge
# steps:
# - attach_workspace:
# at: /home/circleci/project/
# - run:
# name: leo setup
# command: |
# export LEO=/home/circleci/project/project/bin/leo
# ./project/.circleci/leo-setup.sh
# leo-add-remove:
# docker:
@ -212,45 +212,45 @@ jobs:
# command: |
# export LEO=/home/circleci/project/project/bin/leo
# ./project/.circleci/leo-check-constraints.sh
leo-login-logout:
docker:
- image: cimg/rust:1.56.1
resource_class: xlarge
steps:
- attach_workspace:
at: /home/circleci/project/
- run:
name: leo login & logout
command: |
export LEO=/home/circleci/project/project/bin/leo
./project/.circleci/leo-login-logout.sh
leo-clone:
docker:
- image: cimg/rust:1.56.1
resource_class: xlarge
steps:
- attach_workspace:
at: /home/circleci/project/
- run:
name: leo clone
command: |
export LEO=/home/circleci/project/project/bin/leo
./project/.circleci/leo-clone.sh
leo-publish:
docker:
- image: cimg/rust:1.56.1
resource_class: xlarge
steps:
- attach_workspace:
at: /home/circleci/project/
- run:
name: leo publish
command: |
export LEO=/home/circleci/project/project/bin/leo
./project/.circleci/leo-publish.sh
#
# leo-login-logout:
# docker:
# - image: cimg/rust:1.56.1
# resource_class: xlarge
# steps:
# - attach_workspace:
# at: /home/circleci/project/
# - run:
# name: leo login & logout
# command: |
# export LEO=/home/circleci/project/project/bin/leo
# ./project/.circleci/leo-login-logout.sh
#
# leo-clone:
# docker:
# - image: cimg/rust:1.56.1
# resource_class: xlarge
# steps:
# - attach_workspace:
# at: /home/circleci/project/
# - run:
# name: leo clone
# command: |
# export LEO=/home/circleci/project/project/bin/leo
# ./project/.circleci/leo-clone.sh
#
# leo-publish:
# docker:
# - image: cimg/rust:1.56.1
# resource_class: xlarge
# steps:
# - attach_workspace:
# at: /home/circleci/project/
# - run:
# name: leo publish
# command: |
# export LEO=/home/circleci/project/project/bin/leo
# ./project/.circleci/leo-publish.sh
workflows:
version: 2
@ -259,30 +259,30 @@ workflows:
- check-style
- clippy
- leo-executable
- leo-new:
requires:
- leo-executable
- leo-init:
requires:
- leo-executable
- leo-clean:
requires:
- leo-executable
- leo-setup:
requires:
- leo-executable
# - leo-new:
# requires:
# - leo-executable
# - leo-init:
# requires:
# - leo-executable
# - leo-clean:
# requires:
# - leo-executable
# - leo-setup:
# requires:
# - leo-executable
# - leo-add-remove:
# requires:
# - leo-executable
# - leo-check-constraints:
# requires:
# - leo-executable
- leo-login-logout:
requires:
- leo-executable
- leo-clone:
requires:
- leo-executable
- leo-publish:
requires:
- leo-executable
# - leo-login-logout:
# requires:
# - leo-executable
# - leo-clone:
# requires:
# - leo-executable
# - leo-publish:
# requires:
# - leo-executable

View File

@ -1,39 +1,39 @@
name: WASM
on:
pull_request:
push:
branches:
- master
- staging
- trying
paths-ignore:
- 'docs/**'
- 'documentation/**'
env:
RUST_BACKTRACE: 1
jobs:
test-wasm-parser:
name: Test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: wasm
strategy:
matrix:
os: [windows-latest]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Rust Stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Install wasm-pack
run: cargo install wasm-pack
- name: Run wasm-pack
run: wasm-pack build --dev --target nodejs
- name: Install dependencies and run tests
run: cd tests && npm ci && npm test
#name: WASM
#on:
# pull_request:
# push:
# branches:
# - master
# - staging
# - trying
# paths-ignore:
# - 'docs/**'
# - 'documentation/**'
#env:
# RUST_BACKTRACE: 1
#
#jobs:
# test-wasm-parser:
# name: Test on ${{ matrix.os }}
# runs-on: ${{ matrix.os }}
# defaults:
# run:
# working-directory: wasm
# strategy:
# matrix:
# os: [windows-latest]
# steps:
# - name: Checkout
# uses: actions/checkout@v2
# - name: Install Rust Stable
# uses: actions-rs/toolchain@v1
# with:
# profile: minimal
# toolchain: stable
# override: true
# - name: Install wasm-pack
# run: cargo install wasm-pack
# - name: Run wasm-pack
# run: wasm-pack build --dev --target nodejs
# - name: Install dependencies and run tests
# run: cd tests && npm ci && npm test

609
Cargo.lock generated
View File

@ -36,17 +36,6 @@ version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
[[package]]
name = "ahash"
version = "0.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47"
dependencies = [
"getrandom 0.2.4",
"once_cell",
"version_check",
]
[[package]]
name = "aho-corasick"
version = "0.7.18"
@ -56,65 +45,6 @@ dependencies = [
"memchr",
]
[[package]]
name = "aleo-std"
version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4618148b254f38b9283c9e00a4938187f8f3f20aa2dafc59cf7377b27cb764b"
dependencies = [
"aleo-std-cpu",
"aleo-std-storage",
"aleo-std-time",
"aleo-std-timed",
"aleo-std-timer",
]
[[package]]
name = "aleo-std-cpu"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d1dcc739555d14733cbe4756f144b81d64f01843df359189b4d71bd5e521e2ee"
[[package]]
name = "aleo-std-storage"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "503e2538d5158b869bc9c30c9754f9a23f4210987008014a9f118db99f22c217"
dependencies = [
"dirs",
]
[[package]]
name = "aleo-std-time"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7065e071b26763f3e5b1b5a587828227562365bee84fdd2629361ea0a08bfc8d"
dependencies = [
"proc-macro2 0.4.30",
"quote 0.6.13",
"syn 0.15.44",
]
[[package]]
name = "aleo-std-timed"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b85aed1b7ca965b6613d14ab243c746316180401cbb9ba3b2cb22bff16fc08f"
dependencies = [
"proc-macro2 1.0.36",
"quote 1.0.15",
"syn 1.0.86",
]
[[package]]
name = "aleo-std-timer"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23bed34621f0713d3e750b59acdd3961a8950650fa7615b7cb40e6bc062a1d0b"
dependencies = [
"colored",
]
[[package]]
name = "ansi_term"
version = "0.12.1"
@ -130,18 +60,6 @@ version = "1.0.53"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94a45b455c14666b85fc40a019e8ab9eb75e3a124e05494f5397122bc9eb06e0"
[[package]]
name = "arrayref"
version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544"
[[package]]
name = "arrayvec"
version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6"
[[package]]
name = "assert_cmd"
version = "2.0.4"
@ -188,24 +106,12 @@ dependencies = [
"rustc-demangle",
]
[[package]]
name = "base58"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6107fe1be6682a68940da878d9e9f5e90ca5745b3dec9fd1bb393c8777d4f581"
[[package]]
name = "base64"
version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd"
[[package]]
name = "bech32"
version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf9ff0bbfd639f15c74af777d81383cf53efb7c93613f6cab67c6c11e05bbf8b"
[[package]]
name = "bincode"
version = "1.3.3"
@ -221,28 +127,6 @@ version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "blake2"
version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0a4e37d16930f5459780f5621038b6382b9bb37c19016f39fb6b5808d831f174"
dependencies = [
"crypto-mac",
"digest 0.9.0",
"opaque-debug 0.3.0",
]
[[package]]
name = "blake2s_simd"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "db539cc2b5f6003621f1cd9ef92d7ded8ea5232c7de0f9faa2de251cd98730d4"
dependencies = [
"arrayref",
"arrayvec",
"constant_time_eq",
]
[[package]]
name = "block-buffer"
version = "0.7.3"
@ -357,19 +241,6 @@ version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "chrono"
version = "0.4.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73"
dependencies = [
"libc",
"num-integer",
"num-traits",
"serde",
"winapi 0.3.9",
]
[[package]]
name = "ci_info"
version = "0.10.2"
@ -446,12 +317,6 @@ dependencies = [
"winapi 0.3.9",
]
[[package]]
name = "constant_time_eq"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc"
[[package]]
name = "core-foundation"
version = "0.9.2"
@ -575,16 +440,6 @@ dependencies = [
"generic-array 0.14.5",
]
[[package]]
name = "crypto-mac"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab"
dependencies = [
"generic-array 0.14.5",
"subtle",
]
[[package]]
name = "csv"
version = "1.1.6"
@ -607,36 +462,6 @@ dependencies = [
"memchr",
]
[[package]]
name = "curl"
version = "0.4.42"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7de97b894edd5b5bcceef8b78d7da9b75b1d2f2f9a910569d0bde3dd31d84939"
dependencies = [
"curl-sys",
"libc",
"openssl-probe",
"openssl-sys",
"schannel",
"socket2",
"winapi 0.3.9",
]
[[package]]
name = "curl-sys"
version = "0.4.52+curl-7.81.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "14b8c2d1023ea5fded5b7b892e4b8e95f70038a421126a056761a84246a28971"
dependencies = [
"cc",
"libc",
"libz-sys",
"openssl-sys",
"pkg-config",
"vcpkg",
"winapi 0.3.9",
]
[[package]]
name = "derivative"
version = "2.2.0"
@ -663,15 +488,6 @@ dependencies = [
"generic-array 0.12.4",
]
[[package]]
name = "digest"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066"
dependencies = [
"generic-array 0.14.5",
]
[[package]]
name = "digest"
version = "0.10.1"
@ -1016,12 +832,6 @@ version = "0.26.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4"
[[package]]
name = "glob"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574"
[[package]]
name = "h2"
version = "0.3.11"
@ -1052,9 +862,6 @@ name = "hashbrown"
version = "0.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e"
dependencies = [
"ahash",
]
[[package]]
name = "heck"
@ -1074,12 +881,6 @@ dependencies = [
"libc",
]
[[package]]
name = "hex"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
[[package]]
name = "http"
version = "0.2.6"
@ -1162,30 +963,6 @@ dependencies = [
"unicode-normalization",
]
[[package]]
name = "include_dir"
version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24b56e147e6187d61e9d0f039f10e070d0c0a887e24fe0bb9ca3f29bfde62cab"
dependencies = [
"glob",
"include_dir_impl",
"proc-macro-hack",
]
[[package]]
name = "include_dir_impl"
version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0a0c890c85da4bab7bce4204c707396bbd3c6c8a681716a51c8814cfc2b682df"
dependencies = [
"anyhow",
"proc-macro-hack",
"proc-macro2 1.0.36",
"quote 1.0.15",
"syn 1.0.86",
]
[[package]]
name = "indenter"
version = "0.3.3"
@ -1328,31 +1105,6 @@ dependencies = [
"anyhow",
]
[[package]]
name = "leo-asg"
version = "1.5.3"
dependencies = [
"criterion",
"indexmap",
"leo-ast",
"leo-ast-passes",
"leo-errors",
"leo-parser",
"num-bigint",
"serde",
"serde_json",
"tendril",
"typed-arena",
]
[[package]]
name = "leo-asg-passes"
version = "1.5.3"
dependencies = [
"leo-asg",
"leo-errors",
]
[[package]]
name = "leo-ast"
version = "1.5.3"
@ -1369,54 +1121,14 @@ dependencies = [
"tendril",
]
[[package]]
name = "leo-ast-passes"
version = "1.5.3"
dependencies = [
"indexmap",
"leo-ast",
"leo-errors",
"leo-parser",
"leo-stdlib",
]
[[package]]
name = "leo-compiler"
version = "1.5.3"
dependencies = [
"bech32",
"bincode",
"indexmap",
"leo-asg",
"leo-asg-passes",
"leo-ast",
"leo-ast-passes",
"leo-errors",
"leo-imports",
"leo-input",
"leo-package",
"leo-parser",
"leo-synthesizer",
"leo-test-framework",
"num-bigint",
"pest",
"rand 0.8.4",
"rand_core 0.6.3",
"rand_xorshift",
"serde",
"serde_json",
"serde_yaml",
"sha2",
"snarkvm-algorithms",
"snarkvm-curves",
"snarkvm-dpc",
"snarkvm-fields",
"snarkvm-gadgets",
"snarkvm-r1cs",
"snarkvm-utilities",
"tempfile",
"tendril",
"tracing",
]
[[package]]
@ -1436,19 +1148,6 @@ dependencies = [
"thiserror",
]
[[package]]
name = "leo-imports"
version = "1.5.3"
dependencies = [
"indexmap",
"leo-ast",
"leo-ast-passes",
"leo-errors",
"leo-parser",
"leo-span",
"tracing",
]
[[package]]
name = "leo-input"
version = "1.5.3"
@ -1478,12 +1177,8 @@ dependencies = [
"leo-ast",
"leo-compiler",
"leo-errors",
"leo-imports",
"leo-input",
"leo-package",
"leo-parser",
"leo-stdlib",
"leo-synthesizer",
"notify",
"rand 0.8.4",
"rand_core 0.6.3",
@ -1492,10 +1187,6 @@ dependencies = [
"self_update",
"serde",
"serde_json",
"snarkvm-algorithms",
"snarkvm-curves",
"snarkvm-gadgets",
"snarkvm-r1cs",
"snarkvm-utilities",
"structopt",
"test_dir",
@ -1505,10 +1196,6 @@ dependencies = [
"zip",
]
[[package]]
name = "leo-linter"
version = "1.5.3"
[[package]]
name = "leo-package"
version = "1.5.3"
@ -1555,34 +1242,6 @@ dependencies = [
"tendril",
]
[[package]]
name = "leo-stdlib"
version = "1.5.3"
dependencies = [
"include_dir",
"indexmap",
"leo-ast",
"leo-errors",
"leo-parser",
]
[[package]]
name = "leo-synthesizer"
version = "1.5.3"
dependencies = [
"eyre",
"hex",
"leo-errors",
"num-bigint",
"serde",
"serde_json",
"sha2",
"snarkvm-curves",
"snarkvm-fields",
"snarkvm-gadgets",
"snarkvm-r1cs",
]
[[package]]
name = "leo-test-framework"
version = "1.5.3"
@ -1595,38 +1254,12 @@ dependencies = [
"structopt",
]
[[package]]
name = "leo-wasm"
version = "1.5.3"
dependencies = [
"leo-asg",
"leo-ast",
"leo-ast-passes",
"leo-errors",
"leo-parser",
"serde",
"serde_json",
"wasm-bindgen",
]
[[package]]
name = "libc"
version = "0.2.117"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e74d72e0f9b65b5b4ca49a346af3976df0f9c61d550727f349ecd559f251a26c"
[[package]]
name = "libz-sys"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "de5435b8549c16d423ed0c03dbaafe57cf6c3344744f1242520d59c9d8ecec66"
dependencies = [
"cc",
"libc",
"pkg-config",
"vcpkg",
]
[[package]]
name = "linked-hash-map"
version = "0.5.4"
@ -1924,12 +1557,6 @@ version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c"
[[package]]
name = "opaque-debug"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
[[package]]
name = "openssl"
version = "0.10.38"
@ -1972,12 +1599,6 @@ dependencies = [
"memchr",
]
[[package]]
name = "paste"
version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0744126afe1a6dd7f394cb50a716dbe086cb06e255e53d8d0185d82828358fb5"
[[package]]
name = "percent-encoding"
version = "2.1.0"
@ -2152,12 +1773,6 @@ dependencies = [
"version_check",
]
[[package]]
name = "proc-macro-hack"
version = "0.5.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5"
[[package]]
name = "proc-macro2"
version = "0.4.30"
@ -2284,15 +1899,6 @@ dependencies = [
"rand_core 0.6.3",
]
[[package]]
name = "rand_xorshift"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f"
dependencies = [
"rand_core 0.6.3",
]
[[package]]
name = "rayon"
version = "1.5.1"
@ -2610,7 +2216,7 @@ dependencies = [
"block-buffer 0.7.3",
"digest 0.8.1",
"fake-simd",
"opaque-debug 0.2.3",
"opaque-debug",
]
[[package]]
@ -2657,51 +2263,6 @@ dependencies = [
"serde",
]
[[package]]
name = "snarkvm-algorithms"
version = "0.7.5"
source = "git+https://github.com/AleoHQ/snarkVM.git?rev=51633e2#51633e2fac247bc829bd316a93f59b6ba0759661"
dependencies = [
"aleo-std",
"anyhow",
"blake2",
"blake2s_simd",
"crossbeam-channel",
"derivative",
"digest 0.9.0",
"hex",
"itertools 0.10.3",
"lazy_static",
"num_cpus",
"once_cell",
"rand 0.8.4",
"rand_chacha 0.3.1",
"rayon",
"serde",
"sha2",
"smallvec",
"snarkvm-curves",
"snarkvm-fields",
"snarkvm-profiler",
"snarkvm-r1cs",
"snarkvm-utilities",
"thiserror",
]
[[package]]
name = "snarkvm-curves"
version = "0.7.5"
source = "git+https://github.com/AleoHQ/snarkVM.git?rev=51633e2#51633e2fac247bc829bd316a93f59b6ba0759661"
dependencies = [
"derivative",
"rand 0.8.4",
"rustc_version",
"serde",
"snarkvm-fields",
"snarkvm-utilities",
"thiserror",
]
[[package]]
name = "snarkvm-derives"
version = "0.7.5"
@ -2714,170 +2275,16 @@ dependencies = [
"syn 1.0.86",
]
[[package]]
name = "snarkvm-dpc"
version = "0.7.5"
source = "git+https://github.com/AleoHQ/snarkVM.git?rev=51633e2#51633e2fac247bc829bd316a93f59b6ba0759661"
dependencies = [
"anyhow",
"base58",
"bech32",
"bincode",
"blake2",
"chrono",
"derivative",
"hex",
"itertools 0.10.3",
"once_cell",
"rand 0.8.4",
"rayon",
"serde",
"serde_json",
"snarkvm-algorithms",
"snarkvm-curves",
"snarkvm-fields",
"snarkvm-gadgets",
"snarkvm-marlin",
"snarkvm-parameters",
"snarkvm-polycommit",
"snarkvm-profiler",
"snarkvm-r1cs",
"snarkvm-utilities",
"thiserror",
]
[[package]]
name = "snarkvm-fields"
version = "0.7.5"
source = "git+https://github.com/AleoHQ/snarkVM.git?rev=51633e2#51633e2fac247bc829bd316a93f59b6ba0759661"
dependencies = [
"anyhow",
"derivative",
"rand 0.8.4",
"rayon",
"serde",
"snarkvm-utilities",
"thiserror",
]
[[package]]
name = "snarkvm-gadgets"
version = "0.7.5"
source = "git+https://github.com/AleoHQ/snarkVM.git?rev=51633e2#51633e2fac247bc829bd316a93f59b6ba0759661"
dependencies = [
"anyhow",
"derivative",
"digest 0.9.0",
"itertools 0.10.3",
"num-bigint",
"num-integer",
"num-traits",
"snarkvm-algorithms",
"snarkvm-curves",
"snarkvm-fields",
"snarkvm-r1cs",
"snarkvm-utilities",
"thiserror",
]
[[package]]
name = "snarkvm-marlin"
version = "0.7.5"
source = "git+https://github.com/AleoHQ/snarkVM.git?rev=51633e2#51633e2fac247bc829bd316a93f59b6ba0759661"
dependencies = [
"bincode",
"blake2",
"derivative",
"digest 0.9.0",
"hashbrown",
"rand 0.8.4",
"rand_chacha 0.3.1",
"rand_core 0.6.3",
"rayon",
"serde",
"smallvec",
"snarkvm-algorithms",
"snarkvm-curves",
"snarkvm-fields",
"snarkvm-gadgets",
"snarkvm-polycommit",
"snarkvm-profiler",
"snarkvm-r1cs",
"snarkvm-utilities",
]
[[package]]
name = "snarkvm-parameters"
version = "0.7.5"
source = "git+https://github.com/AleoHQ/snarkVM.git?rev=51633e2#51633e2fac247bc829bd316a93f59b6ba0759661"
dependencies = [
"aleo-std",
"anyhow",
"cfg-if 1.0.0",
"curl",
"hex",
"paste",
"serde_json",
"snarkvm-algorithms",
"snarkvm-utilities",
"thiserror",
]
[[package]]
name = "snarkvm-polycommit"
version = "0.7.5"
source = "git+https://github.com/AleoHQ/snarkVM.git?rev=51633e2#51633e2fac247bc829bd316a93f59b6ba0759661"
dependencies = [
"derivative",
"digest 0.9.0",
"hashbrown",
"itertools 0.10.3",
"rand 0.8.4",
"rand_core 0.6.3",
"rayon",
"snarkvm-algorithms",
"snarkvm-curves",
"snarkvm-fields",
"snarkvm-gadgets",
"snarkvm-profiler",
"snarkvm-r1cs",
"snarkvm-utilities",
]
[[package]]
name = "snarkvm-profiler"
version = "0.7.5"
source = "git+https://github.com/AleoHQ/snarkVM.git?rev=51633e2#51633e2fac247bc829bd316a93f59b6ba0759661"
[[package]]
name = "snarkvm-r1cs"
version = "0.7.5"
source = "git+https://github.com/AleoHQ/snarkVM.git?rev=51633e2#51633e2fac247bc829bd316a93f59b6ba0759661"
dependencies = [
"anyhow",
"cfg-if 1.0.0",
"fxhash",
"indexmap",
"itertools 0.10.3",
"snarkvm-curves",
"snarkvm-fields",
"snarkvm-utilities",
"thiserror",
]
[[package]]
name = "snarkvm-utilities"
version = "0.7.5"
source = "git+https://github.com/AleoHQ/snarkVM.git?rev=51633e2#51633e2fac247bc829bd316a93f59b6ba0759661"
dependencies = [
"aleo-std",
"anyhow",
"bincode",
"itertools 0.10.3",
"num-bigint",
"num_cpus",
"rand 0.8.4",
"rayon",
"serde",
"snarkvm-derives",
"thiserror",
@ -2929,12 +2336,6 @@ dependencies = [
"syn 1.0.86",
]
[[package]]
name = "subtle"
version = "2.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601"
[[package]]
name = "syn"
version = "0.15.44"
@ -3224,12 +2625,6 @@ version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642"
[[package]]
name = "typed-arena"
version = "2.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0685c84d5d54d1c26f7d3eb96cd41550adb97baed141a761cf335d3d33bcd0ae"
[[package]]
name = "typenum"
version = "1.15.0"
@ -3381,8 +2776,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "25f1af7423d8588a3d840681122e72e6a24ddbcb3f0ec385cac0d12d24256c06"
dependencies = [
"cfg-if 1.0.0",
"serde",
"serde_json",
"wasm-bindgen-macro",
]

View File

@ -27,24 +27,24 @@ path = "leo/main.rs"
[workspace]
members = [
"asg",
"asg-passes",
# "asg",
# "asg-passes",
"ast",
"ast-passes",
# "ast-passes",
"compiler",
"errors",
"grammar",
"imports",
"input",
"linter",
# "imports",
# "input",
# "linter",
"package",
"parser",
"span",
# "state",
"stdlib",
"synthesizer",
"test-framework",
"wasm"
# "stdlib",
# "synthesizer",
# "test-framework",
# "wasm"
]
[dependencies.leo-ast]
@ -59,13 +59,13 @@ version = "1.5.3"
path = "./errors"
version = "1.5.3"
[dependencies.leo-imports]
path = "./imports"
version = "1.5.3"
[dependencies.leo-input]
path = "./input"
version = "1.5.3"
#[dependencies.leo-imports]
#path = "./imports"
#version = "1.5.3"
#
#[dependencies.leo-input]
#path = "./input"
#version = "1.5.3"
[dependencies.leo-package]
path = "./package"
@ -79,33 +79,29 @@ version = "1.5.3"
#path = "./state"
#version = "1.5.3"
[dependencies.leo-stdlib]
path = "./stdlib"
version = "1.5.3"
[dependencies.leo-synthesizer]
path = "./synthesizer"
version = "1.5.3"
[dependencies.snarkvm-algorithms]
git = "https://github.com/AleoHQ/snarkVM.git"
rev = "51633e2"
[dependencies.snarkvm-curves]
git = "https://github.com/AleoHQ/snarkVM.git"
rev = "51633e2"
default-features = false
[dependencies.snarkvm-gadgets]
git = "https://github.com/AleoHQ/snarkVM.git"
rev = "51633e2"
default-features = false
[dependencies.snarkvm-r1cs]
git = "https://github.com/AleoHQ/snarkVM.git"
rev = "51633e2"
default-features = false
#[dependencies.leo-stdlib]
#path = "./stdlib"
#version = "1.5.3"
#[dependencies.snarkvm-algorithms]
#git = "https://github.com/AleoHQ/snarkVM.git"
#rev = "51633e2"
#
#[dependencies.snarkvm-curves]
#git = "https://github.com/AleoHQ/snarkVM.git"
#rev = "51633e2"
#default-features = false
#
#[dependencies.snarkvm-gadgets]
#git = "https://github.com/AleoHQ/snarkVM.git"
#rev = "51633e2"
#default-features = false
#
#[dependencies.snarkvm-r1cs]
#git = "https://github.com/AleoHQ/snarkVM.git"
#rev = "51633e2"
#default-features = false
#
[dependencies.snarkvm-utilities]
git = "https://github.com/AleoHQ/snarkVM.git"
rev = "51633e2"

View File

@ -36,6 +36,6 @@ version = "1.5.3"
path = "../parser"
version = "1.5.3"
[dependencies.leo-stdlib]
path = "../stdlib"
version = "1.5.3"
#[dependencies.leo-stdlib]
#path = "../stdlib"
#version = "1.5.3"

View File

@ -26,129 +26,13 @@ version = "1.5.3"
path = "../errors"
version = "1.5.3"
[dependencies.leo-imports]
path = "../imports"
version = "1.5.3"
[dependencies.leo-input]
path = "../input"
version = "1.5.3"
[dependencies.leo-package]
path = "../package"
version = "1.5.3"
#[dependencies.leo-state]
#path = "../state"
#version = "1.5.3"
[dependencies.leo-asg]
path = "../asg"
version = "1.5.3"
[dependencies.leo-parser]
path = "../parser"
version = "1.5.3"
[dependencies.leo-asg-passes]
path = "../asg-passes"
version = "1.5.3"
[dependencies.leo-ast-passes]
path = "../ast-passes"
version = "1.5.3"
[dependencies.leo-synthesizer]
path = "../synthesizer"
version = "1.5.3"
[dev-dependencies.snarkvm-algorithms]
git = "https://github.com/AleoHQ/snarkVM.git"
rev = "51633e2"
default-features = false
[dependencies.snarkvm-curves]
git = "https://github.com/AleoHQ/snarkVM.git"
rev = "51633e2"
default-features = false
[dependencies.snarkvm-fields]
git = "https://github.com/AleoHQ/snarkVM.git"
rev = "51633e2"
default-features = false
[dependencies.snarkvm-dpc]
git = "https://github.com/AleoHQ/snarkVM.git"
rev = "51633e2"
features = ["testnet2"]
[dependencies.snarkvm-gadgets]
git = "https://github.com/AleoHQ/snarkVM.git"
rev = "51633e2"
default-features = false
features = [ "curves" ]
[dependencies.snarkvm-r1cs]
git = "https://github.com/AleoHQ/snarkVM.git"
rev = "51633e2"
default-features = false
[dependencies.snarkvm-utilities]
git = "https://github.com/AleoHQ/snarkVM.git"
rev = "51633e2"
[dependencies.bech32]
version = "0.8"
[dependencies.bincode]
version = "1.3"
[dependencies.indexmap]
version = "1.8.0"
features = [ "serde-1" ]
[dependencies.num-bigint]
version = "0.4"
[dependencies.pest]
version = "2.0"
[dependencies.rand]
version = "0.8"
[dependencies.serde]
version = "1.0"
[dependencies.serde_json]
version = "1.0"
features = [ "preserve_order" ]
[dependencies.sha2]
version = "0.10"
[dependencies.tendril]
version = "0.4"
[dependencies.tracing]
version = "0.1"
[dev-dependencies.leo-test-framework]
path = "../test-framework"
version = "1.4.0"
[dev-dependencies.rand_core]
version = "0.6.3"
[dev-dependencies.rand_xorshift]
version = "0.3"
default-features = false
[dev-dependencies.serde_yaml]
version = "0.8"
[dev-dependencies.tempfile]
version = "3.3.0"
[features]
default = [ ]
ci_skip = [ "leo-ast/ci_skip" ]

View File

@ -22,45 +22,61 @@
#![allow(clippy::upper_case_acronyms)]
#![doc = include_str!("../README.md")]
pub mod compiler;
use leo_errors::emitter::Handler;
use leo_errors::{CompilerError, Result};
pub mod console;
pub use console::*;
use sha2::{Digest, Sha256};
use std::fs;
use std::path::PathBuf;
pub mod constraints;
pub use constraints::*;
/// The primary entry point of the Leo compiler.
pub struct Compiler<'a> {
handler: &'a Handler,
main_file_path: PathBuf,
}
pub mod definition;
impl<'a> Compiler<'a> {
///
/// Returns a new Leo compiler.
///
pub fn new(handler: &'a Handler, main_file_path: PathBuf) -> Self {
Self {
handler,
main_file_path,
}
}
pub mod expression;
pub use expression::*;
///
/// Returns a SHA256 checksum of the program file.
///
pub fn checksum(&self) -> Result<String> {
// Read in the main file as string
let unparsed_file = fs::read_to_string(&self.main_file_path)
.map_err(|e| CompilerError::file_read_error(self.main_file_path.clone(), e))?;
pub mod function;
pub use function::*;
// Hash the file contents
let mut hasher = Sha256::new();
hasher.update(unparsed_file.as_bytes());
let hash = hasher.finalize();
pub mod output;
pub use output::*;
Ok(format!("{:x}", hash))
}
pub mod program;
pub use program::*;
///
/// Returns a compiled Leo program.
///
pub fn compile(self) -> Result<leo_ast::Ast> {
// Load the program file.
let program_string = fs::read_to_string(&self.main_file_path)
.map_err(|e| CompilerError::file_read_error(self.main_file_path.clone(), e))?;
pub mod statement;
pub use statement::*;
// Use the parser to construct the abstract syntax tree (ast).
let ast: leo_ast::Ast = leo_parser::parse_ast(
self.handler,
self.main_file_path.to_str().unwrap_or_default(),
program_string,
)?;
pub mod prelude;
pub use prelude::*;
pub mod value;
pub use value::*;
pub mod phase;
pub use phase::*;
pub mod phases;
pub use phases::*;
pub mod option;
pub use option::*;
#[cfg(test)]
mod test;
Ok(ast)
}
}

View File

@ -0,0 +1,146 @@
[package]
name = "leo-compiler"
version = "1.5.3"
authors = [ "The Aleo Team <hello@aleo.org>" ]
description = "Compiler of the Leo programming language"
homepage = "https://aleo.org"
repository = "https://github.com/AleoHQ/leo"
keywords = [
"aleo",
"cryptography",
"leo",
"programming-language",
"zero-knowledge"
]
categories = [ "cryptography::cryptocurrencies", "web-programming" ]
include = [ "Cargo.toml", "src", "README.md", "LICENSE.md" ]
license = "GPL-3.0"
edition = "2021"
rust-version = "1.56.1"
[dependencies.leo-ast]
path = "../ast"
version = "1.5.3"
[dependencies.leo-errors]
path = "../errors"
version = "1.5.3"
#
#[dependencies.leo-imports]
#path = "../imports"
#version = "1.5.3"
#
#[dependencies.leo-input]
#path = "../input"
#version = "1.5.3"
#
#[dependencies.leo-package]
#path = "../package"
#version = "1.5.3"
[dependencies.leo-parser]
path = "../parser"
version = "1.5.3"
#
#[dependencies.leo-asg-passes]
#path = "../asg-passes"
#version = "1.5.3"
#
#[dependencies.leo-ast-passes]
#path = "../ast-passes"
#version = "1.5.3"
#
#[dependencies.leo-synthesizer]
#path = "../synthesizer"
#version = "1.5.3"
[dev-dependencies.snarkvm-algorithms]
git = "https://github.com/AleoHQ/snarkVM.git"
rev = "51633e2"
default-features = false
[dependencies.snarkvm-curves]
git = "https://github.com/AleoHQ/snarkVM.git"
rev = "51633e2"
default-features = false
[dependencies.snarkvm-fields]
git = "https://github.com/AleoHQ/snarkVM.git"
rev = "51633e2"
default-features = false
[dependencies.snarkvm-dpc]
git = "https://github.com/AleoHQ/snarkVM.git"
rev = "51633e2"
features = ["testnet2"]
[dependencies.snarkvm-gadgets]
git = "https://github.com/AleoHQ/snarkVM.git"
rev = "51633e2"
default-features = false
features = [ "curves" ]
[dependencies.snarkvm-r1cs]
git = "https://github.com/AleoHQ/snarkVM.git"
rev = "51633e2"
default-features = false
[dependencies.snarkvm-utilities]
git = "https://github.com/AleoHQ/snarkVM.git"
rev = "51633e2"
[dependencies.bech32]
version = "0.8"
[dependencies.bincode]
version = "1.3"
[dependencies.indexmap]
version = "1.8.0"
features = [ "serde-1" ]
[dependencies.num-bigint]
version = "0.4"
[dependencies.pest]
version = "2.0"
[dependencies.rand]
version = "0.8"
[dependencies.serde]
version = "1.0"
[dependencies.serde_json]
version = "1.0"
features = [ "preserve_order" ]
[dependencies.sha2]
version = "0.10"
[dependencies.tendril]
version = "0.4"
[dependencies.tracing]
version = "0.1"
[dev-dependencies.leo-test-framework]
path = "../test-framework"
version = "1.4.0"
[dev-dependencies.rand_core]
version = "0.6.3"
[dev-dependencies.rand_xorshift]
version = "0.3"
default-features = false
[dev-dependencies.serde_yaml]
version = "0.8"
[dev-dependencies.tempfile]
version = "3.3.0"
[features]
default = [ ]
ci_skip = [ "leo-ast/ci_skip" ]

View File

@ -27,7 +27,6 @@ use leo_imports::ImportParser;
use leo_input::LeoInputParser;
use leo_package::inputs::InputPairs;
use leo_parser::parse_ast;
// use leo_state::verify_local_data_commitment;
use snarkvm_fields::PrimeField;
use snarkvm_r1cs::{ConstraintSynthesizer, ConstraintSystem, SynthesisError};

View File

@ -0,0 +1,66 @@
// Copyright (C) 2019-2021 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 <https://www.gnu.org/licenses/>.
//! The compiler for Leo programs.
//!
//! The [`Compiler`] type compiles Leo programs into R1CS circuits.
#![allow(clippy::module_inception)]
#![allow(clippy::upper_case_acronyms)]
#![doc = include_str!("../README.md")]
pub mod compiler;
pub mod console;
pub use console::*;
pub mod constraints;
pub use constraints::*;
pub mod definition;
pub mod expression;
pub use expression::*;
pub mod function;
pub use function::*;
pub mod output;
pub use output::*;
pub mod program;
pub use program::*;
pub mod statement;
pub use statement::*;
pub mod prelude;
pub use prelude::*;
pub mod value;
pub use value::*;
pub mod phase;
pub use phase::*;
pub mod phases;
pub use phases::*;
pub mod option;
pub use option::*;
#[cfg(test)]
mod test;

Some files were not shown because too many files have changed in this diff Show More