Skip to content

Commit

Permalink
Change default to full in registry template; fix rust compiler versio…
Browse files Browse the repository at this point in the history
…n for templates CI
  • Loading branch information
annenkov committed Sep 6, 2023
1 parent 120cbbb commit 4309e4d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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`
Expand Down Expand Up @@ -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`
Expand Down
2 changes: 1 addition & 1 deletion templates/credential-registry/cargo-generate.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions templates/credential-registry/pre-script.rhai
Original file line number Diff line number Diff line change
@@ -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);
}
}

0 comments on commit 4309e4d

Please sign in to comment.