morley-1.12.0: Developer tools for the Michelson Language
Safe HaskellNone
LanguageHaskell2010

Michelson.Runtime.GState

Description

Global blockchain state (emulated).

Synopsis

Auxiliary types

data ContractState Source #

State of a contract with code.

Constructors

forall cp st.(ParameterScope cp, StorageScope st) => ContractState 

Fields

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

Instances details
Show AddressState Source # 
Instance details

Defined in Michelson.Runtime.GState

Generic AddressState Source # 
Instance details

Defined in Michelson.Runtime.GState

Associated Types

type Rep AddressState :: Type -> Type #

ToJSON AddressState Source # 
Instance details

Defined in Michelson.Runtime.GState

FromJSON AddressState Source # 
Instance details

Defined in Michelson.Runtime.GState

Buildable AddressState Source # 
Instance details

Defined in Michelson.Runtime.GState

type Rep AddressState Source # 
Instance details

Defined in Michelson.Runtime.GState

type Rep AddressState = D1 ('MetaData "AddressState" "Michelson.Runtime.GState" "morley-1.12.0-inplace" 'False) (C1 ('MetaCons "ASSimple" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Mutez)) :+: C1 ('MetaCons "ASContract" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness '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

Instances details
Show GState Source # 
Instance details

Defined in Michelson.Runtime.GState

ToJSON GState Source # 
Instance details

Defined in Michelson.Runtime.GState

FromJSON GState Source # 
Instance details

Defined in Michelson.Runtime.GState

genesisAddresses :: NonEmpty Address Source #

Initially these addresses have a lot of money.

genesisKeyHashes :: NonEmpty KeyHash Source #

KeyHash of genesis address.

genesisAddress :: Address Source #

One of genesis addresses.

More genesisAddresses which can be used in tests

genesisAddress1 :: Address Source #

More genesis addresses

We know size of genesisAddresses, so it is safe to use !!

genesisAddress2 :: Address Source #

More genesis addresses

We know size of genesisAddresses, so it is safe to use !!

genesisAddress3 :: Address Source #

More genesis addresses

We know size of genesisAddresses, so it is safe to use !!

genesisKeyHash :: KeyHash Source #

One of genesis key hashes.

Genesis secret keys

genesisSecretKey :: SecretKey Source #

Secret key assotiated with genesisAddress.

genesisSecrets :: NonEmpty SecretKey Source #

Secrets from which genesis addresses are derived from.

initGState :: GState Source #

Initial GState. It's supposed to be used if no GState is provided. It puts plenty of money on each genesis address.

readGState :: FilePath -> IO GState Source #

Read GState from a file.

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

Write GState to a file.

Operations on GState

data GStateUpdate where Source #

Updates that can be applied to GState.

Instances

Instances details
Show GStateUpdate Source # 
Instance details

Defined in Michelson.Runtime.GState

Buildable GStateUpdate Source # 
Instance details

Defined in Michelson.Runtime.GState

extractAllContracts :: GState -> TcOriginatedContracts Source #

Retrieve all contracts stored in GState