Skip to content

Commit

Permalink
Rebrand vodka (#1)
Browse files Browse the repository at this point in the history
* 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
HinsonSIDAN authored Aug 8, 2024
1 parent 0504b2f commit b6daa46
Show file tree
Hide file tree
Showing 25 changed files with 786 additions and 605 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/build_docs.yml
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ Cargo.lock

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

docs
81 changes: 69 additions & 12 deletions README.md
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/).
8 changes: 4 additions & 4 deletions aiken.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name = "sidan-lab/aiken-utils"
version = "0.1.8-beta"
name = "sidan-lab/vodka"
version = "0.0.1-beta"
license = "Apache-2.0"
description = "Aiken utils for project 'sidan-lab/aiken-utils"
description = "Aiken utils for project 'sidan-lab/vodka"

[repository]
user = "sidan-lab"
project = "aiken-utils"
project = "vodka"
platform = "github"

[[dependencies]]
Expand Down
3 changes: 0 additions & 3 deletions documentation/sidan-placeholder.md

This file was deleted.

29 changes: 0 additions & 29 deletions documentation/sidan-utils.md

This file was deleted.

Loading

0 comments on commit b6daa46

Please sign in to comment.