Skip to content

Commit

Permalink
Merge branch 'v2'
Browse files Browse the repository at this point in the history
  • Loading branch information
KtorZ committed Aug 28, 2024
2 parents d8f3e57 + 0d08124 commit b3d09b2
Show file tree
Hide file tree
Showing 27 changed files with 4,421 additions and 3,503 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ jobs:
uses: actions/configure-pages@v2

- name: 🧰 Install Aiken
uses: aiken-lang/setup-aiken@v1
uses: aiken-lang/setup-aiken@v0.1.0
with:
version: v1.0.28-alpha
version: v1.0.18-alpha

- name: 📝 Run fmt
run: aiken fmt --check
Expand All @@ -52,7 +52,7 @@ jobs:
path: "docs/"

deploy:
# if: ${{ startsWith(github.ref, 'refs/tags') }}
if: ${{ startsWith(github.ref, 'refs/tags') }}
needs: build
runs-on: ubuntu-latest
environment:
Expand Down
64 changes: 64 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,69 @@
# Changelog

## v2.0.0 - UNRELEASED

### Added

- New modules covering Conway-related features (i.e. governance)
- [`cardano/governance`](https://aiken-lang.github.io/stdlib/cardano/governance.html)
- [`cardano/governance/protocol_parameters`](https://aiken-lang.github.io/stdlib/cardano/governance/protocol_parameters.html)

- New primitives in `aiken/crypto`:
- [`blake2b_224`](https://aiken-lang.github.io/stdlib/aiken/crypto.html#blake2b_224)
- [`keccak_256`](https://aiken-lang.github.io/stdlib/aiken/crypto.html#keccak_256)

- New primitives in `aiken/math`:
- [`log2`](https://aiken-lang.github.io/stdlib/aiken/math.html#log2)

- New primitives in `aiken/primitive/bytearray`:
- [`at`](https://aiken-lang.github.io/stdlib/aiken/primitive/bytearray.html#at)
- [`from_int_big_endian`](https://aiken-lang.github.io/stdlib/aiken/primitive/bytearray.html#from_int_big_endian)
- [`from_int_little_endian`](https://aiken-lang.github.io/stdlib/aiken/primitive/bytearray.html#from_int_little_endian)
- [`to_int_big_endian`](https://aiken-lang.github.io/stdlib/aiken/primitive/bytearray.html#to_int_big_endian)
- [`to_int_little_endian`](https://aiken-lang.github.io/stdlib/aiken/primitive/bytearray.html#to_int_little_endian)

- New primitives in `aiken/primitive/int`:
- [`from_bytearray_big_endian`](https://aiken-lang.github.io/stdlib/aiken/primitive/int.html#from_bytearray_big_endian)
- [`from_bytearray_little_endian`](https://aiken-lang.github.io/stdlib/aiken/primitive/int.html#from_bytearray_little_endian)

- New primitives in `aiken/crypto`:
- [`verify_ecdsa_signature`](https://aiken-lang.github.io/stdlib/cardano/credential.html#verify_ecdsa_signature)
- [`verify_schnorr_signature`](https://aiken-lang.github.io/stdlib/cardano/credential.html#verify_schnorr_signature)

### Changed

- Few modules have been relocated and better organized:
- `aiken/hash` -> [`aiken/crypto`](https://aiken-lang.github.io/stdlib/aiken/crypto.html)
- **collections**
- `aiken/dict` -> [`aiken/collection/dict`](https://aiken-lang.github.io/stdlib/aiken/collection/dict.html)
- `aiken/list` -> [`aiken/collection/list`](https://aiken-lang.github.io/stdlib/aiken/collection/list.html)
- `aiken/pairs` -> [`aiken/collection/pairs`](https://aiken-lang.github.io/stdlib/aiken/collection/pairs.html)
- **primitive**
- `aiken/bytearray` -> [`aiken/primitive/bytearray`](https://aiken-lang.github.io/stdlib/aiken/primitive/bytearray.html)
- `aiken/int` -> [`aiken/primitive/int`](https://aiken-lang.github.io/stdlib/aiken/primitive/int.html)
- `aiken/string` -> [`aiken/primitive/string`](https://aiken-lang.github.io/stdlib/aiken/primitive/string.html)
- **cardano**
- `aiken/transaction` -> [`cardano/transaction`](https://aiken-lang.github.io/stdlib/cardano/transaction.html)
- `aiken/transaction/certificate` -> [`cardano/certificate`](https://aiken-lang.github.io/stdlib/cardano/certificate.html)
- `aiken/transaction/credential` -> [`cardano/address`](https://aiken-lang.github.io/stdlib/cardano/address.html) & `aiken/crypto`
- `aiken/transaction/value` -> [`cardano/assets`](https://aiken-lang.github.io/stdlib/cardano/assets.html)

- The `Transaction` type from [`cardano/transaction`](https://aiken-lang.github.io/stdlib/cardano/transaction.html) (originally `aiken/transaction`) has been greatly reworked to match the new transaction format in Plutus V3.

- The `ScriptContext` type has split from `cardano/transaction` (originally `aiken/transaction`) and moved into its own module [`cardano/script_context`](https://aiken-lang.github.io/stdlib/cardano/script_context.html) and adjusted to its new form as per Plutus V3.

- The constructors of [`Credential`](https://aiken-lang.github.io/stdlib/cardano/address.html#credential) have been renamed from `VerificationKeyCredential` and `ScriptCredential` into `VerificationKey` and `Script` respectively.

- The function `remove_all`, `remove_first` and `remove_last` from [`aiken/collection/pairs`](https://aiken-lang.github.io/stdlib/aiken/collection/pairs.html) (originally `aiken/pairs`) have been renamed to `delete_all`, `delete_first` and `delete_last` respectively.

- The function `verify_signature` from [`aiken/crypto`](https://aiken-lang.github.io/stdlib/aiken/crypto.html) (originally `aiken/credential`) has been renamed to `verify_ed25519_signature`.

### Removed

- The module `aiken/time`. The `PosixTime` alias is no longer used anywhere.

- `MintedValue` (from `aiken/transaction/value` originally) and its associated functions are no longer needed and, therefore, gone.

## v1.9.0 - 2024-05-24

### Added
Expand Down
2 changes: 1 addition & 1 deletion aiken.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name = "aiken-lang/stdlib"
version = "1.9.0"
version = "main"
licences = ["Apache-2.0"]
description = "The Aiken Standard Library"

Expand Down
34 changes: 17 additions & 17 deletions lib/aiken/cbor.ak
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ use aiken/builtin.{decode_utf8, serialise_data}
/// useful for debugging.
///
/// ```aiken
/// serialise(42) == #"182a"
/// serialise(#"a1b2") == #"42a1b2"
/// serialise([]) == #"80"
/// serialise((1, 2)) == #"9f0102ff"
/// serialise((1, #"ff", 3)) == #"9f0141ff03ff"
/// serialise([(1, #"ff")]) == #"a10141ff"
/// serialise(Some(42)) == #"d8799f182aff"
/// serialise(None) == #"d87a80"
/// cbor.serialise(42) == #"182a"
/// cbor.serialise(#"a1b2") == #"42a1b2"
/// cbor.serialise([]) == #"80"
/// cbor.serialise((1, 2)) == #"9f0102ff"
/// cbor.serialise((1, #"ff", 3)) == #"9f0141ff03ff"
/// cbor.serialise([(1, #"ff")]) == #"a10141ff"
/// cbor.serialise(Some(42)) == #"d8799f182aff"
/// cbor.serialise(None) == #"d87a80"
/// ```
pub fn serialise(self: Data) -> ByteArray {
serialise_data(self)
Expand Down Expand Up @@ -73,15 +73,15 @@ test serialise_9() {
/// a good idea in the Cardano world.
///
/// ```aiken
/// diagnostic(42) == "42"
/// diagnostic(#"a1b2") == "h'A1B2'"
/// diagnostic([1, 2, 3]) == "[_ 1, 2, 3]"
/// diagnostic([]) == "[]"
/// diagnostic((1, 2)) == "[_ 1, 2]"
/// diagnostic((1, #"ff", 3)) == "[_ 1, h'FF', 3]"
/// diagnostic([(1, #"ff")]) == "{_ 1: h'FF' }"
/// diagnostic(Some(42)) == "121([_ 42])"
/// diagnostic(None) == "122([])"
/// cbor.diagnostic(42) == "42"
/// cbor.diagnostic(#"a1b2") == "h'A1B2'"
/// cbor.diagnostic([1, 2, 3]) == "[_ 1, 2, 3]"
/// cbor.diagnostic([]) == "[]"
/// cbor.diagnostic((1, 2)) == "[_ 1, 2]"
/// cbor.diagnostic((1, #"ff", 3)) == "[_ 1, h'FF', 3]"
/// cbor.diagnostic([(1, #"ff")]) == "{_ 1: h'FF' }"
/// cbor.diagnostic(Some(42)) == "121([_ 42])"
/// cbor.diagnostic(None) == "122([])"
/// ```
pub fn diagnostic(self: Data) -> String {
aiken.diagnostic(self, #"")
Expand Down
4 changes: 4 additions & 0 deletions lib/aiken/collection.ak
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/// An positive integer, that materializes the position of an element in a
/// collection.
pub type Index =
Int
Loading

0 comments on commit b3d09b2

Please sign in to comment.