Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update deps #57

Merged
merged 5 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ jobs:
uses: jaxxstorm/[email protected]
with:
repo: anoma/juvix-nightly-builds
tag: nightly-2024-11-01-0.6.6-68a79bc
cache: enable
- name: Clean
run: juvix clean --global && juvix dependencies update
Expand Down
35 changes: 1 addition & 34 deletions Applib/Helpers.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -23,39 +23,6 @@ import Anoma.Builtin.System open;
import Applib.Random open;
import Applib.Resource.Traits.Convertable open;

-- TODO Move to "juvix-arm-specs"
instance
ExternalIdentity-Show : Show ExternalIdentity :=
mkShow
\{id :=
id
|> ExternalIdentity.unExternalIdentity
|> toAnomaContents
|> natToString};

-- TODO Move to "juvix-arm-specs"
instance
InternalIdentity-Show : Show InternalIdentity :=
mkShow
\{id :=
id
|> InternalIdentity.unInternalIdentity
|> toAnomaContents
|> natToString};

-- TODO Move to "juvix-arm-specs"
instance
Identity-Show : Show Identity :=
mkShow
\{id :=
"{"
++str "external : "
++str (id |> Identity.external |> Show.show)
++str ", "
++str "internal : "
++str (id |> Identity.internal |> Show.show)
++str "}"};

isNullifierPresent
(nullifier : Nullifier) (nullifierSet : Set Nullifier) : Bool :=
Set.isMember nullifier nullifierSet;
Expand Down Expand Up @@ -315,7 +282,7 @@ mkTransactionHelper
roots;
actions;
delta := Delta.zero;
deltaProofRecord := createDeltaProofRecord;
deltaProofRecord := emptyDeltaProofRecord;
};

emptyTx : Transaction :=
Expand Down
6 changes: 3 additions & 3 deletions Applib/Intent/Swap/Resource.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ module SwapIntent;
: SwapIntent :=
mk
mkResource@{
logicRef := Reference.to (swapIntentLogic want receiver);
labelRef := Reference.to (mkLabel 0);
valueRef := Reference.to (mkValue 0);
logicRef := BindingReference.compute (swapIntentLogic want receiver);
labelRef := BindingReference.compute (mkLabel 0);
valueRef := BindingReference.compute (mkValue 0);
quantity := 1;
ephemeral := true;
nullifierKeyCommitment := Universal.nullifierKeyCommitment;
Expand Down
4 changes: 2 additions & 2 deletions Applib/Resource/Traits/Logic.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ instance
Resource-HasLogic : HasLogic Resource :=
mkHasLogic@{
get (resource : Resource) : Logic :=
resource |> Resource.logicRef |> Reference.from;
resource |> Resource.logicRef |> lookupFromReferenceChecked;

set (logic : Logic) (resource : Resource) : Resource :=
resource@Resource{logicRef := Reference.to logic};
resource@Resource{logicRef := BindingReference.compute logic};
};
4 changes: 2 additions & 2 deletions Applib/Resource/Traits/ValueMap.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Resource-HasValueMap : HasValueMap Resource :=
get (resource : Resource) : ValueMap :=
resource
|> Resource.valueRef
|> Reference.from
|> lookupFromReferenceChecked
|> Value.unValue
|> anomaDecode;

Expand All @@ -34,5 +34,5 @@ Resource-HasValueMap : HasValueMap Resource :=
resource@Resource{valueRef := valueMap
|> anomaEncode
|> mkValue
|> Reference.to};
|> BindingReference.compute};
};
10 changes: 7 additions & 3 deletions Applib/Token/Label.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ TokenLabel-Show : Show TokenLabel :=
++str "}"};

getTokenLabel (r : Resource) : TokenLabel :=
r |> Resource.labelRef |> Reference.from |> Label.unLabel |> anomaDecode;
r
|> Resource.labelRef
|> lookupFromReferenceChecked
|> Label.unLabel
|> anomaDecode;

getTokenName (r : Resource) : String := TokenLabel.name (getTokenLabel r);

Expand All @@ -66,10 +70,10 @@ isTransferable (r : Resource) : Bool :=
r |> getTokenLabel |> TokenLabel.transferability |> Transferability.toBool;

toLabelRef (tokenLabel : TokenLabel) : LabelRef :=
tokenLabel |> anomaEncode |> mkLabel |> Reference.to;
tokenLabel |> anomaEncode |> mkLabel |> BindingReference.compute;

fromLabelRef (labelRef : LabelRef) : TokenLabel :=
labelRef |> Reference.from |> Label.unLabel |> anomaDecode;
labelRef |> lookupFromReferenceChecked |> Label.unLabel |> anomaDecode;

type InvalidLabelError :=
mkInvalidLabelError@{
Expand Down
8 changes: 4 additions & 4 deletions Applib/Token/Resource.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ module Token;
mk
mkResource@{
logicRef :=
Reference.to
BindingReference.compute
(tokenLogic
(TokenLabel.supply tokenLabel)
(TokenLabel.originator tokenLabel));
labelRef := toLabelRef tokenLabel;
valueRef :=
Reference.to
BindingReference.compute
(owner
|> ownershipValueMapEntry
|> Set.singleton
Expand Down Expand Up @@ -85,14 +85,14 @@ Token-HasOwner : HasOwner Token :=
token
|> Convertable.toResource
|> Resource.valueRef
|> Reference.from
|> lookupFromReferenceChecked
|> Value.unValue
|> anomaDecode;
set (owner : ExternalIdentity) (token : Token) : Token :=
(token |> Convertable.toResource)@Resource{valueRef := owner
|> anomaEncode
|> mkValue
|> Reference.to}
|> BindingReference.compute}
|> Convertable.fromResource;
};

Expand Down
2 changes: 1 addition & 1 deletion Applib/Utils/Counter/Simple/Count.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ import Anoma.Builtin.System open;
--- @param resource The counter resource.
--- @return The count.
getCount (counter : Resource) : Nat :=
counter |> Resource.valueRef |> Reference.from |> Value.unValue;
counter |> Resource.valueRef |> lookupFromReferenceChecked |> Value.unValue;
10 changes: 5 additions & 5 deletions Applib/Utils/Counter/Simple/Resource.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import Applib.Utils.Counter.Simple.Logic open;
--- @return The constructed counter resource.
mkCounter {count : Nat := 0} {ephemeral : Bool := false} : Resource :=
mkResource@{
logicRef := Reference.to (counterLogic);
labelRef := Reference.to (counterLabel);
valueRef := Reference.to (count |> mkValue);
logicRef := BindingReference.compute (counterLogic);
labelRef := BindingReference.compute (counterLabel);
valueRef := BindingReference.compute (count |> mkValue);
quantity := 1;
ephemeral;
nullifierKeyCommitment := Universal.nullifierKeyCommitment;
Expand All @@ -32,6 +32,6 @@ mkCounter {count : Nat := 0} {ephemeral : Bool := false} : Resource :=
--- @return The counter kind.
counterKind : Kind :=
KindInternal.kind@{
logicRef := Reference.to (counterLogic);
labelRef := Reference.to (counterLabel);
logicRef := BindingReference.compute (counterLogic);
labelRef := BindingReference.compute (counterLabel);
};
2 changes: 1 addition & 1 deletion Applib/Utils/Counter/Unique/Label.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ CounterLabel-Eq : Eq CounterLabel :=
getCounterLabel (counter : Resource) : CounterLabel :=
counter
|> Resource.labelRef
|> Reference.from
|> lookupFromReferenceChecked
|> Label.unLabel
|> anomaDecode;

Expand Down
9 changes: 5 additions & 4 deletions Applib/Utils/Counter/Unique/Resource.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ mkCounter
{ephemeral : Bool := false}
: Resource :=
mkResource@{
logicRef := Reference.to (counterLogic);
labelRef := Reference.to (uniqueLabel |> anomaEncode |> mkLabel);
valueRef := Reference.to (count |> mkValue);
logicRef := BindingReference.compute (counterLogic);
labelRef :=
BindingReference.compute (uniqueLabel |> anomaEncode |> mkLabel);
valueRef := BindingReference.compute (count |> mkValue);
quantity := 1;
ephemeral;
nullifierKeyCommitment := Universal.nullifierKeyCommitment;
Expand All @@ -37,6 +38,6 @@ mkCounter
--- @return The counter kind.
counterKind (labelRef : LabelRef) : Kind :=
KindInternal.kind@{
logicRef := Reference.to (counterLogic);
logicRef := BindingReference.compute (counterLogic);
labelRef;
};
6 changes: 3 additions & 3 deletions Applib/Utils/Dummy/Projection.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ readValueField (dummyResources : Set Resource) : List String :=
let
expectedKind :=
KindInternal.kind@{
logicRef := Reference.to alwaysValidLogic;
labelRef := Reference.to emptyLabel;
logicRef := BindingReference.compute alwaysValidLogic;
labelRef := BindingReference.compute emptyLabel;
};
in "DEBUG: Evaluating `Applib.Utils.Dummy.Projection.readValueField`"
>-> map (resource in Set.toList dummyResources) {
Expand All @@ -31,7 +31,7 @@ readValueField (dummyResources : Set Resource) : List String :=
| true :=
resource
|> Resource.valueRef
|> Reference.from
|> lookupFromReferenceChecked
|> Value.unValue
|> anomaDecode
|> ok
Expand Down
7 changes: 4 additions & 3 deletions Applib/Utils/Dummy/Resource.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ alwaysValidResource
: Resource :=
"DEBUG: Evaluating `Applib.Utils.Dummy.alwaysValidResource`"
>-> mkResource@{
logicRef := Reference.to alwaysValidLogic;
labelRef := Reference.to emptyLabel;
valueRef := Reference.to (mkValue (anomaEncode dummyValue));
logicRef := BindingReference.compute alwaysValidLogic;
labelRef := BindingReference.compute emptyLabel;
valueRef :=
BindingReference.compute (mkValue (anomaEncode dummyValue));
quantity;
ephemeral;
nullifierKeyCommitment := Universal.nullifierKeyCommitment;
Expand Down
4 changes: 2 additions & 2 deletions Applib/Utils/Dummy/Transaction/Finalize.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ finalize (standardInputs : StandardInputs) (dummy : Resource) : Transaction :=
let
expectedKind :=
KindInternal.kind@{
logicRef := Reference.to alwaysValidLogic;
labelRef := Reference.to emptyLabel;
logicRef := BindingReference.compute alwaysValidLogic;
labelRef := BindingReference.compute emptyLabel;
};
currentKind :=
kind@{
Expand Down
4 changes: 2 additions & 2 deletions Applib/Utils/Dummy/Transaction/Initialize.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ initialize (standardInputs : StandardInputs) (dummy : Resource) : Transaction :=
let
expectedKind :=
KindInternal.kind@{
logicRef := Reference.to alwaysValidLogic;
labelRef := Reference.to emptyLabel;
logicRef := BindingReference.compute alwaysValidLogic;
labelRef := BindingReference.compute emptyLabel;
};
currentKind :=
kind@{
Expand Down
5 changes: 2 additions & 3 deletions Package.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ package : Package :=
github
"anoma"
"juvix-stdlib"
"37d3dd74b78f0ec0c48c8adc44f5b99c6d068464";
github "anoma" "juvix-test" "v0.15.0";
"8bc67b874860a26cba02d853b879e9c0a347efe2";
github
"anoma"
"juvix-arm-specs"
"33731a510a0c9e1eb077ef8140521184b89fd16d";
"846d2e5eb359c6a923b014983663cdf53b6ef9d4";
];
};
18 changes: 4 additions & 14 deletions juvix.lock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,20 @@
# Do not edit this file manually.

version: 2
checksum: 556ad20c4775707dff460c604660ea220063aec3af1562a59a6ba34e1d0bb2c0
checksum: ecc9f0488329821ab5d09810aae541d99152bbf95f9b4bd50420db37c9568d79
dependencies:
- git:
name: anoma_juvix-stdlib
ref: 37d3dd74b78f0ec0c48c8adc44f5b99c6d068464
ref: 8bc67b874860a26cba02d853b879e9c0a347efe2
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: 615a02c8107076ca9661c5234d41792be91a5104
url: https://github.com/anoma/juvix-stdlib
dependencies: []
- git:
name: anoma_juvix-arm-specs
ref: 33731a510a0c9e1eb077ef8140521184b89fd16d
ref: 846d2e5eb359c6a923b014983663cdf53b6ef9d4
url: https://github.com/anoma/juvix-arm-specs
dependencies:
- git:
name: anoma_juvix-stdlib
ref: 37d3dd74b78f0ec0c48c8adc44f5b99c6d068464
ref: 8bc67b874860a26cba02d853b879e9c0a347efe2
url: https://github.com/anoma/juvix-stdlib
dependencies: []
Loading