From 1e5142a8a28404181f5b767fdc9544757477e7b0 Mon Sep 17 00:00:00 2001 From: collin <16715212+collinc97@users.noreply.github.com> Date: Mon, 18 Jul 2022 18:28:23 -0700 Subject: [PATCH] prepare for testnet3 as repo branch --- .circleci/leo-add-remove.sh | 8 --- .circleci/leo-check-constraints.sh | 16 ------ .circleci/leo-clean.sh | 19 +++++-- .circleci/leo-clone.sh | 18 ------- .circleci/leo-init.sh | 5 -- .circleci/leo-login-logout.sh | 15 ------ .circleci/leo-new.sh | 10 ++-- .circleci/leo-publish.sh | 56 -------------------- .circleci/leo-setup.sh | 7 --- .github/workflows/ci.yml | 6 +-- .github/workflows/docs.yml | 6 +-- .resources/init | 0 CONTRIBUTING.md | 4 +- README.md | 2 +- docs/error-guides/parser/unexpected_token.md | 2 +- 15 files changed, 27 insertions(+), 147 deletions(-) delete mode 100755 .circleci/leo-add-remove.sh delete mode 100755 .circleci/leo-check-constraints.sh delete mode 100755 .circleci/leo-clone.sh delete mode 100755 .circleci/leo-init.sh delete mode 100755 .circleci/leo-login-logout.sh delete mode 100755 .circleci/leo-publish.sh delete mode 100755 .circleci/leo-setup.sh delete mode 100644 .resources/init diff --git a/.circleci/leo-add-remove.sh b/.circleci/leo-add-remove.sh deleted file mode 100755 index 8f4a2f6eed..0000000000 --- a/.circleci/leo-add-remove.sh +++ /dev/null @@ -1,8 +0,0 @@ -# leo add (w/o login) & remove - -$LEO new my-app && cd my-app || exit 1 -$LEO add justice-league/u8u32 -echo "import u8u32.u8_u32; function main() {}" > src/main.leo -$LEO build -$LEO remove u8u32 -$LEO clean diff --git a/.circleci/leo-check-constraints.sh b/.circleci/leo-check-constraints.sh deleted file mode 100755 index c1c686d74b..0000000000 --- a/.circleci/leo-check-constraints.sh +++ /dev/null @@ -1,16 +0,0 @@ -# leo new hello-world - -cd ./project/examples/pedersen-hash - -export PEDERSEN_HASH_CONSTRAINTS=1539; - -# line that we're searching for is: -# `Build Number of constraints - 1539` -export ACTUAL_CONSTRAINTS=$($LEO build | grep constraints | awk '{print $NF}') - -# if else expression with only else block -[[ PEDERSEN_HASH_CONSTRAINTS -eq ACTUAL_CONSTRAINTS ]] || { - echo >&2 "Number of constraints for Pedersen Hash is not $PEDERSEN_HASH_CONSTRAINTS"; - echo >&2 "Real number of constraints is $ACTUAL_CONSTRAINTS"; - exit 1; -} diff --git a/.circleci/leo-clean.sh b/.circleci/leo-clean.sh index 46bd90880c..8448ae24c2 100755 --- a/.circleci/leo-clean.sh +++ b/.circleci/leo-clean.sh @@ -3,7 +3,7 @@ $LEO new hello-world ls -la cd hello-world && ls -la -$LEO run +$LEO build # Assert that the 'outputs' folder is not empty @@ -24,11 +24,20 @@ cd .. # Assert that the 'outputs' folder is empty -cd outputs || exit 1 -if [ "$(ls -A $DIR)" ]; then - echo "$DIR is not empty" +if [ "$(ls -A outputs)" ]; then + echo "outputs is not empty" exit 1 else - echo "$DIR is empty" + echo "outputs is empty" +fi + +# Assert that the 'build' folder is empty + +if [ "$(ls -A build)" ]; then + echo "build is not empty" + exit 1 +else + echo "build is empty" exit 0 fi + diff --git a/.circleci/leo-clone.sh b/.circleci/leo-clone.sh deleted file mode 100755 index c625b8d355..0000000000 --- a/.circleci/leo-clone.sh +++ /dev/null @@ -1,18 +0,0 @@ -# leo clone - -# Clone the test-app package. -export PACKAGE="$ALEO_PM_USERNAME/test-app" -$LEO clone $PACKAGE - -# Assert that the 'test-app' folder is not empty - -cd test-app || exit 1 -if [ "$(ls -A $DIR)" ]; then - echo "$DIR is not empty" -else - echo "$DIR is empty" - exit 1 -fi - -ls -la -$LEO run diff --git a/.circleci/leo-init.sh b/.circleci/leo-init.sh deleted file mode 100755 index 04c975568f..0000000000 --- a/.circleci/leo-init.sh +++ /dev/null @@ -1,5 +0,0 @@ -mkdir hello-world -cd hello-world -$LEO init || exit 1 -ls -la hello-world -$LEO run diff --git a/.circleci/leo-login-logout.sh b/.circleci/leo-login-logout.sh deleted file mode 100755 index c1fe2d067d..0000000000 --- a/.circleci/leo-login-logout.sh +++ /dev/null @@ -1,15 +0,0 @@ -# leo login & logout - -$LEO login -u "$ALEO_PM_USERNAME" -p "$ALEO_PM_PASSWORD" -$LEO new my-app && cd my-app || exit 1 - -cat Leo.toml - -# verify that in Leo.toml there's no line with [AUTHOR]; -# since CI does not allow showing credentials, we won't see it in the file; -# so the only way to test is to make sure that there's just no [AUTHOR] there -[[ $(cat Leo.toml | grep "\[AUTHOR\]" | wc -l) -eq 0 ]] || exit 1 - -$LEO add howard/silly-sudoku -$LEO remove silly-sudoku -$LEO logout diff --git a/.circleci/leo-new.sh b/.circleci/leo-new.sh index 6f90b785dd..46d4e3790b 100755 --- a/.circleci/leo-new.sh +++ b/.circleci/leo-new.sh @@ -1,9 +1,7 @@ -$LEO new hello-world +# Create a new foo project. +$LEO new foo ls -la -cd hello-world && ls -la - -# verify that in Leo.toml there's a placeholder for author -# because at the time of calling `leo new` user is not logged in -[[ $(cat Leo.toml | grep "\[AUTHOR\]" | wc -l) -eq 1 ]] || exit 1 +cd foo && ls -la +# Try to compile and run the template project. $LEO run diff --git a/.circleci/leo-publish.sh b/.circleci/leo-publish.sh deleted file mode 100755 index f41109dffd..0000000000 --- a/.circleci/leo-publish.sh +++ /dev/null @@ -1,56 +0,0 @@ -# leo login, publish and logout - -# Login -$LEO login -u "$ALEO_PM_USERNAME" -p "$ALEO_PM_PASSWORD" - -# Clone the test-app package. -export PACKAGE="$ALEO_PM_USERNAME/test-app" -$LEO clone $PACKAGE -cd test-app || exit 1 - -# Fetch the current Leo package version number. -# -# 1. Print out the Leo.toml file. -# 2. Search for a line with the word "version". -# 3. Isolate that into a single line. -# 4. Split the line from the '=' sign and keep the right-hand side. -# 5. Remove the quotes around the version number. -# 6. Trim any excess whitespace. -export CURRENT=$(cat Leo.toml \ -| grep version \ -| head -1 \ -| awk -F= '{ print $2 }' \ -| sed 's/[",]//g' \ -| xargs) - -# Increment the current Leo package version number by 1. -# -# 1. Print out the Leo.toml file. -# 2. Search for a line with the word "version". -# 3. Isolate that into a single line. -# 4. Split the line from the '=' sign and keep the right-hand side. -# 5. Remove the quotes around the version number. -# 6. Trim any excess whitespace. -# 7. Increment the version number by 1 (on the semver patch). -# -# https://stackoverflow.com/questions/8653126/how-to-increment-version-number-in-a-shell-script -export UPDATED=$(cat Leo.toml \ -| grep version \ -| head -1 \ -| awk -F= '{ print $2 }' \ -| sed 's/[",]//g' \ -| xargs \ -| awk -F. -v OFS=. 'NF==1{print ++$NF}; NF>1{if(length($NF+1)>length($NF))$(NF-1)++; $NF=sprintf("%0*d", length($NF), ($NF+1)%(10^length($NF))); print}') - -# Write the updated Leo package version number to the Leo.toml file. -export TOML=$(cat Leo.toml | sed "s/$CURRENT/$UPDATED/g") -echo "$TOML" > Leo.toml - -# Run the package to confirm the manifest remains well-formed. -$LEO run - -# Publish the package to Aleo.pm -$LEO publish - -# Logout -$LEO logout diff --git a/.circleci/leo-setup.sh b/.circleci/leo-setup.sh deleted file mode 100755 index ae6e23803f..0000000000 --- a/.circleci/leo-setup.sh +++ /dev/null @@ -1,7 +0,0 @@ -# leo setup - -cd ./project/examples/pedersen-hash || exit 1 -$LEO setup -$LEO setup -$LEO setup --skip-key-check -$LEO clean diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 914cf9749a..36499a7019 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,9 +3,7 @@ on: pull_request: push: branches: - - master - - staging - - trying + - testnet3 paths-ignore: - 'docs/**' - 'documentation/**' @@ -189,7 +187,7 @@ jobs: - name: Checkout uses: actions/checkout@v2 with: - ref: master + ref: testnet3 - name: Install sccache env: diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 7fa86e8025..81b65c7daf 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,8 +1,8 @@ -name: Master Crates Docs +name: Testnet3 Crates Docs on: push: branches: - - master + - testnet3 jobs: build-crates-docs: @@ -16,7 +16,7 @@ jobs: - name: Checkout uses: actions/checkout@v2 with: - ref: master + ref: testnet3 - name: Install sccache env: diff --git a/.resources/init b/.resources/init deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a426315181..7e51ef4fff 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,9 +6,9 @@ Thank you for your interest in contributing to Leo! Below you can find some guid Please follow the instructions below when filing pull requests: -- Ensure that your branch is forked from the current [master](https://github.com/AleoHQ/leo/tree/master) branch. +- Ensure that your branch is forked from the current [testnet3](https://github.com/AleoHQ/leo/tree/testnet3) branch. - Fill out the provided markdown template for the feature or proposal. Be sure to link the pull request to any issues by using keywords. Example: "closes #130". -- Run `cargo fmt` before you commit; we use the `nightly` version of `rustfmt` to format the code, so you'll need to have the `nightly` toolchain installed on your machine; there's a [git hook](https://git-scm.com/docs/githooks) that ensures proper formatting before any commits can be made, and [`.rustfmt.toml`](https://github.com/AleoHQ/Leo/blob/master/.rustfmt.toml) specifies some of the formatting conventions. +- Run `cargo fmt` before you commit; we use the `nightly` version of `rustfmt` to format the code, so you'll need to have the `nightly` toolchain installed on your machine; there's a [git hook](https://git-scm.com/docs/githooks) that ensures proper formatting before any commits can be made, and [`.rustfmt.toml`](https://github.com/AleoHQ/Leo/blob/testnet3/.rustfmt.toml) specifies some of the formatting conventions. - Run `cargo clippy` to ensure that popular correctness and performance pitfalls are avoided. ## Style diff --git a/README.md b/README.md index 6900d1eafc..ef46397616 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@
diff --git a/docs/error-guides/parser/unexpected_token.md b/docs/error-guides/parser/unexpected_token.md index 8e06ef2ab5..8a4653219c 100644 --- a/docs/error-guides/parser/unexpected_token.md +++ b/docs/error-guides/parser/unexpected_token.md @@ -37,4 +37,4 @@ Error [EPAR0370000]: ~ What the solution to an unexpected token is depends on what you wanted to achieve. Most likely, you made a typo somewhere. -For a more complete overview of valid Leo tokens, consult the [Leo grammar](https://github.com/AleoHQ/leo/blob/master/grammar/README.md). +For a more complete overview of valid Leo tokens, consult the [Leo grammar](https://github.com/AleoHQ/leo/blob/testnet3/grammar/README.md).