Safe Haskell | None |
---|---|
Language | Haskell2010 |
Conversion between UStore
in Haskell and Michelson representation.
Synopsis
- mkUStore :: UStoreTraversable MkUStoreTW template => template -> UStore template
- data MkUStoreTW
- ustoreDecompose :: forall template. UStoreTraversable DecomposeUStoreTW template => UStore template -> Either Text (UStoreContent, template)
- ustoreDecomposeFull :: forall template. UStoreTraversable DecomposeUStoreTW template => UStore template -> Either Text template
- data DecomposeUStoreTW
- fillUStore :: UStoreTraversable FillUStoreTW template => template -> UStoreMigration () template
- migrateFillUStore :: (UStoreTraversable FillUStoreTW template, allFieldsExp ~ AllUStoreFieldsF template, newDiff ~ FillingNewDiff template diff, newTouched ~ FillingNewTouched template touched, PatternMatchL newDiff, PatternMatchL newTouched) => template -> Lambda (MUStore oldTempl newTempl diff touched) (MUStore oldTempl newTempl newDiff newTouched)
- fillUStoreMigrationBlock :: (UStoreTraversable FillUStoreTW template, allFieldsExp ~ AllUStoreFieldsF template, newDiff ~ FillingNewDiff template diff, newTouched ~ FillingNewTouched template touched, PatternMatchL newDiff, PatternMatchL newTouched) => template -> MigrationBlocks oldTempl newTempl diff touched newDiff newTouched
- data FillUStoreTW
Documentation
mkUStore :: UStoreTraversable MkUStoreTW template => template -> UStore template Source #
Make UStore
from separate big_map
s and fields.
data MkUStoreTW Source #
Declares handlers for UStore creation from template.
Instances
ustoreDecompose :: forall template. UStoreTraversable DecomposeUStoreTW template => UStore template -> Either Text (UStoreContent, template) Source #
Decompose UStore
into separate big_map
s and fields.
Since this function needs to UNPACK
content of UStore
to actual
keys and values, you have to provide UnpackEnv
.
Along with resulting value, you get a list of UStore
entries which
were not recognized as belonging to any submap or field according to
UStore
's template - this should be empty unless UStore
invariants
were violated.
ustoreDecomposeFull :: forall template. UStoreTraversable DecomposeUStoreTW template => UStore template -> Either Text template Source #
Like ustoreDecompose
, but requires all entries from UStore
to be
recognized.
data DecomposeUStoreTW Source #
Declares handlers for UStore conversion to template.
Instances
fillUStore :: UStoreTraversable FillUStoreTW template => template -> UStoreMigration () template Source #
Make migration script which initializes UStore
from scratch.
migrateFillUStore :: (UStoreTraversable FillUStoreTW template, allFieldsExp ~ AllUStoreFieldsF template, newDiff ~ FillingNewDiff template diff, newTouched ~ FillingNewTouched template touched, PatternMatchL newDiff, PatternMatchL newTouched) => template -> Lambda (MUStore oldTempl newTempl diff touched) (MUStore oldTempl newTempl newDiff newTouched) Source #
Fill UStore
with entries from the given template as part of simple
migration.
Sometimes you already have some fields initialized and fillUStore
does not
suit, then in case if your UStore template is a nested structure you can use
sub-templates to initialize the corresponding parts of UStore.
For batched migrations see fillUStoreMigrationBlock
.
fillUStoreMigrationBlock :: (UStoreTraversable FillUStoreTW template, allFieldsExp ~ AllUStoreFieldsF template, newDiff ~ FillingNewDiff template diff, newTouched ~ FillingNewTouched template touched, PatternMatchL newDiff, PatternMatchL newTouched) => template -> MigrationBlocks oldTempl newTempl diff touched newDiff newTouched Source #
Version of migrateFillUStore
for batched migrations.
Each field write will be placed to a separate batch.
data FillUStoreTW Source #
Declares handlers for UStore filling via lambda.