From 4309e4d1542c18c1cc86e911349979b950fad0fc Mon Sep 17 00:00:00 2001 From: Danil Annenkov Date: Wed, 6 Sep 2023 13:06:27 +0200 Subject: [PATCH] Change default to full in registry template; fix rust compiler version for templates CI --- .github/workflows/linter.yml | 12 ++++++------ templates/credential-registry/cargo-generate.toml | 2 +- templates/credential-registry/pre-script.rhai | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index b4877b67..affee5a4 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -98,7 +98,7 @@ jobs: - name: Install toolchain uses: actions-rs/toolchain@v1 with: - toolchain: stable + toolchain: ${{ env.RUST_VERSION }} # we need to move the generated project to a temp folder, away from the template project # otherwise `cargo` runs would fail @@ -140,7 +140,7 @@ jobs: - name: Install toolchain uses: actions-rs/toolchain@v1 with: - toolchain: stable + toolchain: ${{ env.RUST_VERSION }} # we need to move the generated project to a temp folder, away from the template project # otherwise `cargo` runs would fail @@ -182,7 +182,7 @@ jobs: with: name: ${{ env.PROJECT_NAME }} template: ${{ matrix.crates }} - other: "-d description=myProject -d tokenMetadataBaseURL=https://some.example/token/ -d template_type=default" + other: "-d description=myProject -d tokenMetadataBaseURL=https://some.example/token/ -d template_type=full" - name: Install toolchain with clippy available uses: actions-rs/toolchain@v1 @@ -281,7 +281,7 @@ jobs: - name: Install toolchain uses: actions-rs/toolchain@v1 with: - toolchain: stable + toolchain: ${{ env.RUST_VERSION }} # Run diff to check if there are any differences between the generated smart contracts # and the example smart contracts. The templates have hardcoded versions of `concordium-std` @@ -322,12 +322,12 @@ jobs: with: name: ${{ env.PROJECT_NAME }} template: ${{ matrix.crates }} - other: "-d description=Example-credential-registry -d template_type=default" + other: "-d description=Example-credential-registry -d template_type=full" - name: Install toolchain uses: actions-rs/toolchain@v1 with: - toolchain: stable + toolchain: ${{ env.RUST_VERSION }} # Run diff to check if there are any differences between the generated smart contract # and the example smart contract. The template have hardcoded versions of `concordium-std` diff --git a/templates/credential-registry/cargo-generate.toml b/templates/credential-registry/cargo-generate.toml index 5ee4a0c2..060f1617 100644 --- a/templates/credential-registry/cargo-generate.toml +++ b/templates/credential-registry/cargo-generate.toml @@ -6,7 +6,7 @@ pre = ["pre-script.rhai"] # a script for setting default values for the variable [placeholders] description = { type = "string", prompt = "Description for the project?" } -template_type = { type = "string", prompt = "Select template type ('default' recommended for first-time users)", choices = ["default", "custom"], default = "default"} +template_type = { type = "string", prompt = "Select template type ('full' includes all features and is recommended for first-time users; 'custom' allows configuring who can revoke credentials and whether they can be restored)", choices = ["full", "custom"], default = "full"} [values] revocable_by_others = true diff --git a/templates/credential-registry/pre-script.rhai b/templates/credential-registry/pre-script.rhai index 8fcd25b7..ee36a821 100644 --- a/templates/credential-registry/pre-script.rhai +++ b/templates/credential-registry/pre-script.rhai @@ -1,5 +1,5 @@ let template_type = variable::get("template_type"); -if template_type == "default" { +if template_type == "full" { variable::set("revocable_by_others", true); variable::set("restorable", true); -} \ No newline at end of file +}