morley-0.1.0.5: Developer tools for the Michelson Language

Safe HaskellNone
LanguageHaskell2010

Morley.Runtime.GState

Contents

Description

Global blockchain state (emulated).

Synopsis

Auxiliary types

data ContractState Source #

State of a contract with code.

Constructors

ContractState 

Fields

Instances
Eq ContractState Source # 
Instance details

Defined in Morley.Runtime.GState

Show ContractState Source # 
Instance details

Defined in Morley.Runtime.GState

Generic ContractState Source # 
Instance details

Defined in Morley.Runtime.GState

Associated Types

type Rep ContractState :: Type -> Type #

ToJSON ContractState Source # 
Instance details

Defined in Morley.Runtime.GState

FromJSON ContractState Source # 
Instance details

Defined in Morley.Runtime.GState

Buildable ContractState Source # 
Instance details

Defined in Morley.Runtime.GState

type Rep ContractState Source # 
Instance details

Defined in Morley.Runtime.GState

type Rep ContractState = D1 (MetaData "ContractState" "Morley.Runtime.GState" "morley-0.1.0.5-JGwsFje78IP81WIHW6apex" False) (C1 (MetaCons "ContractState" PrefixI True) (S1 (MetaSel (Just "csBalance") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Mutez) :*: (S1 (MetaSel (Just "csStorage") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 UntypedValue) :*: S1 (MetaSel (Just "csContract") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 UntypedContract))))

data AddressState Source #

State of an arbitrary address.

Constructors

ASSimple !Mutez

For contracts without code we store only its balance.

ASContract !ContractState

For contracts with code we store more state represented by ContractState.

Instances
Eq AddressState Source # 
Instance details

Defined in Morley.Runtime.GState

Show AddressState Source # 
Instance details

Defined in Morley.Runtime.GState

Generic AddressState Source # 
Instance details

Defined in Morley.Runtime.GState

Associated Types

type Rep AddressState :: Type -> Type #

ToJSON AddressState Source # 
Instance details

Defined in Morley.Runtime.GState

FromJSON AddressState Source # 
Instance details

Defined in Morley.Runtime.GState

Buildable AddressState Source # 
Instance details

Defined in Morley.Runtime.GState

type Rep AddressState Source # 
Instance details

Defined in Morley.Runtime.GState

type Rep AddressState = D1 (MetaData "AddressState" "Morley.Runtime.GState" "morley-0.1.0.5-JGwsFje78IP81WIHW6apex" False) (C1 (MetaCons "ASSimple" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Mutez)) :+: C1 (MetaCons "ASContract" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 ContractState)))

asBalance :: AddressState -> Mutez Source #

Extract balance from AddressState.

GState

data GState Source #

Persistent data passed to Morley contracts which can be updated as result of contract execution.

Constructors

GState 

Fields

Instances
Show GState Source # 
Instance details

Defined in Morley.Runtime.GState

ToJSON GState Source # 
Instance details

Defined in Morley.Runtime.GState

FromJSON GState Source # 
Instance details

Defined in Morley.Runtime.GState

genesisAddress :: Address Source #

Initially this address has a lot of money.

genesisAddressText :: Text Source #

Initially this address has a lot of money.

genesisKeyHash :: KeyHash Source #

KeyHash of genesis address.

initGState :: GState Source #

Initial GState. It's supposed to be used if no GState is provided. For now it's empty, but we can hardcode some dummy data in the future.

readGState :: FilePath -> IO GState Source #

Read GState from a file.

writeGState :: FilePath -> GState -> IO () Source #

Write GState to a file.

Operations on GState