diff --git a/.github/workflows/test.yaml b/.github/workflows/tests.yaml similarity index 55% rename from .github/workflows/test.yaml rename to .github/workflows/tests.yaml index 761c02e..54f3def 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/tests.yaml @@ -1,4 +1,3 @@ - name: Test anoma-apps on: @@ -8,18 +7,25 @@ on: workflow_dispatch: jobs: - test: + tests: name: Run test suite runs-on: ubuntu-latest + defaults: + run: + working-directory: Kudos steps: - name: checkout code uses: actions/checkout@v3 - - name: Download latest nightly Juvix binary uses: jaxxstorm/action-install-gh-release@v1.10.0 with: repo: anoma/juvix-nightly-builds cache: enable - - - name: Run tests - run: juvix eval tests/Main.juvix + - name: Clean + run: juvix clean --global && juvix clean && juvix dependencies update + - name: Type Check + run: juvix typecheck + - name: Format Check + run: juvix format + - name: Run Example + run: juvix eval Example.juvix diff --git a/Kudos/Example.juvix b/Kudos/Example.juvix index 6fbd076..b1e4080 100644 --- a/Kudos/Example.juvix +++ b/Kudos/Example.juvix @@ -2,15 +2,36 @@ module Example; import Anoma open; import Stdlib.Prelude open; +import Stdlib.Debug.Fail open using {failwith}; -import Kudos open; +import Applib.Resource.Error open; +import Applib.Authorization.Identities open; +import Applib.Helpers open; -alice : KeyPair := mkKeyPair@{ - pubKey := 0xddd315c76991f8e058760cacdd19c21bf6a12c72bc229a60ad6aaa314fa07ac1; - privKey := 0xddd315c76991f8e058760cacdd19c21bf6a12c72bc229a60ad6aaa314fa07ac11662fc6e7829efcb0f4500827d49bb699af7b5475cef5220fd600ebbf9709a58; -}; +import Anoma.Transaction open; +import Anoma.Identity open; +import Anoma.State.CommitmentTree open; -bob : PublicKey := 0x7d59c5623dd40a74aa4d5a32ac645d3b3f95daeae4c22be25476dd6a486f7382; +import Interface open; + +alice : Identity := Universal.identity; + +bob : ExternalIdentity := Zero.externalIdentity; + +standardInputs : StandardInputs := + mkStandardInputs@{ + identity := alice; + currentRoot := mkRoot 0 + }; --- Create 10 Kudo tokens as Alice (the originator) for Bob (the owner). -main : Transaction := create@{self := alice; amount := 10; receiver := bob}; +main : Transaction := + case + initialize@{ + standardInputs; + quantity := 10; + receiver := bob + } + of + | error err := failwith (Show.show err) + | ok tx := tx; diff --git a/Kudos/Interface.juvix b/Kudos/Interface.juvix new file mode 100644 index 0000000..b1a8897 --- /dev/null +++ b/Kudos/Interface.juvix @@ -0,0 +1,150 @@ +module Interface; + +import Stdlib.Prelude open; + +import Anoma.Identity open; +import Anoma.Transaction open; +import Anoma.Resource open; + +import Applib.Resource.Error open; +import Applib.Transaction as Transaction; + +import Applib.Token.Resource open; +import Applib.Token.Label open; +import Applib.Intent.Asset open; +import Applib.Intent.Swap.Resource open; +import Applib.Intent.Swap.Solution open; + +import Applib.Helpers open; + +import Label open; + +initialize + (standardInputs : StandardInputs) + (quantity : Quantity) + (receiver : ExternalIdentity) + : Result StandardError Transaction := + let + self := standardInputs |> StandardInputs.identity |> Identity.external; + token := + Token.create@{ + quantity; + tokenLabel := mkKudoLabel self; + owner := receiver + }; + in Transaction.initialize@{ + standardInputs; + toInitialize := token; + maybeDummy := nothing + }; + +finalize (standardInputs : StandardInputs) (token : Token) : Result StandardError Transaction := + let + self : ExternalIdentity := standardInputs |> StandardInputs.identity |> Identity.external; + in case isKudo (self) token of + | false := throw notKudoError + | true := + Transaction.finalize@{ + standardInputs; + toFinalize := token + }; + +send + (standardInputs : StandardInputs) + (token : Token) + (quantity : Quantity) + (receiver : ExternalIdentity) + : Result StandardError Transaction := + let + self : ExternalIdentity := standardInputs |> StandardInputs.identity |> Identity.external; + in case isKudo self token of + | false := throw notKudoError + | true := + Transaction.send@{ + standardInputs; + toSend := token; + quantity; + receiver + }; + +transfer + (standardInputs : StandardInputs) + (token : Token) + (receiver : ExternalIdentity) + : Result StandardError Transaction := + let + self : ExternalIdentity := standardInputs |> StandardInputs.identity |> Identity.external; + in case isKudo (self) token of + | false := throw notKudoError + | true := + Transaction.transfer@{ + standardInputs; + toTransfer := token; + receiver + }; + +split + (standardInputs : StandardInputs) + (token : Token) + -- TODO refactor type + (quantitiesAndReceivers : List (Pair Quantity ExternalIdentity)) + : Result StandardError Transaction := + let + self : ExternalIdentity := standardInputs |> StandardInputs.identity |> Identity.external; + in case isKudo self token of + | false := throw notKudoError + | true := + Transaction.split@{ + standardInputs; + toSplit := token; + quantitiesAndReceivers + }; + +merge + (standardInputs : StandardInputs) + (tokens : List Token) + (receiver : ExternalIdentity) + : Result StandardError Transaction := + let + self := standardInputs |> StandardInputs.identity |> Identity.external; + in case all (t in tokens) {isKudo self t} of + | false := throw notKudoError + | true := + Transaction.merge@{ + standardInputs; + toMerge := tokens; + receiver + }; + +swap + (standardInputs : StandardInputs) + (toSwap : List Token) + (want : QuantifiedAssets) + (solver : ExternalIdentity) + : Result StandardError Transaction := + let + self := standardInputs |> StandardInputs.identity |> Identity.external; + in case all (t in toSwap) {isKudo self t} of + | false := throw notKudoError + | true := + Transaction.swap@{ + standardInputs; + toSwap; + intent := + SwapIntent.create@{ + want; + receiver := self; + solver + } + }; + +settle + (standardInputs : StandardInputs) + (transactions : List Transaction) + (solutions : List Solution) + : Result StandardError Transaction := + Transaction.settle@{ + standardInputs; + transactions; + solutions + }; diff --git a/Kudos/Kudos.juvix b/Kudos/Kudos.juvix index f23d1fd..6392222 100644 --- a/Kudos/Kudos.juvix +++ b/Kudos/Kudos.juvix @@ -1,38 +1,4 @@ module Kudos; -import Stdlib.Prelude open; -import Anoma open; -import Token.Transaction open; -import Token.Logic open; - -import Label open; - ---- Creates an amount of Kudo tokens to a receiver. -create - (self : KeyPair) - (amount : Nat) - (receiver : PublicKey) - : Transaction := - let - kudoLabel : Label := mkKudoLabel (KeyPair.pubKey self); - in Token.Transaction.mint self kudoLabel amount receiver; - ---- Sends an amount of Kudo tokens to a receiver. ---- If the token ;Resource; has no Kudos ;Label; this function returns nothing. ---- If the token logic function differs from the current implementation, this function returns nothing, ---- If the calling ;KeyPair; is not the owner, this function returns nothing. -send - (self : KeyPair) - (token : Resource) - (amount : Nat) - (receiver : PublicKey) - : Maybe Transaction := - let - isKudo (r : Resource) : Bool := - getSymbol r == "Kudos" - && getDecimals r == 18 - && anomaEncode(Resource.logic r) == anomaEncode(tokenLogic); - in if - | isKudo token := - Token.Transaction.send self token amount receiver - | else := nothing; +import Label open public; +import Interface open public; diff --git a/Kudos/Label.juvix b/Kudos/Label.juvix index de5cd6c..2e410b0 100644 --- a/Kudos/Label.juvix +++ b/Kudos/Label.juvix @@ -1,15 +1,41 @@ module Label; -import Anoma open; +import Stdlib.Prelude open; +import Applib.Helpers open; -import Token.Label open public; +import Applib.Token.Resource open; +import Applib.Token.Label open; +import Applib.Token.Logic open; -mkKudoLabel (originator : PublicKey) : Label := - mkLabel@{ - name := originator; - symbol := "Kudos"; - decimals := 18 +import Applib.Resource.Error open; +import Applib.Resource.Traits open; + +import Anoma.Identity open; +import Anoma.Builtin.System open; + +mkKudoLabel (originator : ExternalIdentity) : TokenLabel := + mkTokenLabel@{ + name := "Kudos"; + symbol := "KDS"; + decimals := 18; + supply := Unbound; + transferability := Transferability.Transferable; + originator }; -getOriginator (r : Resource) : PublicKey := - Label.name (anomaDecode (Resource.label r)); +isKudo (originator : ExternalIdentity) (token : Token) : Bool := + let + expectedLabel : TokenLabel := mkKudoLabel originator; + label : TokenLabel := HasLabel.get token; + expectedLogicEncoded : Nat := + tokenLogic (TokenLabel.supply expectedLabel) originator |> anomaEncode; + logicEncoded : Nat := HasLogic.get token |> anomaEncode; + in if + | label /= expectedLabel := false + | logicEncoded /= expectedLogicEncoded := false + | else := true; + +notKudoError : DefaultError := + mkDefaultError@{ + msg := "The input resource is not a Kudo token." + }; diff --git a/Kudos/Main.juvix b/Kudos/Main.juvix new file mode 100644 index 0000000..12c1f3a --- /dev/null +++ b/Kudos/Main.juvix @@ -0,0 +1,97 @@ +module Main; + +import Stdlib.Prelude open; +import Stdlib.Debug.Fail open; + +import Anoma.Identity open; +import Anoma.Builtin.System open; +import Anoma.Transaction open; + +import Applib.Resource.Error open; +import Applib.Helpers open; + +import Kudos as Kudos; + +INVALID_FUNCTION_SELECTOR : {A : Type} -> A := failwith "Invalid function selector."; + +INVALID_ARGUMENT_NUMBER : {A : Type} -> A := failwith "Invalid argument number"; + +type FunctionSelector := + | Initialize + | Finalize + | Send + | Transfer + | Split + | Merge + | Swap + | Settle + | INVALID; + +main (funcSelector : Nat) (args : List Nat) : AnomaTransaction := + let + toFunctionSelector (n : Nat) : FunctionSelector := + if + | n == 0 := Initialize + | n == 1 := Finalize + | n == 2 := Send + | n == 3 := Transfer + | n == 4 := Split + | n == 5 := Merge + | n == 6 := Swap + | n == 7 := Settle + | else := INVALID; + in case toFunctionSelector funcSelector, args of { + | Initialize, [a1; a2; a3] := + Kudos.initialize@{ + standardInputs := anomaDecode a1; + quantity := anomaDecode a2; + receiver := anomaDecode a3 + } + | Finalize, [a1; a2] := + Kudos.finalize@{ + standardInputs := anomaDecode a1; + token := anomaDecode a2 + } + | Send, [a1; a2; a3; a4] := + Kudos.send@{ + standardInputs := anomaDecode a1; + token := anomaDecode a2; + quantity := anomaDecode a3; + receiver := anomaDecode a4 + } + | Transfer, [a1; a2; a3] := + Kudos.transfer@{ + standardInputs := anomaDecode a1; + token := anomaDecode a2; + receiver := anomaDecode a3 + } + | Split, [a1; a2; a3] := + Kudos.split@{ + standardInputs := anomaDecode a1; + token := anomaDecode a2; + quantitiesAndReceivers := anomaDecode a3 + } + | Merge, [a1; a2; a3] := + Kudos.merge@{ + standardInputs := anomaDecode a1; + tokens := anomaDecode a2; + receiver := anomaDecode a3 + } + | Swap, [a1; a2; a3; a4] := + Kudos.swap@{ + standardInputs := anomaDecode a1; + toSwap := anomaDecode a2; + want := anomaDecode a3; + solver := anomaDecode a4 + } + | Settle, [a1; a2; a3] := + Kudos.settle@{ + standardInputs := anomaDecode a1; + transactions := anomaDecode a2; + solutions := anomaDecode a3 + } + | INVALID, _ := INVALID_FUNCTION_SELECTOR + | _, _ := INVALID_ARGUMENT_NUMBER + } + |> txFromResult + |> toAnomaTransaction; diff --git a/Kudos/Package.juvix b/Kudos/Package.juvix index b88a202..58a9ffa 100644 --- a/Kudos/Package.juvix +++ b/Kudos/Package.juvix @@ -3,10 +3,12 @@ module Package; import PackageDescription.V2 open; package : Package := - defaultPackage - {name := "kudos"; - dependencies := [ github "anoma" "juvix-anoma-stdlib" "v0.1.0" - ; github "anoma" "juvix-stdlib" "v0.4.0" - ; github "anoma" "juvix-containers" "v0.12.1" - ; github "anoma" "anoma-app-patterns" "v0.1.2" - ]}; + defaultPackage@{ + name := "kudos"; + dependencies := + [ github "anoma" "juvix-stdlib" "ff351799c068e7b3e23dd903547d228dc30aff5e" + ; github "anoma" "juvix-test" "v0.15.0" + ; github "anoma" "juvix-arm-transparent" "efb1be6b0448690fb4d0b95a58f88fb1d5c7cc3e" + ; github "anoma" "anoma-app-lib" "32ff9d624aa8548f979deaff1340f4dbd4cf7b72" + ] + }; diff --git a/Kudos/juvix.lock.yaml b/Kudos/juvix.lock.yaml index 9ffb084..3eec868 100644 --- a/Kudos/juvix.lock.yaml +++ b/Kudos/juvix.lock.yaml @@ -1,61 +1,61 @@ -# This file was autogenerated by Juvix version 0.6.3. +# This file was autogenerated by Juvix version 0.6.6. # Do not edit this file manually. version: 2 -checksum: 9294a03e0b25e28ba9f5c2523d2b99b392fa930c2446eee7b55ff0b3557ae452 +checksum: a08e32ccb9183e0e50aaed60ba838db6fb58678e262c0965938d437aaea9e2c2 dependencies: - git: - name: anoma_juvix-anoma-stdlib - ref: 835ce837e75c35319ab7e362953f23f1bc5fd3e5 - url: https://github.com/anoma/juvix-anoma-stdlib + name: anoma_juvix-stdlib + ref: ff351799c068e7b3e23dd903547d228dc30aff5e + url: https://github.com/anoma/juvix-stdlib + dependencies: [] +- git: + name: anoma_juvix-test + ref: 3103c41e055eb9018a851fd3688cd608cad8f55d + url: https://github.com/anoma/juvix-test dependencies: - git: name: anoma_juvix-stdlib - ref: 89a5960fb8a29291e9271986b98ca7b1edf4031b + ref: 615a02c8107076ca9661c5234d41792be91a5104 url: https://github.com/anoma/juvix-stdlib dependencies: [] - git: - name: anoma_juvix-stdlib - ref: 89a5960fb8a29291e9271986b98ca7b1edf4031b - url: https://github.com/anoma/juvix-stdlib - dependencies: [] -- git: - name: anoma_juvix-containers - ref: c4c7af9bdf36aa9d2dbdc7e0372dd9278f60ff26 - url: https://github.com/anoma/juvix-containers + name: anoma_juvix-arm-transparent + ref: efb1be6b0448690fb4d0b95a58f88fb1d5c7cc3e + url: https://github.com/anoma/juvix-arm-transparent dependencies: - git: name: anoma_juvix-stdlib - ref: 89a5960fb8a29291e9271986b98ca7b1edf4031b + ref: ff351799c068e7b3e23dd903547d228dc30aff5e url: https://github.com/anoma/juvix-stdlib dependencies: [] - git: - name: anoma_anoma-app-patterns - ref: f5d761eb0a92aa969f2b9f9014a650fbef7f8b47 - url: https://github.com/anoma/anoma-app-patterns + name: anoma_anoma-app-lib + ref: 32ff9d624aa8548f979deaff1340f4dbd4cf7b72 + url: https://github.com/anoma/anoma-app-lib dependencies: - git: - name: anoma_juvix-anoma-stdlib - ref: 835ce837e75c35319ab7e362953f23f1bc5fd3e5 - url: https://github.com/anoma/juvix-anoma-stdlib + name: anoma_juvix-stdlib + ref: ff351799c068e7b3e23dd903547d228dc30aff5e + url: https://github.com/anoma/juvix-stdlib + dependencies: [] + - git: + name: anoma_juvix-test + ref: 3103c41e055eb9018a851fd3688cd608cad8f55d + url: https://github.com/anoma/juvix-test dependencies: - git: name: anoma_juvix-stdlib - ref: 89a5960fb8a29291e9271986b98ca7b1edf4031b + ref: 615a02c8107076ca9661c5234d41792be91a5104 url: https://github.com/anoma/juvix-stdlib dependencies: [] - git: - name: anoma_juvix-stdlib - ref: 89a5960fb8a29291e9271986b98ca7b1edf4031b - url: https://github.com/anoma/juvix-stdlib - dependencies: [] - - git: - name: anoma_juvix-containers - ref: c4c7af9bdf36aa9d2dbdc7e0372dd9278f60ff26 - url: https://github.com/anoma/juvix-containers + name: anoma_juvix-arm-transparent + ref: efb1be6b0448690fb4d0b95a58f88fb1d5c7cc3e + url: https://github.com/anoma/juvix-arm-transparent dependencies: - git: name: anoma_juvix-stdlib - ref: 89a5960fb8a29291e9271986b98ca7b1edf4031b + ref: ff351799c068e7b3e23dd903547d228dc30aff5e url: https://github.com/anoma/juvix-stdlib dependencies: [] diff --git a/SUBMIT_TO_ANOMA_NODE.md b/SUBMIT_TO_ANOMA_NODE.md index 08ca3f5..fbcf8a5 100644 --- a/SUBMIT_TO_ANOMA_NODE.md +++ b/SUBMIT_TO_ANOMA_NODE.md @@ -1,81 +1 @@ -# How to Submit a Transaction to an Anoma Node - -## Dependencies - -### Anoma Node - -Install [Anoma Node](https://github.com/anoma/anoma) using branch: `marari-paul/juvix-resource-submission`. - -Assuming you've installed the [Anoma Node dependencies](https://github.com/anoma/anoma?tab=readme-ov-file#dependencies) -and you are authorized to clone the [Anoma Node repository](https://github.com/anoma/anoma) run: - -```shell -git clone https://github.com/anoma/anoma -git checkout marari-paul/juvix-resource-submission -mix deps.get -mix compile -``` - -### Juvix - -Download a copy of the [Juvix nightly build binary](https://github.com/anoma/juvix-nightly-builds/releases/latest) -for you computer's architecture and copy this somewhere on your environment's `PATH`. - -## Running the Anoma Node - -In the directory containing the Anoma Node clone run: - -```shell -MIX_ENV=prod mix run --no-halt -``` - -## Compiling an Anoma Transaction - -An Anoma transaction is defined using the [`Transaction`](https://github.com/anoma/juvix-anoma-stdlib/blob/b91e93a7582a7ac87e7756e39c28affc05926dca/Anoma/Transaction.juvix#L78) type. - -A Juvix module that compiles to an Anoma transaction must contain a function called `main` with type `Transaction`: - - -MyTransaction.juvix -``` -module MyTransaction; - --- Add https://github.com/anoma/juvix-anoma-stdlib as a dependency in the Juvix project `Package.juvix` -import Anoma open; - -main : Transaction := ... -``` - -Such a module can then be compiled using `juvix`: - -```shell -juvix compile anoma MyTransaction.juvix -``` - -The result is a file called `MyTransaction.nockma`, this is the file that should be submitted to the Anoma Node. - - -### Simple Counter Application Example - -To compile [`SimpleCounter.juvix`](./SimpleCounter/SimpleCounter.juvix) to an Anoma transaction run: - -```shell -juvix compile anoma SimpleCounter/SimpleCounter.juvix -``` - -The result is a file called `SimpleCounter.nockma`. - -## Submitting a Transaction to the Anoma Node - -To submit a transaction to the Anoma Node use the `mix client rm-submit` tool. -This command must be run from the Anoma Node root directory. - -Pass the path to a `.nockma` file you produced with the `juvix compile anoma` command. - -For example, to submit the `SimpleCounter.nockma` file from the previous section run: - -```shell -mix client rm-submit PATH_TO_ANOMA_APPS_CLONE_DIR/SimpleCounter.nockma -``` - -The tool currently provides no feedback to the user. +# Anoma Apps diff --git a/SimpleCounter/Package.juvix b/SimpleCounter/Package.juvix deleted file mode 100644 index 072be18..0000000 --- a/SimpleCounter/Package.juvix +++ /dev/null @@ -1,10 +0,0 @@ -module Package; - -import PackageDescription.V2 open; - -package : Package := - defaultPackage - {name := "simplecounter"; - dependencies := [ defaultStdlib - ; github "anoma" "juvix-anoma-stdlib" "v0.1.0" - ]}; diff --git a/SimpleCounter/README.md b/SimpleCounter/README.md deleted file mode 100644 index d510703..0000000 --- a/SimpleCounter/README.md +++ /dev/null @@ -1,39 +0,0 @@ -# A Simple Counter application - -Status: DRAFT - -## Interface - -### Initialize - -Create a counter type with an initial value. - -### Update - -Update the value of an existing counter. - -## Logic - -### Initialize - -The value of the counter must be 0. - -### Update - -The types of the counter before and after must be equal. The value of the counter must be incremented by 1. - -## How to run it - -You need: - -* A copy of the latest [juvix nightly build](https://github.com/anoma/juvix-nightly-builds/releases/tag/nightly-2024-06-07-0.6.2-ce938ef) - -* A clone of [anoma](https://github.com/anoma/anoma) checked out at branch: `paul/juvix-resource-test` - -Then: - -* Compile the `SimpleCounter.juvix` with Juvix: `juvix compile anoma SimpleCounter.juvix` - -* Copy the output file `SimpleCounter.nockma` to the root of the Anoma clone you made in the previous step: `cp SimpleCounter.nockma $PATH_TO_ANOMA_CLONE/RawCounterTransaction.nockma` - -* Run the test that verifies the transaction in Anoma: `mix test test/resource_test.exs:218` diff --git a/SimpleCounter/SimpleCounter.juvix b/SimpleCounter/SimpleCounter.juvix deleted file mode 100644 index 3c64e07..0000000 --- a/SimpleCounter/SimpleCounter.juvix +++ /dev/null @@ -1,83 +0,0 @@ -module SimpleCounter; - -import Anoma.Transaction open; -import Stdlib.Prelude open; -import Anoma.Extra open; - -open Transaction; -open DeltaComponent; - --- Included for demo purposed only. This will be part of offline computation. -privKey : Nat := - 0xddd315c76991f8e058760cacdd19c21bf6a12c72bc229a60ad6aaa314fa07ac11662fc6e7829efcb0f4500827d49bb699af7b5475cef5220fd600ebbf9709a58; - -pubKey : Nat := - 0xddd315c76991f8e058760cacdd19c21bf6a12c72bc229a60ad6aaa314fa07ac1; - -counterLogic (r : Resource) (tx : Transaction) : Bool := - let - rs : ResourcePartition := partitionResources tx; - in case - ResourcePartition.consumed rs - , ResourcePartition.created rs - of - | [old], [new] := - if - -- init counter - -- TODO should we check for label/kind? - | Resource.eph old := Resource.data new == 0 - -- increment counter - | else := - -- TODO should we compare for kind equality instead? - Resource.label - new - == Resource.label old - && Resource.data new == Resource.data old + 1 - | _ := false; - -mkCounter (ephemeral : Bool) (n : Nat) : Resource := - Resource.mk@{ - logic := counterLogic; - label := 0; - quantity := 1; - data := n; - eph := ephemeral; - npk := pubKey; - nonce := 0; - rseed := 0 - }; - -zeroedCounter : Resource := mkCounter false 0; - -incrementedCounter : Resource := mkCounter false 1; - -dummy : Resource := mkCounter true 666666; - -mkCounterTransaction - (consumed : Resource) - (created : Resource) - : Transaction := - Transaction.mk@{ - roots := []; - commitments := [commitment created]; - nullifiers := [nullifier consumed privKey]; - proofs := [consumed; created]; - delta := []; - extra := 0; - preference := 0 - }; - ---- A transaction function that initializes a new counter -init (resource : Resource) : Transaction := - mkCounterTransaction dummy resource; - ---- A transaction function that increments an existing counter -update (old new : Resource) : Transaction := - mkCounterTransaction old new; - -mainHelper (initCase : Bool) : Transaction := - if - | initCase := init zeroedCounter - | else := update zeroedCounter incrementedCounter; - -main : Transaction := mainHelper true; diff --git a/SimpleCounter/juvix.lock.yaml b/SimpleCounter/juvix.lock.yaml deleted file mode 100644 index 6837b37..0000000 --- a/SimpleCounter/juvix.lock.yaml +++ /dev/null @@ -1,18 +0,0 @@ -# This file was autogenerated by Juvix version 0.6.3. -# Do not edit this file manually. - -version: 2 -checksum: d4d7643f2d4d193af44a11088b92b852ae2fdc14d3be8b071aa8f1158f83c340 -dependencies: -- path: .juvix-build/stdlib/ - dependencies: [] -- git: - name: anoma_juvix-anoma-stdlib - ref: 835ce837e75c35319ab7e362953f23f1bc5fd3e5 - url: https://github.com/anoma/juvix-anoma-stdlib - dependencies: - - git: - name: anoma_juvix-stdlib - ref: 89a5960fb8a29291e9271986b98ca7b1edf4031b - url: https://github.com/anoma/juvix-stdlib - dependencies: [] diff --git a/SimpleCounter/tests/Package.juvix b/SimpleCounter/tests/Package.juvix deleted file mode 100644 index 21058c6..0000000 --- a/SimpleCounter/tests/Package.juvix +++ /dev/null @@ -1,14 +0,0 @@ -module Package; - -import PackageDescription.V2 open; - -package : Package := - defaultPackage@?{ - name := "simplecounter-tests"; - dependencies := - [ defaultStdlib - ; github "anoma" "juvix-anoma-test" "v0.1.1" - ; github "anoma" "juvix-test" "v0.11.0" - ; path "../" - ] - }; diff --git a/SimpleCounter/tests/SimpleCounterTests.juvix b/SimpleCounter/tests/SimpleCounterTests.juvix deleted file mode 100644 index 11dff9e..0000000 --- a/SimpleCounter/tests/SimpleCounterTests.juvix +++ /dev/null @@ -1,23 +0,0 @@ -module SimpleCounterTests; - -import Stdlib.Prelude open; -import Test.Anoma open; -import Test.JuvixUnit open; -import SimpleCounter open; - -tests : List Test := - [ testCase - "init counter with zeroedCounter is valid" - (anomaAssertPass (verify (init zeroedCounter))) - ; testCase - "init counter with incrementedCounter is invalid" - (anomaAssertFail (verify (init incrementedCounter))) - ; testCase - "update with zeroedCounter and incrementedCounter is valid" - (anomaAssertPass - (verify (update zeroedCounter incrementedCounter))) - ; testCase - "update with zeroedCounter and zeroedCounter is invalid" - (anomaAssertFail - (verify (update zeroedCounter zeroedCounter))) - ]; diff --git a/SimpleCounter/tests/juvix.lock.yaml b/SimpleCounter/tests/juvix.lock.yaml deleted file mode 100644 index 561c3ca..0000000 --- a/SimpleCounter/tests/juvix.lock.yaml +++ /dev/null @@ -1,72 +0,0 @@ -# This file was autogenerated by Juvix version 0.6.3. -# Do not edit this file manually. - -version: 2 -checksum: bd05cf1a8cadb5c2486c0967a69d64e69e164fab40edb78d5d85e01875a9a8bd -dependencies: -- path: .juvix-build/stdlib/ - dependencies: [] -- git: - name: anoma_juvix-anoma-test - ref: f6a44eb714604bbaf923ebda31cdf4e7862d0186 - url: https://github.com/anoma/juvix-anoma-test - dependencies: - - git: - name: anoma_juvix-anoma-stdlib - ref: 835ce837e75c35319ab7e362953f23f1bc5fd3e5 - url: https://github.com/anoma/juvix-anoma-stdlib - dependencies: - - git: - name: anoma_juvix-stdlib - ref: 89a5960fb8a29291e9271986b98ca7b1edf4031b - url: https://github.com/anoma/juvix-stdlib - dependencies: [] - - git: - name: anoma_juvix-stdlib - ref: 89a5960fb8a29291e9271986b98ca7b1edf4031b - url: https://github.com/anoma/juvix-stdlib - dependencies: [] - - git: - name: anoma_juvix-containers - ref: c4c7af9bdf36aa9d2dbdc7e0372dd9278f60ff26 - url: https://github.com/anoma/juvix-containers - dependencies: - - git: - name: anoma_juvix-stdlib - ref: 89a5960fb8a29291e9271986b98ca7b1edf4031b - url: https://github.com/anoma/juvix-stdlib - dependencies: [] - - git: - name: anoma_juvix-test - ref: 4254b60351f283f31868498d4e238af8259243f8 - url: https://github.com/anoma/juvix-test - dependencies: - - git: - name: anoma_juvix-stdlib - ref: 89a5960fb8a29291e9271986b98ca7b1edf4031b - url: https://github.com/anoma/juvix-stdlib - dependencies: [] -- git: - name: anoma_juvix-test - ref: 4254b60351f283f31868498d4e238af8259243f8 - url: https://github.com/anoma/juvix-test - dependencies: - - git: - name: anoma_juvix-stdlib - ref: 89a5960fb8a29291e9271986b98ca7b1edf4031b - url: https://github.com/anoma/juvix-stdlib - dependencies: [] -- path: ../ - dependencies: - - path: .juvix-build/stdlib/ - dependencies: [] - - git: - name: anoma_juvix-anoma-stdlib - ref: 835ce837e75c35319ab7e362953f23f1bc5fd3e5 - url: https://github.com/anoma/juvix-anoma-stdlib - dependencies: - - git: - name: anoma_juvix-stdlib - ref: 89a5960fb8a29291e9271986b98ca7b1edf4031b - url: https://github.com/anoma/juvix-stdlib - dependencies: [] diff --git a/tests/Main.juvix b/tests/Main.juvix deleted file mode 100644 index c48ae74..0000000 --- a/tests/Main.juvix +++ /dev/null @@ -1,9 +0,0 @@ -module Main; - -import Stdlib.Prelude open; -import SimpleCounterTests; -import Test.JuvixUnit open; - -main : IO := - runTestSuite - (testSuite "SimpleCounter tests" SimpleCounterTests.tests); diff --git a/tests/Package.juvix b/tests/Package.juvix deleted file mode 100644 index 035b9aa..0000000 --- a/tests/Package.juvix +++ /dev/null @@ -1,12 +0,0 @@ -module Package; - -import PackageDescription.V2 open; - -package : Package := - defaultPackage { - name := "anoma-apps-tests"; - dependencies := [ - defaultStdlib - ; github "anoma" "juvix-test" "v0.11.0" - ; path "../SimpleCounter/tests"] - }; diff --git a/tests/juvix.lock.yaml b/tests/juvix.lock.yaml deleted file mode 100644 index 7ef5ca7..0000000 --- a/tests/juvix.lock.yaml +++ /dev/null @@ -1,86 +0,0 @@ -# This file was autogenerated by Juvix version 0.6.3. -# Do not edit this file manually. - -version: 2 -checksum: d87fd331b8995c3c7132891e739e8ee59e768b9ba40d84de6c9fdf43e43fd33d -dependencies: -- path: .juvix-build/stdlib/ - dependencies: [] -- git: - name: anoma_juvix-test - ref: 4254b60351f283f31868498d4e238af8259243f8 - url: https://github.com/anoma/juvix-test - dependencies: - - git: - name: anoma_juvix-stdlib - ref: 89a5960fb8a29291e9271986b98ca7b1edf4031b - url: https://github.com/anoma/juvix-stdlib - dependencies: [] -- path: ../SimpleCounter/tests - dependencies: - - path: .juvix-build/stdlib/ - dependencies: [] - - git: - name: anoma_juvix-anoma-test - ref: f6a44eb714604bbaf923ebda31cdf4e7862d0186 - url: https://github.com/anoma/juvix-anoma-test - dependencies: - - git: - name: anoma_juvix-anoma-stdlib - ref: 835ce837e75c35319ab7e362953f23f1bc5fd3e5 - url: https://github.com/anoma/juvix-anoma-stdlib - dependencies: - - git: - name: anoma_juvix-stdlib - ref: 89a5960fb8a29291e9271986b98ca7b1edf4031b - url: https://github.com/anoma/juvix-stdlib - dependencies: [] - - git: - name: anoma_juvix-stdlib - ref: 89a5960fb8a29291e9271986b98ca7b1edf4031b - url: https://github.com/anoma/juvix-stdlib - dependencies: [] - - git: - name: anoma_juvix-containers - ref: c4c7af9bdf36aa9d2dbdc7e0372dd9278f60ff26 - url: https://github.com/anoma/juvix-containers - dependencies: - - git: - name: anoma_juvix-stdlib - ref: 89a5960fb8a29291e9271986b98ca7b1edf4031b - url: https://github.com/anoma/juvix-stdlib - dependencies: [] - - git: - name: anoma_juvix-test - ref: 4254b60351f283f31868498d4e238af8259243f8 - url: https://github.com/anoma/juvix-test - dependencies: - - git: - name: anoma_juvix-stdlib - ref: 89a5960fb8a29291e9271986b98ca7b1edf4031b - url: https://github.com/anoma/juvix-stdlib - dependencies: [] - - git: - name: anoma_juvix-test - ref: 4254b60351f283f31868498d4e238af8259243f8 - url: https://github.com/anoma/juvix-test - dependencies: - - git: - name: anoma_juvix-stdlib - ref: 89a5960fb8a29291e9271986b98ca7b1edf4031b - url: https://github.com/anoma/juvix-stdlib - dependencies: [] - - path: ../ - dependencies: - - path: .juvix-build/stdlib/ - dependencies: [] - - git: - name: anoma_juvix-anoma-stdlib - ref: 835ce837e75c35319ab7e362953f23f1bc5fd3e5 - url: https://github.com/anoma/juvix-anoma-stdlib - dependencies: - - git: - name: anoma_juvix-stdlib - ref: 89a5960fb8a29291e9271986b98ca7b1edf4031b - url: https://github.com/anoma/juvix-stdlib - dependencies: []