Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Test.Cleveland.Lorentz.Types
Contents
Description
Basic types for the test framework.
Synopsis
- data ContractHandle (cp :: Type) (st :: Type) (vd :: Type) = (NiceParameter cp, NiceStorage st, NiceViewsDescriptor vd) => ContractHandle {}
- newtype L1TAddress cp vd = L1TAddress {
- unL1TAddress :: L1Address
- class ToContractAddress addr where
- toContractAddress :: addr -> ContractAddress
- class ToImplicitAddress addr where
- toImplicitAddress :: addr -> ImplicitAddress
- class ToL1Address addr where
- toL1Address :: addr -> L1Address
- class (ToTAddress cp vd addr, ToL1Address addr) => ToL1TAddress cp vd addr where
- toL1TAddress :: addr -> L1TAddress cp vd
- class ToContractAddress addr => ToStorageType st addr where
- pickNiceStorage :: addr -> Dict (NiceStorage st)
- class (ParameterScopeC (NiceParameter a) (ToT a), KnownValue a) => NiceParameter a
- type NiceParameterFull cp = (Typeable cp, ParameterDeclaresEntrypoints cp)
- class (StorageScopeC (NiceStorage a) (ToT a), KnownValue a) => NiceStorage a
- class (PackedValScopeC (NicePackedValue a) (ToT a), KnownValue a) => NicePackedValue a
- class (UnpackedValScopeC (NiceUnpackedValue a) (ToT a), KnownValue a) => NiceUnpackedValue a
- class ToAddress a
- toAddress :: ToAddress a => a -> Address
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 | |
Fields |
Instances
newtype L1TAddress cp vd Source #
Counterpart of TAddress
that contains L1Address
instead of Address
.
Constructors
L1TAddress | |
Fields
|
Instances
(cp ~ cp', vd ~ vd') => ToTAddress cp' vd' (L1TAddress cp vd) Source # | |
Defined in Test.Cleveland.Lorentz.Types Methods toTAddress :: L1TAddress cp vd -> TAddress cp' vd' | |
ToL1Address (L1TAddress cp vd) Source # | |
Defined in Test.Cleveland.Lorentz.Types Methods toL1Address :: L1TAddress cp vd -> L1Address Source # |
class ToContractAddress addr where Source #
Methods
toContractAddress :: addr -> ContractAddress Source #
Instances
ToContractAddress ContractAddress Source # | |
Defined in Test.Cleveland.Lorentz.Types Methods toContractAddress :: ContractAddress -> ContractAddress Source # | |
ToContractAddress ContractAddressWithAlias Source # | |
Defined in Test.Cleveland.Lorentz.Types Methods toContractAddress :: ContractAddressWithAlias -> ContractAddress Source # | |
ToContractAddress (ContractHandle cp st vd) Source # | |
Defined in Test.Cleveland.Lorentz.Types Methods toContractAddress :: ContractHandle cp st vd -> ContractAddress Source # |
class ToImplicitAddress addr where Source #
Methods
toImplicitAddress :: addr -> ImplicitAddress Source #
Instances
ToImplicitAddress ImplicitAddress Source # | |
Defined in Test.Cleveland.Lorentz.Types Methods toImplicitAddress :: ImplicitAddress -> ImplicitAddress Source # | |
ToImplicitAddress ImplicitAddressWithAlias Source # | |
Defined in Test.Cleveland.Lorentz.Types Methods toImplicitAddress :: ImplicitAddressWithAlias -> ImplicitAddress Source # |
class ToL1Address addr where Source #
Methods
toL1Address :: addr -> L1Address Source #
Instances
ToL1Address L1Address Source # | |
Defined in Test.Cleveland.Lorentz.Types Methods toL1Address :: L1Address -> L1Address Source # | |
L1AddressKind kind => ToL1Address (KindedAddress kind) Source # | |
Defined in Test.Cleveland.Lorentz.Types Methods toL1Address :: KindedAddress kind -> L1Address Source # | |
L1AddressKind kind => ToL1Address (AddressWithAlias kind) Source # | |
Defined in Test.Cleveland.Lorentz.Types Methods toL1Address :: AddressWithAlias kind -> L1Address Source # | |
ToL1Address (ContractHandle cp st vd) Source # | |
Defined in Test.Cleveland.Lorentz.Types Methods toL1Address :: ContractHandle cp st vd -> L1Address Source # | |
ToL1Address (L1TAddress cp vd) Source # | |
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
(ToTAddress cp vd addr, ToL1Address addr) => ToL1TAddress cp vd addr Source # | |
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
NiceStorage st => ToStorageType st ContractAddress Source # | |
Defined in Test.Cleveland.Lorentz.Types Methods pickNiceStorage :: ContractAddress -> Dict (NiceStorage st) Source # | |
st ~ st' => ToStorageType st' (ContractHandle cp st vd) Source # | |
Defined in Test.Cleveland.Lorentz.Types Methods pickNiceStorage :: ContractHandle cp st vd -> Dict (NiceStorage st') Source # |
class (ParameterScopeC (NiceParameter a) (ToT a), KnownValue a) => NiceParameter a #
Instances
(ParameterScopeC (NiceParameter a) (ToT a), KnownValue a) => NiceParameter a | |
Defined in Lorentz.Constraints.Scopes |
type NiceParameterFull cp = (Typeable cp, ParameterDeclaresEntrypoints cp) #
class (StorageScopeC (NiceStorage a) (ToT a), KnownValue a) => NiceStorage a #
Instances
(StorageScopeC (NiceStorage a) (ToT a), KnownValue a) => NiceStorage a | |
Defined in Lorentz.Constraints.Scopes |
class (PackedValScopeC (NicePackedValue a) (ToT a), KnownValue a) => NicePackedValue a #
Instances
(PackedValScopeC (NicePackedValue a) (ToT a), KnownValue a) => NicePackedValue a | |
Defined in Lorentz.Constraints.Scopes |
class (UnpackedValScopeC (NiceUnpackedValue a) (ToT a), KnownValue a) => NiceUnpackedValue a #
Instances
(UnpackedValScopeC (NiceUnpackedValue a) (ToT a), KnownValue a) => NiceUnpackedValue a | |
Defined in Lorentz.Constraints.Scopes |
Minimal complete definition
Instances
ToAddress AddressAndAlias Source # | |
Defined in Test.Cleveland.Internal.Abstract Methods toAddress :: AddressAndAlias -> Address # | |
ToAddress EpAddress | |
Defined in Lorentz.Address | |
ToAddress Address | |
Defined in Lorentz.Address | |
ToAddress L1Address | |
Defined in Lorentz.Address | |
ToAddress (FutureContract cp) | |
Defined in Lorentz.Address | |
ToAddress (ContractRef cp) | |
Defined in Lorentz.Address | |
ToAddress (KindedAddress kind) | |
Defined in Lorentz.Address Methods toAddress :: KindedAddress kind -> Address # | |
ToAddress (AddressWithAlias kind) | |
Defined in Morley.Client.Types Methods toAddress :: AddressWithAlias kind -> Address # | |
ToAddress (TAddress cp vd) | |
Defined in Lorentz.Address | |
ToAddress (ContractHandle cp st vd) Source # | |
Defined in Test.Cleveland.Lorentz.Types Methods toAddress :: ContractHandle cp st vd -> 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.