Skip to content

Commit

Permalink
revert: change map key and values back to Nat
Browse files Browse the repository at this point in the history
  • Loading branch information
heueristik committed Nov 8, 2024
1 parent 1442827 commit b68b5c7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
6 changes: 4 additions & 2 deletions Anoma/Transaction/AppData.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ type DeletionCriterion :=
| StoreForever MISSING_DEFINITION;

--- A data type encoding the lookup key of application.
type AppDataKey := mkAppDataKey@{unAppDataKey : ByteArray};
--- TODO Add an equivalent to `anomaEncode` and `anomaDecode` to be able to change this to ;ByteArray;.
type AppDataKey := mkAppDataKey@{unAppDataKey : Nat};

--- A data type encoding the lookup value of application data.
--- TODO Add an equivalent to `anomaEncode` and `anomaDecode` to be able to change this to ;ByteArray;.
type AppDataValue :=
mkAppDataValue@{unAppDataValue : Pair ByteArray DeletionCriterion};
mkAppDataValue@{unAppDataValue : Pair Nat DeletionCriterion};

--- A type describing an app data map.
AppData : Type := Map AppDataKey AppDataValue;
Expand Down
10 changes: 6 additions & 4 deletions Anoma/Transaction/CustomInputs.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ import Stdlib.Data.Map as Map open using {Map};
import Anoma.Builtin.ByteArray open using {ByteArray};
import Anoma.Utils open;

--- A data type encoding the lookup key of application.
type CustomInputsKey := mkCustomInputsKey@{unCustomInputsKey : ByteArray};
--- A data type encoding the lookup key of custom inputs .
--- TODO Add an equivalent to `anomaEncode` and `anomaDecode` to be able to change this to ;ByteArray;.
type CustomInputsKey := mkCustomInputsKey@{unCustomInputsKey : Nat};

--- A data type encoding the lookup value of application data.
type CustomInputsValue := mkCustomInputsValue@{unCustomInputsValue : ByteArray};
--- A data type encoding the lookup value of custom inputs.
--- TODO Add an equivalent to `anomaEncode` and `anomaDecode` to be able to change this to ;ByteArray;.
type CustomInputsValue := mkCustomInputsValue@{unCustomInputsValue : Nat};

--- A type describing an app data map.
CustomInputs : Type := Map CustomInputsKey CustomInputsValue;
Expand Down

0 comments on commit b68b5c7

Please sign in to comment.