cleveland-0.2.1: Testing framework for Morley.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Cleveland.Lorentz.Types

Contents

Description

Basic types for the test framework.

Synopsis

Documentation

data ContractHandle (cp :: Type) (st :: Type) (vd :: Type) Source #

Handle to a contract.

This is what you get when originating a contract and that allows further operations with the contract within the test framework.

Note that this is part of the testing framework and exists solely in Haskell world, so it has no IsoValue and related instances and cannot be used in Lorentz code.

Constructors

(NiceParameter cp, NiceStorage st, NiceViewsDescriptor vd) => ContractHandle 

Instances

Instances details
(cp' ~ cp, vd ~ vd') => ToTAddress cp' vd' (ContractHandle cp st vd) Source # 
Instance details

Defined in Test.Cleveland.Lorentz.Types

Methods

toTAddress :: ContractHandle cp st vd -> TAddress cp' vd'

st ~ st' => ToStorageType st' (ContractHandle cp st vd) Source # 
Instance details

Defined in Test.Cleveland.Lorentz.Types

ToContractRef arg (TAddress cp vd) => ToContractRef arg (ContractHandle cp st vd) Source # 
Instance details

Defined in Test.Cleveland.Lorentz.Types

Methods

toContractRef :: ContractHandle cp st vd -> ContractRef arg

Show (ContractHandle cp st vd) Source # 
Instance details

Defined in Test.Cleveland.Lorentz.Types

Methods

showsPrec :: Int -> ContractHandle cp st vd -> ShowS #

show :: ContractHandle cp st vd -> String #

showList :: [ContractHandle cp st vd] -> ShowS #

ToContractAddress (ContractHandle cp st vd) Source # 
Instance details

Defined in Test.Cleveland.Lorentz.Types

ToL1Address (ContractHandle cp st vd) Source # 
Instance details

Defined in Test.Cleveland.Lorentz.Types

Methods

toL1Address :: ContractHandle cp st vd -> L1Address Source #

Buildable (ContractHandle cp st vd) Source # 
Instance details

Defined in Test.Cleveland.Lorentz.Types

Methods

build :: ContractHandle cp st vd -> Builder #

ToAddress (ContractHandle cp st vd) Source # 
Instance details

Defined in Test.Cleveland.Lorentz.Types

Methods

toAddress :: ContractHandle cp st vd -> Address #

chNiceParameterEvi :: forall param st vd. ContractHandle param st vd -> Dict (ParameterScope $ ToT st) Source #

Extract the evidence in typed Michelson that the parameter type is valid for such scope.

chNiceStorageEvi :: forall param st vd. ContractHandle param st vd -> Dict (StorageScope $ ToT st) Source #

Extract the evidence in typed Michelson that the storage type is valid for such scope.

newtype L1TAddress cp vd Source #

Counterpart of TAddress that contains L1Address instead of Address.

Constructors

L1TAddress 

Fields

Instances

Instances details
(cp ~ cp', vd ~ vd') => ToTAddress cp' vd' (L1TAddress cp vd) Source # 
Instance details

Defined in Test.Cleveland.Lorentz.Types

Methods

toTAddress :: L1TAddress cp vd -> TAddress cp' vd'

ToL1Address (L1TAddress cp vd) Source # 
Instance details

Defined in Test.Cleveland.Lorentz.Types

Methods

toL1Address :: L1TAddress cp vd -> L1Address Source #

class ToL1Address addr where Source #

Methods

toL1Address :: addr -> L1Address Source #

Instances

Instances details
ToL1Address L1Address Source # 
Instance details

Defined in Test.Cleveland.Lorentz.Types

Methods

toL1Address :: L1Address -> L1Address Source #

L1AddressKind kind => ToL1Address (KindedAddress kind) Source # 
Instance details

Defined in Test.Cleveland.Lorentz.Types

Methods

toL1Address :: KindedAddress kind -> L1Address Source #

ToL1Address (ContractHandle cp st vd) Source # 
Instance details

Defined in Test.Cleveland.Lorentz.Types

Methods

toL1Address :: ContractHandle cp st vd -> L1Address Source #

ToL1Address (L1TAddress cp vd) Source # 
Instance details

Defined in Test.Cleveland.Lorentz.Types

Methods

toL1Address :: L1TAddress cp vd -> L1Address Source #

class (ToTAddress cp vd addr, ToL1Address addr) => ToL1TAddress cp vd addr where Source #

Counterpart of ToTAddress that converts to L1TAddress rather than TAddress.

Methods

toL1TAddress :: addr -> L1TAddress cp vd Source #

Instances

Instances details
(ToTAddress cp vd addr, ToL1Address addr) => ToL1TAddress cp vd addr Source # 
Instance details

Defined in Test.Cleveland.Lorentz.Types

Methods

toL1TAddress :: addr -> L1TAddress cp vd Source #

class ToContractAddress addr => ToStorageType st addr where Source #

Declares that addr points to an entity with a storage.

addr may fix storage type or may not - in the latter case the caller has to specify the storage type explicitly via type annotation.

Methods

pickNiceStorage :: addr -> Dict (NiceStorage st) Source #

Pick proof of that storage type is valid.

Instances

Instances details
NiceStorage st => ToStorageType st ContractAddress Source # 
Instance details

Defined in Test.Cleveland.Lorentz.Types

st ~ st' => ToStorageType st' (ContractHandle cp st vd) Source # 
Instance details

Defined in Test.Cleveland.Lorentz.Types

type NiceParameter a = (ProperParameterBetterErrors (ToT a), KnownValue a) #

type NiceParameterFull cp = (Typeable cp, ParameterDeclaresEntrypoints cp) #

type NiceStorage a = (ProperStorageBetterErrors (ToT a), KnownValue a) #

type NicePackedValue a = (ProperPackedValBetterErrors (ToT a), KnownValue a) #

type NiceUnpackedValue a = (ProperUnpackedValBetterErrors (ToT a), KnownValue a) #

class ToAddress a #

Minimal complete definition

toAddress

Instances

Instances details
ToAddress EpAddress 
Instance details

Defined in Lorentz.Address

Methods

toAddress :: EpAddress -> Address #

ToAddress Address 
Instance details

Defined in Lorentz.Address

Methods

toAddress :: Address -> Address #

ToAddress L1Address 
Instance details

Defined in Lorentz.Address

Methods

toAddress :: L1Address -> Address #

ToAddress (FutureContract cp) 
Instance details

Defined in Lorentz.Address

Methods

toAddress :: FutureContract cp -> Address #

ToAddress (ContractRef cp) 
Instance details

Defined in Lorentz.Address

Methods

toAddress :: ContractRef cp -> Address #

ToAddress (KindedAddress kind) 
Instance details

Defined in Lorentz.Address

Methods

toAddress :: KindedAddress kind -> Address #

ToAddress (TAddress cp vd) 
Instance details

Defined in Lorentz.Address

Methods

toAddress :: TAddress cp vd -> Address #

ToAddress (ContractHandle cp st vd) Source # 
Instance details

Defined in Test.Cleveland.Lorentz.Types

Methods

toAddress :: ContractHandle cp st vd -> Address #

toAddress :: ToAddress a => a -> Address #

Notes

A note on TAddress instance for ToStorageType

TAddress isn't intended to be a part of the Cleveland API. In the absolute majority of cases, if one is interested in both parameter and storage, then they should use ContractHandle, as the storage type needs to be known either way. If one isn't interested in storage, they presumably wouldn't call functions to get storage. Hence, this instance wouldn't be particularly useful. Legacy code using TAddress instead of ContractHandle should be preferably updated, if possible. If nothing else, toAddress can be used as a stopgap measure.