morley-0.6.0: Developer tools for the Michelson Language

Safe HaskellNone
LanguageHaskell2010

Michelson.Interpret

Description

Module, containing function to interpret Michelson instructions against given context and input stack.

Synopsis

Documentation

data ContractEnv Source #

Environment for contract execution.

Constructors

ContractEnv 

Fields

data MichelsonFailed where Source #

Represents `[FAILED]` state of a Michelson program. Contains value that was on top of the stack when FAILWITH was called.

data SomeItStack where Source #

Constructors

SomeItStack :: ExtInstr inp -> Rec Value inp -> SomeItStack 

newtype MorleyLogs Source #

Morley interpreter state

Constructors

MorleyLogs 

Fields

Instances
Eq MorleyLogs Source # 
Instance details

Defined in Michelson.Interpret

Show MorleyLogs Source # 
Instance details

Defined in Michelson.Interpret

Default MorleyLogs Source # 
Instance details

Defined in Michelson.Interpret

Methods

def :: MorleyLogs #

Buildable MorleyLogs Source # 
Instance details

Defined in Michelson.Interpret

Methods

build :: MorleyLogs -> Builder #

interpretInstr :: ContractEnv -> Instr inp out -> Rec Value inp -> Either MichelsonFailed (Rec Value out) Source #

Interpret an instruction in vacuum, putting no extra contraints on its execution.

Mostly for testing purposes.

interpretUntyped :: Contract -> Value -> Value -> ContractEnv -> Either InterpretError InterpretResult Source #

Interpret a contract without performing any side effects. This function uses untyped representation of contract, parameter and storage. Mostly used for testing.

data InterpretError Source #

Instances
Show InterpretError Source # 
Instance details

Defined in Michelson.Interpret

Generic InterpretError Source # 
Instance details

Defined in Michelson.Interpret

Associated Types

type Rep InterpretError :: Type -> Type #

Buildable InterpretError Source # 
Instance details

Defined in Michelson.Interpret

type Rep InterpretError Source # 
Instance details

Defined in Michelson.Interpret

data InterpretResult where Source #

Constructors

InterpretResult 

Fields

runInstr :: Instr inp out -> Rec Value inp -> EvalOp (Rec Value out) Source #

Function to change amount of remaining steps stored in State monad

runInstrNoGas :: forall a b. Instr a b -> Rec Value a -> EvalOp (Rec Value b) Source #

runUnpack :: forall t. UnpackedValScope t => ByteString -> Either UnpackError (Value t) Source #

Unpacks given raw data into a typed value.