From 1eef353c6fe2696d31aa2c280c7ee1321ba0c468 Mon Sep 17 00:00:00 2001 From: SIDANWhatever Date: Sun, 10 Dec 2023 04:51:12 +0800 Subject: [PATCH] first commit --- .github/workflows/tests.yml | 20 ++++++++++++++ .gitignore | 6 ++++ README.md | 55 +++++++++++++++++++++++++++++++++++++ aiken.toml | 14 ++++++++++ 4 files changed, 95 insertions(+) create mode 100644 .github/workflows/tests.yml create mode 100644 .gitignore create mode 100644 README.md create mode 100644 aiken.toml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..8913685 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,20 @@ +name: Tests + +on: + push: + branches: ["main"] + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - uses: aiken-lang/setup-aiken@v0.1.0 + with: + version: v1 + + - run: aiken fmt --check + - run: aiken check -D + - run: aiken build diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ff7811b --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +# Aiken compilation artifacts +artifacts/ +# Aiken's project working directory +build/ +# Aiken's default documentation export +docs/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..1b0dfcf --- /dev/null +++ b/README.md @@ -0,0 +1,55 @@ +# exunits-research + +Write validators in the `validators` folder, and supporting functions in the `lib` folder using `.ak` as a file extension. + +For example, as `validators/always_true.ak` + +```gleam +validator { + fn spend(_datum: Data, _redeemer: Data, _context: Data) -> Bool { + True + } +} +``` + +## Building + +```sh +aiken build +``` + +## Testing + +You can write tests in any module using the `test` keyword. For example: + +```gleam +test foo() { + 1 + 1 == 2 +} +``` + +To run all tests, simply do: + +```sh +aiken check +``` + +To run only tests matching the string `foo`, do: + +```sh +aiken check -m foo +``` + +## Documentation + +If you're writing a library, you might want to generate an HTML documentation for it. + +Use: + +```sh +aiken docs +``` + +## Resources + +Find more on the [Aiken's user manual](https://aiken-lang.org). diff --git a/aiken.toml b/aiken.toml new file mode 100644 index 0000000..3089133 --- /dev/null +++ b/aiken.toml @@ -0,0 +1,14 @@ +name = "deltadefi-protocol/exunits-research" +version = "0.0.0" +license = "Apache-2.0" +description = "Aiken contracts for project 'deltadefi-protocol/exunits-research'" + +[repository] +user = "deltadefi-protocol" +project = "exunits-research" +platform = "github" + +[[dependencies]] +name = "aiken-lang/stdlib" +version = "1.7.0" +source = "github"