Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
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)
- 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
- 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.
(NiceParameter cp, NiceStorage st, NiceViewsDescriptor vd) => ContractHandle | |
Instances
newtype L1TAddress cp vd Source #
Counterpart of TAddress
that contains L1Address
instead of Address
.
L1TAddress | |
|
Instances
(cp ~ cp', vd ~ vd') => ToTAddress cp' vd' (L1TAddress cp vd) Source # | |
Defined in Test.Cleveland.Lorentz.Types toTAddress :: L1TAddress cp vd -> TAddress cp' vd' | |
ToL1Address (L1TAddress cp vd) Source # | |
Defined in Test.Cleveland.Lorentz.Types toL1Address :: L1TAddress cp vd -> L1Address Source # |
class ToContractAddress addr where Source #
toContractAddress :: addr -> ContractAddress Source #
Instances
ToContractAddress ContractAddress Source # | |
Defined in Test.Cleveland.Lorentz.Types | |
ToContractAddress ContractAddressWithAlias Source # | |
ToContractAddress (ContractHandle cp st vd) Source # | |
Defined in Test.Cleveland.Lorentz.Types toContractAddress :: ContractHandle cp st vd -> ContractAddress Source # |
class ToImplicitAddress addr where Source #
toImplicitAddress :: addr -> ImplicitAddress Source #
Instances
class ToL1Address addr where Source #
toL1Address :: addr -> L1Address Source #
Instances
ToL1Address L1Address Source # | |
Defined in Test.Cleveland.Lorentz.Types toL1Address :: L1Address -> L1Address Source # | |
L1AddressKind kind => ToL1Address (KindedAddress kind) Source # | |
Defined in Test.Cleveland.Lorentz.Types toL1Address :: KindedAddress kind -> L1Address Source # | |
L1AddressKind kind => ToL1Address (AddressWithAlias kind) Source # | |
Defined in Test.Cleveland.Lorentz.Types toL1Address :: AddressWithAlias kind -> L1Address Source # | |
ToL1Address (ContractHandle cp st vd) Source # | |
Defined in Test.Cleveland.Lorentz.Types toL1Address :: ContractHandle cp st vd -> L1Address Source # | |
ToL1Address (L1TAddress cp vd) Source # | |
Defined in Test.Cleveland.Lorentz.Types 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
.
toL1TAddress :: addr -> L1TAddress cp vd Source #
Instances
(ToTAddress cp vd addr, ToL1Address addr) => ToL1TAddress cp vd addr Source # | |
Defined in Test.Cleveland.Lorentz.Types 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.
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 pickNiceStorage :: ContractAddress -> Dict (NiceStorage st) Source # | |
st ~ st' => ToStorageType st' (ContractHandle cp st vd) Source # | |
Defined in Test.Cleveland.Lorentz.Types pickNiceStorage :: ContractHandle cp st vd -> Dict (NiceStorage st') Source # |
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) #
Instances
ToAddress AddressAndAlias Source # | |
Defined in Test.Cleveland.Internal.Abstract 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 toAddress :: KindedAddress kind -> Address # | |
ToAddress (AddressWithAlias kind) | |
Defined in Morley.Client.Types toAddress :: AddressWithAlias kind -> Address # | |
ToAddress (TAddress cp vd) | |
Defined in Lorentz.Address | |
ToAddress (ContractHandle cp st vd) Source # | |
Defined in Test.Cleveland.Lorentz.Types 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.