Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data CompilationOptions = CompilationOptions {
- coOptimizerConf :: Maybe OptimizerConf
- coStringTransformer :: (Bool, MText -> MText)
- coBytesTransformer :: (Bool, ByteString -> ByteString)
- defaultCompilationOptions :: CompilationOptions
- intactCompilationOptions :: CompilationOptions
- coBytesTransformerL :: Lens' CompilationOptions (Bool, ByteString -> ByteString)
- coOptimizerConfL :: Lens' CompilationOptions (Maybe OptimizerConf)
- coStringTransformerL :: Lens' CompilationOptions (Bool, MText -> MText)
- compileLorentz :: (inp :-> out) -> Instr (ToTs inp) (ToTs out)
- compileLorentzWithOptions :: CompilationOptions -> (inp :-> out) -> Instr (ToTs inp) (ToTs out)
- data Contract cp st = Contract {}
- defaultContract :: forall cp st. (NiceParameterFull cp, HasCallStack) => ContractCode cp st -> Contract cp st
- compileLorentzContract :: forall cp st. (NiceParameterFull cp, NiceStorage st) => Contract cp st -> Contract (ToT cp) (ToT st)
- cCodeL :: forall cp st cp st. Lens (Contract cp st) (Contract cp st) (ContractCode cp st) (ContractCode cp st)
- cDisableInitialCastL :: forall cp st. Lens' (Contract cp st) Bool
- cCompilationOptionsL :: forall cp st. Lens' (Contract cp st) CompilationOptions
- interpretLorentzInstr :: (IsoValuesStack inp, IsoValuesStack out) => ContractEnv -> (inp :-> out) -> Rec Identity inp -> Either MichelsonFailed (Rec Identity out)
- interpretLorentzLambda :: (IsoValue inp, IsoValue out) => ContractEnv -> Lambda inp out -> inp -> Either MichelsonFailed out
- analyzeLorentz :: (inp :-> out) -> AnalyzerRes
Documentation
data CompilationOptions Source #
Options to control Lorentz to Michelson compilation.
CompilationOptions | |
|
defaultCompilationOptions :: CompilationOptions Source #
Runs Michelson optimizer with default config and does not touch strings and bytes.
intactCompilationOptions :: CompilationOptions Source #
Leave contract without any modifications. For testing purposes.
coOptimizerConfL :: Lens' CompilationOptions (Maybe OptimizerConf) Source #
coStringTransformerL :: Lens' CompilationOptions (Bool, MText -> MText) Source #
compileLorentz :: (inp :-> out) -> Instr (ToTs inp) (ToTs out) Source #
For use outside of Lorentz. Will use defaultCompilationOptions
.
compileLorentzWithOptions :: CompilationOptions -> (inp :-> out) -> Instr (ToTs inp) (ToTs out) Source #
Compile Lorentz code, optionally running the optimizer, string and byte transformers.
Code for a contract along with compilation options for the Lorentz compiler.
It is expected that a Contract
is one packaged entity, wholly controlled by its author.
Therefore the author should be able to set all options that control contract's behavior.
This helps ensure that a given contract will be interpreted in the same way in all environments, like production and testing.
Raw ContractCode
should not be used for distribution of contracts.
Contract | |
|
Instances
ContainsDoc (Contract cp st) Source # | |
Defined in Lorentz.Run buildDocUnfinalized :: Contract cp st -> ContractDoc # | |
ContainsUpdateableDoc (Contract cp st) Source # | |
Defined in Lorentz.Run modifyDocEntirely :: (SomeDocItem -> SomeDocItem) -> Contract cp st -> Contract cp st # |
defaultContract :: forall cp st. (NiceParameterFull cp, HasCallStack) => ContractCode cp st -> Contract cp st Source #
Compile contract with defaultCompilationOptions
and cDisableInitialCast
set to False
.
compileLorentzContract :: forall cp st. (NiceParameterFull cp, NiceStorage st) => Contract cp st -> Contract (ToT cp) (ToT st) Source #
Compile a whole contract to Michelson.
Note that compiled contract can be ill-typed in terms of Michelson code
when some of the compilation options are used (e.g. when ccoDisableInitialCast
is True
, resulted contract can be ill-typed).
However, compilation with defaultContractCompilationOptions
should be valid.
cCodeL :: forall cp st cp st. Lens (Contract cp st) (Contract cp st) (ContractCode cp st) (ContractCode cp st) Source #
cCompilationOptionsL :: forall cp st. Lens' (Contract cp st) CompilationOptions Source #
interpretLorentzInstr :: (IsoValuesStack inp, IsoValuesStack out) => ContractEnv -> (inp :-> out) -> Rec Identity inp -> Either MichelsonFailed (Rec Identity out) Source #
Interpret a Lorentz instruction, for test purposes. Note that this does not run the optimizer.
interpretLorentzLambda :: (IsoValue inp, IsoValue out) => ContractEnv -> Lambda inp out -> inp -> Either MichelsonFailed out Source #
Like interpretLorentzInstr
, but works on lambda rather than
arbitrary instruction.
analyzeLorentz :: (inp :-> out) -> AnalyzerRes Source #
Lorentz version of analyzer.