Skip to content

Commit

Permalink
Remove the Logic submodule
Browse files Browse the repository at this point in the history
This got rid of the Logic indirection rexporting the real module where
functions are coming from
  • Loading branch information
mariari committed Dec 18, 2024
1 parent 8760b1c commit 15a07cc
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 119 deletions.
3 changes: 0 additions & 3 deletions Anoma.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@ import Anoma.Transaction open public;
import Anoma.Identity open public;
import Anoma.Builtin.ByteArray open public;
-- import Anoma.Compliance as Compliance public;
import Anoma.Logic as Logic public;
import Anoma.Delta as Delta public;
import Anoma.Logic open using {Logic} public;
import Anoma.Delta open using {Delta} public;
-- import Anoma.Logic open using {Logic} public;
-- import Anoma.Delta open using {Delta} public;
-- import Anoma.State open public;
import Anoma.Random open public;
Expand Down
4 changes: 0 additions & 4 deletions Anoma/Logic.juvix

This file was deleted.

13 changes: 0 additions & 13 deletions Anoma/Logic/ProvingSystem.juvix

This file was deleted.

71 changes: 0 additions & 71 deletions Anoma/Logic/Types.juvix

This file was deleted.

16 changes: 8 additions & 8 deletions Applib/Helpers.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,27 @@ import BaseLayer.ResourceMachine as BaseLayer;
import Applib.Resource.Traits.Convertable open;

findResourceByNullifier
(nf : Nat) (privateInputs : Logic.Witness) : Maybe Resource :=
(nf : Nat) (privateInputs : BaseLayer.Witness) : Maybe Resource :=
let
hasNullifier (nf : Nat) (r : Resource) : Bool := BaseLayer.nullifier r == nf;
getConsumed (nf : Nat) : Maybe Resource :=
find (hasNullifier nf) (Logic.Witness.consumed privateInputs);
find (hasNullifier nf) (BaseLayer.Witness.consumed privateInputs);
in getConsumed nf;

findResourceByCommitment
(cm : Nat) (privateInputs : Logic.Witness) : Maybe Resource :=
(cm : Nat) (privateInputs : BaseLayer.Witness) : Maybe Resource :=
let
hasCommitment (cm : Nat) (r : Resource) : Bool := BaseLayer.commitment r == cm;
getCreated (cm : Nat) : Maybe Resource :=
find (hasCommitment cm) (Logic.Witness.created privateInputs);
find (hasCommitment cm) (BaseLayer.Witness.created privateInputs);
in getCreated cm;

type ResourceStatus :=
| NonExisting
| CreatedRes Resource
| ConsumedRes Resource;

findResource (tag : Nat) (privateInputs : Logic.Witness) : ResourceStatus :=
findResource (tag : Nat) (privateInputs : BaseLayer.Witness) : ResourceStatus :=
case findResourceByNullifier tag privateInputs of
| just consumed := ConsumedRes consumed
| nothing :=
Expand Down Expand Up @@ -102,17 +102,17 @@ mkActionHelper
commitments := map BaseLayer.commitment created;
all-resources := zip consumed nullifiers ++ zip created commitments;

public-inputs : Nat -> Logic.Instance
public-inputs : Nat -> BaseLayer.Instance
| tag :=
Logic.mkInstance@{
BaseLayer.mkInstance@{
commitments;
nullifiers;
tag;
app-data;
};

private :=
Logic.mkWitness@{
BaseLayer.mkWitness@{
created;
consumed;
customInputs := 0;
Expand Down
20 changes: 0 additions & 20 deletions Applib/Resource/Traits/Logic.juvix

This file was deleted.

0 comments on commit 15a07cc

Please sign in to comment.