-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: rename everything * feat: test ci * feat: test ci * feat: test ci * feat: test ci * feat: refactor paths * feat: adding inline docs * chore: adding inputs * feat: clean up for vodka rebrand and release
- Loading branch information
1 parent
0504b2f
commit b6daa46
Showing
25 changed files
with
786 additions
and
605 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Simple workflow for deploying static content to GitHub Pages | ||
name: Deploy static inline documentation to Pages | ||
|
||
on: | ||
# Runs on pushes targeting the default branch | ||
push: | ||
branches: ["main"] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | ||
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | ||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
# Single deploy job since we're just deploying | ||
deploy: | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Pages | ||
uses: actions/configure-pages@v5 | ||
|
||
- uses: aiken-lang/setup-aiken@v1 | ||
with: | ||
version: "v1.0.29-alpha" | ||
- run: aiken fmt --check | ||
- run: aiken check -D | ||
- run: aiken docs | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
# Upload entire repository | ||
path: "./docs" | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,5 @@ Cargo.lock | |
|
||
# MSVC Windows builds of rustc generate these, which store debugging information | ||
*.pdb | ||
|
||
docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,87 @@ | ||
# sidan-lab/aiken-utils | ||
# Vodka | ||
|
||
This package provides useful utilities in 2 direction | ||
Vodka is a library build for Aiken development. It offers | ||
|
||
1. Validating utils - help in writing on-chain code in aiken | ||
2. Unit test utils - the placeholder we need in building unit test | ||
1. Cocktail - Validating utils in writing on-chain code in aiken | ||
2. Mocktail - Unit test utils for easy building mock value for unit test | ||
|
||
## How to use | ||
## Vodka is pure and simple | ||
|
||
For your transaction. | ||
|
||
```rs | ||
let Transaction { inputs, outputs, extra_signatories, .. } = context.transaction | ||
``` | ||
|
||
Locating inputs & outputs: | ||
|
||
```rs | ||
when (inputs_at(inputs, target_address), outputs_at(outputs, target_address)) is { | ||
([only_input], [only_output]) -> ... | ||
_ -> False | ||
} | ||
``` | ||
|
||
Checking signature with: | ||
|
||
```rs | ||
key_signed(extra_signatories, key_hash_required) | ||
``` | ||
|
||
## Taste it before vodka cocktail, mocktail can be mixed, blended and Mesh | ||
|
||
Building unit testing in vodka, easily indicating how you should build in [whisky](https://whisky.sidan.io/) and [Mesh](https://meshjs.dev/). | ||
|
||
You can taste if your transaction can pass your aiken contract validation: | ||
|
||
```rs | ||
# Mock transaction | ||
let mock_tx: Transaction = mocktail_tx() | ||
... | ||
|> required_signer_hash(is_key_provided, mock_pub_key_hex(1)) | ||
|> complete() | ||
``` | ||
|
||
Then move it to blend a whisky: | ||
|
||
```rs | ||
let mut tx = MeshTxBuilder::new_core() | ||
tx.spending_plutus_script_v2() | ||
... | ||
.required_signer_hash(key_hash) | ||
.complete(None) | ||
|
||
``` | ||
|
||
Or Mesh: | ||
|
||
```ts | ||
const txBuilder = new MeshTxBuilder(); | ||
await txBuilder | ||
... | ||
.requiredSignerHash(keyHash) | ||
.complete(); | ||
``` | ||
|
||
You can build | ||
|
||
## Start mixing | ||
|
||
Simply run | ||
|
||
```sh | ||
aiken add sidan-lab/aiken-utils --version 0.1.8-beta | ||
aiken add sidan-lab/vodka --version 0.0.1-beta | ||
``` | ||
|
||
or putting the below in you `aiken.toml` | ||
|
||
```toml | ||
[[dependencies]] | ||
name = "sidan-lab/aiken-utils" | ||
version = "0.1.8-beta" | ||
name = "sidan-lab/vodka" | ||
version = "0.0.1-beta" | ||
source = "github" | ||
``` | ||
|
||
## Documentation | ||
|
||
The 2 documentation is served at | ||
|
||
1. [Validating utils](./documentation/sidan-utils.md) | ||
2. [Placeholders](./documentation/sidan-placeholder.md) | ||
Please refer to the [hosted documentation](https://sidan-lab.github.io/vodka/). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.