lorentz-0.6.1: EDSL for the Michelson Language
Safe HaskellNone
LanguageHaskell2010

Lorentz.UStore.Haskell

Description

Conversion between UStore in Haskell and Michelson representation.

Synopsis

Documentation

mkUStore :: UStoreTraversable MkUStoreTW template => template -> UStore template Source #

Make UStore from separate big_maps and fields.

ustoreDecompose :: forall template. UStoreTraversable DecomposeUStoreTW template => UStore template -> Either Text (UStoreContent, template) Source #

Decompose UStore into separate big_maps 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.

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.