Skip to content

Commit

Permalink
Add track and trace smart contract
Browse files Browse the repository at this point in the history
  • Loading branch information
DOBEN committed Jan 29, 2024
1 parent 9c821ee commit 9c84f26
Show file tree
Hide file tree
Showing 9 changed files with 3,900 additions and 5 deletions.
46 changes: 41 additions & 5 deletions .github/workflows/rust-fmt-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ env:
RUST_CLIPPY: 1.67

jobs:
"lint_fmt":
name: lint:fmt
lint_fmt:
name: Running formatting
# Don't run on draft pull requests
if: ${{ !github.event.pull_request.draft }}
runs-on: ubuntu-latest
Expand All @@ -27,6 +27,7 @@ jobs:
- gallery/verifier/Cargo.toml
- sponsoredTransactions/backend/Cargo.toml
- sponsoredTransactionsAuction/backend/Cargo.toml
- trackAndTrace/smart-contract/Cargo.toml

steps:
- name: Checkout
Expand All @@ -44,9 +45,9 @@ jobs:
command: fmt
args: --manifest-path=${{ matrix.crates }} -- --check

"lint_clippy":
name: lint:clippy
needs: "lint_fmt"
lint_clippy:
name: Running clippy
needs: lint_fmt
# Don't run on draft pull requests
if: ${{ !github.event.pull_request.draft }}
runs-on: ubuntu-latest
Expand All @@ -56,6 +57,7 @@ jobs:
- gallery/verifier/Cargo.toml
- sponsoredTransactions/backend/Cargo.toml
- sponsoredTransactionsAuction/backend/Cargo.toml
- trackAndTrace/smart-contract/Cargo.toml

steps:
- name: Checkout
Expand All @@ -75,3 +77,37 @@ jobs:
with:
command: clippy
args: --manifest-path ${{ matrix.crates }} -- -D warnings

test:
name: Running tests
runs-on: ubuntu-latest
needs: [lint_fmt, lint_clippy]
strategy:
matrix:
target:
- x86_64-unknown-linux-gnu

lib-crates:
- trackAndTrace/smart-contract/Cargo.toml

steps:
- name: Checkout sources
uses: actions/checkout@v2
with:
submodules: recursive

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ env.RUST_VERSION }}
target: ${{ matrix.target }}
override: true

- name: Run cargo test
uses: actions-rs/cargo@v1
with:
command: test
# Run all tests, including doc tests.
args: --manifest-path ${{ matrix.lib-crates }} --target=${{ matrix.target }}

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ yarn-debug.log*
yarn-error.log*

target
/**/concordium-out
dist
gallery/public
.eslintcache
1 change: 1 addition & 0 deletions trackAndTrace/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
## Track and Trace Project
21 changes: 21 additions & 0 deletions trackAndTrace/rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
edition = "2021"
combine_control_expr = false
wrap_comments = true
brace_style = "PreferSameLine"
enum_discrim_align_threshold = 20
fn_single_line = true
format_strings = true
format_macro_matchers = true
format_macro_bodies = true
imports_granularity = "Crate"
normalize_comments = true
reorder_impl_items = true
reorder_imports = true
struct_field_align_threshold = 20
trailing_semicolon = true
type_punctuation_density = "Wide"
use_field_init_shorthand = true
use_try_shorthand = true
format_code_in_doc_comments = true
overflow_delimited_expr = true
normalize_doc_attributes = true
Loading

0 comments on commit 9c84f26

Please sign in to comment.