Skip to content

Commit

Permalink
Remove Message and Transaction submodule
Browse files Browse the repository at this point in the history
I didn't want to remove Message here but it's too embeded and it
wasn't clear what the logic was doing, so this removes that as well in
collatoral
  • Loading branch information
mariari committed Dec 18, 2024
1 parent 15a07cc commit 82ada34
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 247 deletions.
2 changes: 1 addition & 1 deletion Anoma.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ module Anoma;

-- import Anoma.Random open public;
-- import Anoma.Primitives open public;
import Anoma.Transaction.CustomInputs open public;
import Anoma.Resource open public;
import Anoma.Transaction open public;
import Anoma.Identity open public;
import Anoma.Builtin.ByteArray open public;
-- import Anoma.Compliance as Compliance public;
Expand Down
6 changes: 0 additions & 6 deletions Anoma/Transaction.juvix

This file was deleted.

6 changes: 0 additions & 6 deletions Anoma/Transaction/Action.juvix

This file was deleted.

63 changes: 0 additions & 63 deletions Anoma/Transaction/AppData.juvix

This file was deleted.

5 changes: 0 additions & 5 deletions Anoma/Transaction/Object.juvix

This file was deleted.

1 change: 0 additions & 1 deletion Applib/Authorization.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ module Applib.Authorization;

-- import Applib.Authorization.Check as Check open public;
import Applib.Identities as Identities open public;
import Applib.Authorization.Message as Message open public;
142 changes: 0 additions & 142 deletions Applib/Authorization/Message.juvix

This file was deleted.

31 changes: 8 additions & 23 deletions Applib/Helpers.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,6 @@ lookupResource {A} (key : A) (customInputs : CustomInputs) : Maybe Resource :=
customInputs;
};

toAppDataEntry
{Key Data : Type}
(key : Key)
(data : Data)
{deletionCriterion : DeletionCriterion := StoreForever}
: Pair AppDataKey AppDataValue :=

mkAppDataKey@{
unAppDataKey := anomaEncode key;
}
, mkAppDataValue@{
data := anomaEncode data;
deletionCriterion;
};

toCustomInputsEntry
{Key Value : Type}
(key : Key)
Expand Down Expand Up @@ -96,7 +81,7 @@ type TagsAndCustomInputs :=
};

mkActionHelper
(consumed created : List Resource) {app-data : Nat := 0} : Action :=
(consumed created : List Resource) {app-data : Nat := 0} : BaseLayer.Action :=
let
nullifiers := map BaseLayer.nullifier consumed;
commitments := map BaseLayer.commitment created;
Expand All @@ -122,7 +107,7 @@ mkActionHelper
map (resource, tag in all-resources) {
BaseLayer.proofLogic resource (public-inputs tag, private)
};
in mkAction@{
in BaseLayer.mkAction@{
commitments;
nullifiers;
proofs := logicProofs;
Expand All @@ -131,16 +116,16 @@ mkActionHelper

mkTransactionHelper
{roots : List CommitmentTree.Root := []}
(actions : List Action)
: Transaction :=
mkTransaction@{
(actions : List BaseLayer.Action)
: BaseLayer.Transaction :=
BaseLayer.mkTransaction@{
roots := map CommitmentTree.unRoot roots;
actions;
delta := BaseLayer.zeroDelta;
deltaProof := 0;
};

emptyTx : Transaction :=
emptyTx : BaseLayer.Transaction :=
mkTransactionHelper@{
roots := [];
actions := [];
Expand All @@ -156,13 +141,13 @@ prepareStandardTransaction
(standardInputs : StandardInputs)
(consumed created : List Resource)
{app-data : Nat := 0}
: Transaction :=
: BaseLayer.Transaction :=
mkTransactionHelper@{
roots := [StandardInputs.currentRoot standardInputs];
actions := [mkActionHelper consumed created {app-data}];
};

composeAll (txs : Set Transaction) : Transaction :=
composeAll (txs : Set BaseLayer.Transaction) : BaseLayer.Transaction :=
for (acc := emptyTx) (tx in txs) {
BaseLayer.compose acc tx
};
Expand Down

0 comments on commit 82ada34

Please sign in to comment.