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

Test.Cleveland.Internal.Abstract

Description

Abstract cleveland interface not bound to a particular implementation.

The interface may look a bit untyped and unsafe in some places. For example, in order to call a contract one should supply a simple address rather than a contract ref, so it is easy to pass a value of wrong type. Also it is easy to call a non-existing entrypoint.

Subjectively, it makes writing test scenarios easier because you have to prove less to the compiler. It also makes implementation of cleveland engine a bit easier. Of course, it also makes it easier to make certain mistakes. However, we expect users of this interface to also use the functionality of the Test.Cleveland.Internal.Pure module and convert cleveland scenarios to purely testable scenarios for integrational testing engine. In this case errors should be detected almost as quickly as they would reported by the compiler, at least before trying to run scenario on a live network.

Also this interface uses Address rather than EpAddress. I (@gromak) concluded that EpAddress can not be passed to octez-client. For key addresses it just does not make sense and for contract addresses I get such errors:

  bad contract notation
  Invalid contract notation "KT1VrFpBPwBTm3hsK7DB7SPmY8fTHJ3vY6sJ%mint"
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 #

data OriginateData param st vd (large :: LargeOrigination) Source #

Constructors

OriginateData 

Fields

Instances

Instances details
ModifyOriginationData (OriginateData cp st vd) Source # 
Instance details

Defined in Test.Cleveland.Internal.Actions.Originate

Methods

setBalance :: forall (large :: LargeOrigination). Mutez -> OriginateData cp st vd large -> OriginateData cp st vd large Source #

setDelegate :: forall (large :: LargeOrigination). KeyHash -> OriginateData cp st vd large -> OriginateData cp st vd large Source #

setLarge :: OriginateData cp st vd 'NotLarge -> OriginateData cp st vd 'IsLarge Source #

(a ~ ContractHandle cp st vd, MonadOpsInternal m, Originator (UntypedOriginateData large) (m ContractAddress)) => Originator (OriginateData cp st vd large) (m a) Source # 
Instance details

Defined in Test.Cleveland.Internal.Actions.Originate

Methods

originateFn :: OriginateData cp st vd large -> m a Source #

data TransferData Source #

Information about transfer operation.

Constructors

forall v addr.(NiceParameter v, ToL1Address addr) => TransferData 

Fields

  • tdTo :: addr

    Receiver address for this transaction.

  • tdAmount :: Mutez

    Amount to be transferred.

  • tdEntrypoint :: EpName

    An entrypoint to be called. Consider using ep in testing scenarios.

  • tdParameter :: v

    Parameter that will be used for a contract call. Set to () for transfers to key addresses.

newtype Sender Source #

Designates the special sender address.

Transfers and some other operations will occur on behalf of this address. This is initialized to moneybag address and then can be locally modified.

Operations in ClevelandOpsImpl are affected by this address.

Constructors

Sender 

newtype Moneybag Source #

Designates the address that gifts money to new addresses.

Once a new address is allocated in a test scenario, we have to transfer some money to it so that it is able to serve as transactions sender. Moneybag serves as a source of that money.

We do not use Sender for this purpose because in most situations changing moneybag is not necessary. If a user wraps a large piece of their script with withSender call and that changes the moneybag - this behaviour may be undesired and unexpected to the user.

Constructors

Moneybag 

data UntypedOriginateData (large :: LargeOrigination) Source #

Untyped version of OriginateData. It can be used for interaction with raw Michelson contracts

Constructors

UntypedOriginateData 

Fields

data TypedOriginateData cp st vd (large :: LargeOrigination) Source #

Untyped version of OriginateData. It can be used for interaction with raw Michelson contracts

Constructors

TypedOriginateData 

Fields

Instances

Instances details
ModifyOriginationData (TypedOriginateData cp st vd) Source # 
Instance details

Defined in Test.Cleveland.Internal.Actions.Originate

Methods

setBalance :: forall (large :: LargeOrigination). Mutez -> TypedOriginateData cp st vd large -> TypedOriginateData cp st vd large Source #

setDelegate :: forall (large :: LargeOrigination). KeyHash -> TypedOriginateData cp st vd large -> TypedOriginateData cp st vd large Source #

setLarge :: TypedOriginateData cp st vd 'NotLarge -> TypedOriginateData cp st vd 'IsLarge Source #

(a ~ ContractHandle cp st vd, MonadOpsInternal m, Originator (UntypedOriginateData large) (m ContractAddress), NiceStorage st, NiceViewsDescriptor vd, NiceParameter cp) => Originator (TypedOriginateData cp st vd large) (m a) Source # 
Instance details

Defined in Test.Cleveland.Internal.Actions.Originate

Methods

originateFn :: TypedOriginateData cp st vd large -> m a Source #

data LargeOrigination Source #

Whether this contract should be originated in a single origination operation or, if it goes over the origination size limit, in multiple operations.

Constructors

IsLarge 
NotLarge 

data TypedContract cp st vd where Source #

A wrapper around Contract to reduce awkwardness

Constructors

TypedContract :: Contract (ToT cp) (ToT st) -> TypedContract cp st vd 

data RunCode cp st vd Source #

The data needed to call the /run_code RPC endpoint.

Constructors

RunCode 

Fields

  • rcContract :: Contract cp st vd
     
  • rcParameter :: Value

    The parameter value should have the same "structure" as cp, except it _may_ also have big_map IDs. E.g. if the contract's parameter is pair (big_map string string) (big_map string string), then rcParameter may be one of:

    • pair (big_map string string) (big_map string string)
    • pair nat (big_map string string)
    • pair (big_map string string) nat
    • pair nat nat

    ... where nat represents a big_map ID.

  • rcStorage :: Value

    The storage value should have the same "structure" as st, except it _may_ also have big_map IDs. See the documentation of rcParameter.

  • rcAmount :: Mutez

    The value that will be returned by the AMOUNT instruction.

  • rcLevel :: Maybe Natural

    The value that will be returned by the LEVEL instruction.

  • rcNow :: Maybe Timestamp

    The value that will be returned by the NOW instruction.

  • rcBalance :: Mutez

    The balance that will be returned by the BALANCE instruction.

  • rcSource :: Maybe ImplicitAddress

    The value that will be returned by the SOURCE instruction.

data ClevelandInput Source #

Designates an operation input.

Instances

Instances details
OperationInfoDescriptor ClevelandInput Source # 
Instance details

Defined in Test.Cleveland.Internal.Abstract

Associated Types

type TransferInfo ClevelandInput

type OriginationInfo ClevelandInput

type RevealInfo ClevelandInput

type DelegationInfo ClevelandInput

type DelegationInfo ClevelandInput Source # 
Instance details

Defined in Test.Cleveland.Internal.Abstract

type DelegationInfo ClevelandInput = Maybe KeyHash
type OriginationInfo ClevelandInput Source # 
Instance details

Defined in Test.Cleveland.Internal.Abstract

type RevealInfo ClevelandInput Source # 
Instance details

Defined in Test.Cleveland.Internal.Abstract

type RevealInfo ClevelandInput = PublicKey
type TransferInfo ClevelandInput Source # 
Instance details

Defined in Test.Cleveland.Internal.Abstract

type TransferInfo ClevelandInput = TransferData

data ClevelandResult Source #

Designates an operation result.

Instances

Instances details
OperationInfoDescriptor ClevelandResult Source # 
Instance details

Defined in Test.Cleveland.Internal.Abstract

Associated Types

type TransferInfo ClevelandResult

type OriginationInfo ClevelandResult

type RevealInfo ClevelandResult

type DelegationInfo ClevelandResult

type DelegationInfo ClevelandResult Source # 
Instance details

Defined in Test.Cleveland.Internal.Abstract

type DelegationInfo ClevelandResult = DelegationInfo Result
type OriginationInfo ClevelandResult Source # 
Instance details

Defined in Test.Cleveland.Internal.Abstract

type OriginationInfo ClevelandResult = OriginationInfo Result
type RevealInfo ClevelandResult Source # 
Instance details

Defined in Test.Cleveland.Internal.Abstract

type RevealInfo ClevelandResult = RevealInfo Result
type TransferInfo ClevelandResult Source # 
Instance details

Defined in Test.Cleveland.Internal.Abstract

type TransferInfo ClevelandResult = [ContractEvent]

data ContractEvent Source #

Data structure representing a contract event.

Constructors

ContractEvent 

Fields

newtype DefaultAliasCounter Source #

Counter which is used to provide different default aliases.

data SpecificOrDefaultAlias Source #

An alias with default value that can be used to define unique alias automatically.

Actions

data ClevelandOpsImpl m Source #

A record data type with operations creating primitives.

Constructors

ClevelandOpsImpl 

Fields

data ClevelandMiscImpl m Source #

A record data type with all base methods one can use during a cleveland test.

Constructors

ClevelandMiscImpl 

Fields

data EmulatedImpl m Source #

A record data type with all base methods one can use during cleveland, but which are available only when running on an emulated environment (e.g. Morley.Michelson.Runtime) and not on a real network.

Constructors

EmulatedImpl 

Fields

  • eiBranchout :: [(Text, m ())] -> m ()

    Execute multiple testing scenarios independently.

    • Actions performed before eiBranchout will be observed by all branches.
    • Actions performed in branches will _not_ be observed by any actions performed after eiBranchout.
    • Actions performed in one branch will _not_ be observed by another branch.
    • The test succeeds IFF all branches succeed.
    • If any branch fails, the test ends immediately and the remaining branches won't be executed.

    The following property holds:

    pre >> branchout [a, b, c] = branchout [pre >> a, pre >> b, pre >> c]

    The list of branches must be non-empty.

  • eiGetStorage :: forall st addr. (HasCallStack, ToStorageType st addr) => addr -> m st

    Retrieve a contract's full storage, including the contents of its big_maps. This function can only be used in emulator-only tests.

  • eiGetMorleyLogs :: forall a. m a -> m (LogsInfo, a)

    Returns the result of the action with the logs it produced

  • eiSetVotingPowers :: VotingPowers -> m ()

    Change voting power distribution.

mapClevelandOpsImplExceptions :: (forall a. HasCallStack => m a -> m a) -> ClevelandOpsImpl m -> ClevelandOpsImpl m Source #

Runs a handler over every action.

mapClevelandMiscImplExceptions :: (forall a. HasCallStack => m a -> m a) -> ClevelandMiscImpl m -> ClevelandMiscImpl m Source #

Runs a handler over every action (except cmiAttempt and cmiThrow), possibly transforming exceptions thrown by those actions.

Batching

data BatchResultMismatch Source #

A batch returned invalid output, e.g. origination address when transaction was supplied.

Constructors

BatchResultMismatch Text

Carries expected operation type in lowercase

Instances

Instances details
Buildable BatchResultMismatch Source # 
Instance details

Defined in Test.Cleveland.Internal.Abstract

data ClevelandOpsBatch a Source #

Where the batched operations occur.

Note that this is not a Monad, rather an Applicative - use -XApplicativeDo extension for nicer experience.

Instances

Instances details
Applicative ClevelandOpsBatch Source # 
Instance details

Defined in Test.Cleveland.Internal.Abstract

Functor ClevelandOpsBatch Source # 
Instance details

Defined in Test.Cleveland.Internal.Abstract

(Bottom, TypeError (((('Text "Attempt to use monad capabilities within a batch" :$$: 'Text "In case you are using a do-block, make sure that") :$$: 'Text "\8226 `ApplicativeDo` extension is enabled") :$$: 'Text "\8226 there is a return statement in the end") :$$: 'Text "\8226 returned value picks variables in the order in which they are defined") :: Constraint) => Monad ClevelandOpsBatch Source # 
Instance details

Defined in Test.Cleveland.Internal.Abstract

MonadOpsInternal ClevelandOpsBatch Source # 
Instance details

Defined in Test.Cleveland.Internal.Actions.MonadOps

(SingI emit, DoTransfer mode, a ~ FTransferResult emit) => TransferFunc mode emit am (ClevelandOpsBatch a) Source #

The terminating case for batched transfer

Instance details

Defined in Test.Cleveland.Internal.Actions.Transfer

Originator (ContractOriginateData ct (GetLarge props)) (ClevelandOpsBatch a) => OriginateFunc ct props (ClevelandOpsBatch a) Source #

The terminating case for batched transfer.

Instance details

Defined in Test.Cleveland.Internal.Actions.Originate

runBatched :: (HasCallStack, Functor m) => ClevelandOpsImpl m -> ClevelandOpsBatch a -> m a Source #

Run a series of operations within a batch.

Example:

contract <- runBatched impl $ do
  -- this block is executed within ClevelandOpsBatch
  contract <- runSingleOperation batchedOpsImpl "origination" ...
  for_ [1..3] i ->
    runSingleOperation batchedOpsImpl "transfer" ...
  return contract

See ClevelandOpsBatch for some precautions.

batchedOpsImpl :: ClevelandOpsImpl ClevelandOpsBatch Source #

ClevelandOpsImpl suitable for methods executed within a batch.

runOperationBatchM :: (HasCallStack, Buildable e, Functor m) => Proxy e -> ClevelandOpsImpl m -> BatchingM (OperationInfo ClevelandInput) (OperationInfo ClevelandResult) e a -> m a Source #

Version of coiRunOperationBatch that uses BatchingM.

This is an internal function.

Invariant: all errors described by e must be internal and should not occur in practice (we require e type to be specified explicitly to hinder incorrect usage).

runSingleOperation :: (HasCallStack, Functor m) => ClevelandOpsImpl m -> Text -> OperationInfo ClevelandInput -> (OperationInfo ClevelandResult -> Maybe a) -> m a Source #

Helper that runs a single operation using ClevelandOpsImpl.

Validation

data TransferFailureReason Source #

Constructors

FailedWith ExpressionOrTypedValue (Maybe ErrorSrcPos)

Expect that interpretation of contract with the given address ended with FAILWITH.

EmptyTransaction

Expect failure due to an attempt to transfer 0tz towards a simple address.

BadParameter

Expect failure due to an attempt to call a contract with an invalid parameter.

MutezArithError MutezArithErrorType

Expect failure due to an arithmetic over-/underflow

ShiftOverflow

Expect that interpretation of contract with the given address ended with an overflow error.

GasExhaustion 

data ExpressionOrTypedValue where Source #

Representation of Expression we got from the RPC or a typed value we got from the emulator.

Constructors

EOTVExpression :: Expression -> ExpressionOrTypedValue 
EOTVTypedValue :: (SingI t, ConstantScope t) => Value t -> ExpressionOrTypedValue 

Helpers

auto :: SpecificOrDefaultAlias Source #

Helper to use automatically determined unique alias.

ep :: EntrypointNameConstructor epName a => a Source #

A short partial constructor for EpName or EntrypointRef. It accepts a type-level string as its type argument. The programmer is responsible for validity. And this code is for tests anyway, so each failure is a programmer mistake.

Note that entrypoint names should be capitalized, e.g.

ep @"Entrypoint"

corresponds to entrypoint, etc.

It is intentionally here and not in some deeper module because the name is really short and more suitable for writing scenarios.

For EpName, an instance is provided accepting a value-level Text instead of a type-level symbol. This is mostly for cases where the type-level symbol doesn't work. Note that value-level string will be used verbatim, hence capitalization is arbitrary.

ep "entrypoint"

Morley client re-exports

data Alias (kind :: AddressKind) #

Instances

Instances details
IsString ContractAlias Source # 
Instance details

Defined in Test.Cleveland.Instances

IsString ImplicitAlias Source # 
Instance details

Defined in Test.Cleveland.Instances

GCompare Alias 
Instance details

Defined in Morley.Tezos.Address.Alias

Methods

gcompare :: forall (a :: k) (b :: k). Alias a -> Alias b -> GOrdering a b #

GEq Alias 
Instance details

Defined in Morley.Tezos.Address.Alias

Methods

geq :: forall (a :: k) (b :: k). Alias a -> Alias b -> Maybe (a :~: b) #

ArgDict (c :: AddressKind -> Constraint) Alias 
Instance details

Defined in Morley.Tezos.Address.Alias

Associated Types

type ConstraintsFor Alias c #

Methods

argDict :: forall (a :: k). ConstraintsFor Alias c => Alias a -> Dict (c a) #

(SingI kind, L1AddressKind kind) => FromJSON (Alias kind) 
Instance details

Defined in Morley.Tezos.Address.Alias

Methods

parseJSON :: Value -> Parser (Alias kind) #

parseJSONList :: Value -> Parser [Alias kind] #

ToJSON (Alias kind) 
Instance details

Defined in Morley.Tezos.Address.Alias

Methods

toJSON :: Alias kind -> Value #

toEncoding :: Alias kind -> Encoding #

toJSONList :: [Alias kind] -> Value #

toEncodingList :: [Alias kind] -> Encoding #

Show (Alias kind) 
Instance details

Defined in Morley.Tezos.Address.Alias

Methods

showsPrec :: Int -> Alias kind -> ShowS #

show :: Alias kind -> String #

showList :: [Alias kind] -> ShowS #

NFData (Alias kind) 
Instance details

Defined in Morley.Tezos.Address.Alias

Methods

rnf :: Alias kind -> () #

Buildable (Alias kind) 
Instance details

Defined in Morley.Tezos.Address.Alias

Methods

build :: Alias kind -> Builder #

Eq (Alias kind) 
Instance details

Defined in Morley.Tezos.Address.Alias

Methods

(==) :: Alias kind -> Alias kind -> Bool #

(/=) :: Alias kind -> Alias kind -> Bool #

Ord (Alias kind) 
Instance details

Defined in Morley.Tezos.Address.Alias

Methods

compare :: Alias kind -> Alias kind -> Ordering #

(<) :: Alias kind -> Alias kind -> Bool #

(<=) :: Alias kind -> Alias kind -> Bool #

(>) :: Alias kind -> Alias kind -> Bool #

(>=) :: Alias kind -> Alias kind -> Bool #

max :: Alias kind -> Alias kind -> Alias kind #

min :: Alias kind -> Alias kind -> Alias kind #

CmdArg (Alias kind) 
Instance details

Defined in Morley.Client.TezosClient.Types

Methods

toCmdArg :: Alias kind -> String

type ConstraintsFor Alias (c :: AddressKind -> Constraint) 
Instance details

Defined in Morley.Tezos.Address.Alias

type ConstraintsFor Alias (c :: AddressKind -> Constraint) = (c 'AddressKindImplicit, c 'AddressKindContract)

type ImplicitAlias = Alias 'AddressKindImplicit #

type ContractAlias = Alias 'AddressKindContract #

data KindedAddress (kind :: AddressKind) #

Instances

Instances details
FromJSON Address 
Instance details

Defined in Morley.Tezos.Address

Methods

parseJSON :: Value -> Parser Address #

parseJSONList :: Value -> Parser [Address] #

FromJSONKey Address 
Instance details

Defined in Morley.Tezos.Address

ToContractAddress ContractAddress Source # 
Instance details

Defined in Test.Cleveland.Lorentz.Types

ToL1Address L1Address Source # 
Instance details

Defined in Test.Cleveland.Lorentz.Types

Methods

toL1Address :: L1Address -> L1Address Source #

ToAddress Address 
Instance details

Defined in Lorentz.Address

Methods

toAddress :: Address -> Address #

ToAddress L1Address 
Instance details

Defined in Lorentz.Address

Methods

toAddress :: L1Address -> Address #

HasAnnotation Address 
Instance details

Defined in Lorentz.Annotation

Methods

getAnnotation :: FollowEntrypointFlag -> Notes (ToT Address)

annOptions :: AnnOptions

HasRPCRepr Address 
Instance details

Defined in Morley.AsRPC

Associated Types

type AsRPC Address #

TypeHasDoc Address 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

Associated Types

type TypeDocFieldDescriptions Address :: FieldDescriptions

Methods

typeDocName :: Proxy Address -> Text

typeDocMdDescription :: Markdown

typeDocMdReference :: Proxy Address -> WithinParens -> Markdown

typeDocDependencies :: Proxy Address -> [SomeDocDefinitionItem]

typeDocHaskellRep :: TypeDocHaskellRep Address

typeDocMichelsonRep :: TypeDocMichelsonRep Address

IsoValue Address 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type ToT Address :: T

Methods

toVal :: Address -> Value (ToT Address)

fromVal :: Value (ToT Address) -> Address

CmdArg Address 
Instance details

Defined in Morley.Client.TezosClient.Types

Methods

toCmdArg :: Address -> String

NiceStorage st => ToStorageType st ContractAddress Source # 
Instance details

Defined in Test.Cleveland.Lorentz.Types

FromContractRef cp Address 
Instance details

Defined in Lorentz.Address

Methods

fromContractRef :: ContractRef cp -> Address

GCompare KindedAddress 
Instance details

Defined in Morley.Tezos.Address

Methods

gcompare :: forall (a :: k) (b :: k). KindedAddress a -> KindedAddress b -> GOrdering a b #

GEq KindedAddress 
Instance details

Defined in Morley.Tezos.Address

Methods

geq :: forall (a :: k) (b :: k). KindedAddress a -> KindedAddress b -> Maybe (a :~: b) #

ArgDict (c :: AddressKind -> Constraint) KindedAddress 
Instance details

Defined in Morley.Tezos.Address

Associated Types

type ConstraintsFor KindedAddress c #

Methods

argDict :: forall (a :: k). ConstraintsFor KindedAddress c => KindedAddress a -> Dict (c a) #

ToTAddress cp vd Address 
Instance details

Defined in Lorentz.Address

Methods

toTAddress :: Address -> TAddress cp vd

ToTAddress cp vd ContractAddress 
Instance details

Defined in Lorentz.Address

Methods

toTAddress :: ContractAddress -> TAddress cp vd

(cp ~ (), vd ~ ()) => ToTAddress cp vd ImplicitAddress 
Instance details

Defined in Lorentz.Address

Methods

toTAddress :: ImplicitAddress -> TAddress cp vd

ToTAddress cp vd L1Address 
Instance details

Defined in Lorentz.Address

Methods

toTAddress :: L1Address -> TAddress cp vd

Lift (KindedAddress kind :: Type) 
Instance details

Defined in Morley.Tezos.Address

Methods

lift :: Quote m => KindedAddress kind -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => KindedAddress kind -> Code m (KindedAddress kind) #

CanCastTo Address (TAddress p vd :: Type) 
Instance details

Defined in Lorentz.Coercions

Methods

castDummy :: Proxy Address -> Proxy (TAddress p vd) -> ()

SingI kinds => FromJSON (ConstrainedAddress kinds) 
Instance details

Defined in Morley.Tezos.Address

Methods

parseJSON :: Value -> Parser (ConstrainedAddress kinds) #

parseJSONList :: Value -> Parser [ConstrainedAddress kinds] #

SingI kind => FromJSON (KindedAddress kind) 
Instance details

Defined in Morley.Tezos.Address

SingI kind => FromJSONKey (KindedAddress kind) 
Instance details

Defined in Morley.Tezos.Address

ToJSON (KindedAddress kind) 
Instance details

Defined in Morley.Tezos.Address

ToJSONKey (KindedAddress kind) 
Instance details

Defined in Morley.Tezos.Address

(Bottom, TypeError ('Text "There is no instance defined for (IsString Address)" :$$: 'Text "Consider using QuasiQuotes: `[ta|some text...|]`") :: Constraint) => IsString (KindedAddress kind) 
Instance details

Defined in Morley.Tezos.Address

Methods

fromString :: String -> KindedAddress kind #

Show (KindedAddress kind) 
Instance details

Defined in Morley.Tezos.Address

Methods

showsPrec :: Int -> KindedAddress kind -> ShowS #

show :: KindedAddress kind -> String #

showList :: [KindedAddress kind] -> ShowS #

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

Defined in Test.Cleveland.Lorentz.Types

Methods

toL1Address :: KindedAddress kind -> L1Address Source #

NFData (KindedAddress kind) 
Instance details

Defined in Morley.Tezos.Address

Methods

rnf :: KindedAddress kind -> () #

Buildable (KindedAddress kind) 
Instance details

Defined in Morley.Tezos.Address

Methods

build :: KindedAddress kind -> Builder #

Eq (KindedAddress kind) 
Instance details

Defined in Morley.Tezos.Address

Methods

(==) :: KindedAddress kind -> KindedAddress kind -> Bool #

(/=) :: KindedAddress kind -> KindedAddress kind -> Bool #

Ord (KindedAddress kind) 
Instance details

Defined in Morley.Tezos.Address

Methods

compare :: KindedAddress kind -> KindedAddress kind -> Ordering #

(<) :: KindedAddress kind -> KindedAddress kind -> Bool #

(<=) :: KindedAddress kind -> KindedAddress kind -> Bool #

(>) :: KindedAddress kind -> KindedAddress kind -> Bool #

(>=) :: KindedAddress kind -> KindedAddress kind -> Bool #

max :: KindedAddress kind -> KindedAddress kind -> KindedAddress kind #

min :: KindedAddress kind -> KindedAddress kind -> KindedAddress kind #

ToAddress (KindedAddress kind) 
Instance details

Defined in Lorentz.Address

Methods

toAddress :: KindedAddress kind -> Address #

SingI kind => HasCLReader (KindedAddress kind) 
Instance details

Defined in Morley.Tezos.Address

CmdArg (KindedAddress kind) 
Instance details

Defined in Morley.Client.TezosClient.Types

Methods

toCmdArg :: KindedAddress kind -> String

CanCastTo (TAddress p vd :: Type) Address 
Instance details

Defined in Lorentz.Coercions

Methods

castDummy :: Proxy (TAddress p vd) -> Proxy Address -> ()

ToJSON (Constrained c KindedAddress) 
Instance details

Defined in Morley.Tezos.Address

Methods

toJSON :: Constrained c KindedAddress -> Value #

toEncoding :: Constrained c KindedAddress -> Encoding #

toJSONList :: [Constrained c KindedAddress] -> Value #

toEncodingList :: [Constrained c KindedAddress] -> Encoding #

ToJSONKey (Constrained c KindedAddress) 
Instance details

Defined in Morley.Tezos.Address

type AsRPC Address 
Instance details

Defined in Morley.AsRPC

type AsRPC Address = Address
type TypeDocFieldDescriptions Address 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

type TypeDocFieldDescriptions Address = '[] :: [(Symbol, (Maybe Symbol, [(Symbol, Symbol)]))]
type ToT Address 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

type ToT Address = 'TAddress
type ConstraintsFor KindedAddress (c :: AddressKind -> Constraint) 
Instance details

Defined in Morley.Tezos.Address

type ConstraintsFor KindedAddress (c :: AddressKind -> Constraint) = (c 'AddressKindImplicit, c 'AddressKindContract, c 'AddressKindTxRollup)

type ContractAddress = KindedAddress 'AddressKindContract #

type ImplicitAddress = KindedAddress 'AddressKindImplicit #

Capability records

data ClevelandCaps m Source #

A record with all the capabilities available to any cleveland test.

data EmulatedCaps m Source #

A record with all the capabilities available to a cleveland test on the emulator.

data NetworkCaps m Source #

A record with all the capabilities available to a cleveland test on the network.

class Monad (ClevelandBaseMonad caps) => HasClevelandCaps caps where Source #

A proof that the given caps record contains the basic cleveland capabilities.

Associated Types

type ClevelandBaseMonad caps :: Type -> Type Source #

This will be either PureM or ClientM.

class HasClevelandCaps caps => HasEmulatedCaps caps where Source #

A proof that the given caps record contains the basic cleveland capabilities + the emulator capabilities.

class HasClevelandCaps caps => HasNetworkCaps caps where Source #

A proof that the given caps record contains the basic cleveland capabilities + the network capabilities.

Instances

Instances details
Monad m => HasNetworkCaps (NetworkCaps m) Source # 
Instance details

Defined in Test.Cleveland.Internal.Abstract

type MonadCleveland caps m = (m ~ ReaderT caps (ClevelandBaseMonad caps), HasClevelandCaps caps) Source #

Constraint for a monad in which we can do cleveland actions.

type MonadEmulated caps m = (MonadCleveland caps m, HasEmulatedCaps caps) Source #

Constraint for a monad in which we can do cleveland actions that can't be run on a real network. It requires the EmulatedCaps capability.

type MonadNetwork caps m = (MonadCleveland caps m, HasNetworkCaps caps) Source #

Constraint for a monad in which we can do cleveland actions that can only be run on a real network. It requires the NetworkCaps capability.

type ClevelandT m = ReaderT (ClevelandCaps m) m Source #

Monad transformer that adds only the ClevelandCaps capabilities.

type EmulatedT m = ReaderT (EmulatedCaps m) m Source #

Monad transformer that adds both ClevelandCaps and EmulatedCaps capabilities.

type NetworkT m = ReaderT (NetworkCaps m) m Source #

Monad transformer that adds both ClevelandCaps and NetworkCaps capabilities.

Log utilities

data ScenarioLogs Source #

Constructors

ScenarioLogs 

Fields

Instances

Instances details
Show ScenarioLogs Source # 
Instance details

Defined in Test.Cleveland.Internal.Abstract

Eq ScenarioLogs Source # 
Instance details

Defined in Test.Cleveland.Internal.Abstract

MonadWriter LogsInfo PureM Source # 
Instance details

Defined in Test.Cleveland.Internal.Pure

Methods

writer :: (a, LogsInfo) -> PureM a #

tell :: LogsInfo -> PureM () #

listen :: PureM a -> PureM (a, LogsInfo) #

pass :: PureM (a, LogsInfo -> LogsInfo) -> PureM a #

logsL :: Lens' ScenarioLogs MorleyLogs Source #

An alias for slLog with a clearer name

filterLogsByAddrL :: (ToAddress addr, Applicative f) => addr -> (MorleyLogs -> f MorleyLogs) -> ScenarioLogs -> f ScenarioLogs Source #

Lens combinator specified for filtering logs by address from LogsInfo

logsForAddress :: (Each s s ScenarioLogs ScenarioLogs, ToAddress addr) => addr -> s -> [MorleyLogs] Source #

Get logs for a given address from LogsInfo

collectLogs :: LogsInfo -> MorleyLogs Source #

Collect logs produced by all contracts into the single list

Network environment