Safe Haskell | None |
---|---|
Language | Haskell2010 |
Module, containing data types for Michelson value.
Synopsis
- data Value' instr t where
- VC :: CValue t -> Value' instr (Tc t)
- VKey :: PublicKey -> Value' instr TKey
- VUnit :: Value' instr TUnit
- VSignature :: Signature -> Value' instr TSignature
- VChainId :: ChainId -> Value' instr TChainId
- VOption :: forall t instr. Maybe (Value' instr t) -> Value' instr (TOption t)
- VList :: forall t instr. [Value' instr t] -> Value' instr (TList t)
- VSet :: forall t instr. Set (CValue t) -> Value' instr (TSet t)
- VOp :: Operation' instr -> Value' instr TOperation
- VContract :: forall arg instr. Address -> SomeEntryPointCallT arg -> Value' instr (TContract arg)
- VPair :: forall l r instr. (Value' instr l, Value' instr r) -> Value' instr (TPair l r)
- VOr :: forall l r instr. Either (Value' instr l) (Value' instr r) -> Value' instr (TOr l r)
- VLam :: forall inp out instr. (forall i o. (Show (instr i o), Eq (instr i o))) => RemFail instr (inp ': '[]) (out ': '[]) -> Value' instr (TLambda inp out)
- VMap :: forall k v instr. Map (CValue k) (Value' instr v) -> Value' instr (TMap k v)
- VBigMap :: forall k v instr. Map (CValue k) (Value' instr v) -> Value' instr (TBigMap k v)
- data SomeValue' instr where
- SomeValue :: (Typeable t, SingI t) => Value' instr t -> SomeValue' instr
- data SomeConstrainedValue' instr (c :: T -> Constraint) where
- SomeConstrainedValue :: forall (t :: T) (c :: T -> Constraint) instr. c t => Value' instr t -> SomeConstrainedValue' instr c
- type ContractInp1 param st = TPair param st
- type ContractInp param st = '[ContractInp1 param st]
- type ContractOut1 st = TPair (TList TOperation) st
- type ContractOut st = '[ContractOut1 st]
- data CreateContract instr cp st = (Show (instr (ContractInp cp st) (ContractOut st)), Eq (instr (ContractInp cp st) (ContractOut st))) => CreateContract {
- ccOriginator :: Address
- ccDelegate :: Maybe KeyHash
- ccBalance :: Mutez
- ccStorageVal :: Value' instr st
- ccContractCode :: instr (ContractInp cp st) (ContractOut st)
- data CValue t where
- CvInt :: Integer -> CValue CInt
- CvNat :: Natural -> CValue CNat
- CvString :: MText -> CValue CString
- CvBytes :: ByteString -> CValue CBytes
- CvMutez :: Mutez -> CValue CMutez
- CvBool :: Bool -> CValue CBool
- CvKeyHash :: KeyHash -> CValue CKeyHash
- CvTimestamp :: Timestamp -> CValue CTimestamp
- CvAddress :: EpAddress -> CValue CAddress
- data Operation' instr where
- OpTransferTokens :: ParameterScope p => TransferTokens instr p -> Operation' instr
- OpSetDelegate :: SetDelegate -> Operation' instr
- OpCreateContract :: (Show (instr (ContractInp cp st) (ContractOut st)), Typeable instr, ParameterScope cp, StorageScope st) => CreateContract instr cp st -> Operation' instr
- data SetDelegate = SetDelegate {}
- data TransferTokens instr p = TransferTokens {
- ttTransferArgument :: Value' instr p
- ttAmount :: Mutez
- ttContract :: Value' instr (TContract p)
- data RemFail (instr :: k -> k -> Type) (i :: k) (o :: k) where
- RfNormal :: instr i o -> RemFail instr i o
- RfAlwaysFails :: (forall o'. instr i o') -> RemFail instr i o
- rfMerge :: (forall o'. instr i1 o' -> instr i2 o' -> instr i3 o') -> RemFail instr i1 o -> RemFail instr i2 o -> RemFail instr i3 o
- rfAnyInstr :: RemFail instr i o -> instr i o
- rfMapAnyInstr :: (forall o'. instr i1 o' -> instr i2 o') -> RemFail instr i1 o -> RemFail instr i2 o
- addressToVContract :: forall t instr. (ParameterScope t, ForbidOr t) => Address -> Value' instr (TContract t)
- buildVContract :: Value' instr (TContract arg) -> Builder
- compileEpLiftSequence :: EpLiftSequence arg param -> Value' instr arg -> Value' instr param
Documentation
data Value' instr t where Source #
Representation of Michelson value.
Type parameter instr
stands for Michelson instruction
type, i.e. data type to represent an instruction of language.
VC :: CValue t -> Value' instr (Tc t) | |
VKey :: PublicKey -> Value' instr TKey | |
VUnit :: Value' instr TUnit | |
VSignature :: Signature -> Value' instr TSignature | |
VChainId :: ChainId -> Value' instr TChainId | |
VOption :: forall t instr. Maybe (Value' instr t) -> Value' instr (TOption t) | |
VList :: forall t instr. [Value' instr t] -> Value' instr (TList t) | |
VSet :: forall t instr. Set (CValue t) -> Value' instr (TSet t) | |
VOp :: Operation' instr -> Value' instr TOperation | |
VContract :: forall arg instr. Address -> SomeEntryPointCallT arg -> Value' instr (TContract arg) | |
VPair :: forall l r instr. (Value' instr l, Value' instr r) -> Value' instr (TPair l r) | |
VOr :: forall l r instr. Either (Value' instr l) (Value' instr r) -> Value' instr (TOr l r) | |
VLam :: forall inp out instr. (forall i o. (Show (instr i o), Eq (instr i o))) => RemFail instr (inp ': '[]) (out ': '[]) -> Value' instr (TLambda inp out) | |
VMap :: forall k v instr. Map (CValue k) (Value' instr v) -> Value' instr (TMap k v) | |
VBigMap :: forall k v instr. Map (CValue k) (Value' instr v) -> Value' instr (TBigMap k v) |
Instances
Eq (Value' instr t) Source # | |
Show (Value' instr t) Source # | |
(Arbitrary (Value' instr a), Arbitrary (Value' instr b)) => Arbitrary (Value' instr (TPair a b)) Source # | |
Arbitrary (Value' instr TUnit) Source # | |
Arbitrary (Value' instr a) => Arbitrary (Value' instr (TList a)) Source # | |
Arbitrary (CValue a) => Arbitrary (Value' instr (Tc a)) Source # | |
(SingI t, HasNoOp t) => Buildable (Value' Instr t) Source # | |
data SomeValue' instr where Source #
SomeValue :: (Typeable t, SingI t) => Value' instr t -> SomeValue' instr |
Instances
Eq (SomeValue' instr) Source # | |
Defined in Michelson.Typed.Value (==) :: SomeValue' instr -> SomeValue' instr -> Bool # (/=) :: SomeValue' instr -> SomeValue' instr -> Bool # | |
Show (SomeValue' instr) Source # | |
Defined in Michelson.Typed.Value showsPrec :: Int -> SomeValue' instr -> ShowS # show :: SomeValue' instr -> String # showList :: [SomeValue' instr] -> ShowS # |
data SomeConstrainedValue' instr (c :: T -> Constraint) where Source #
SomeConstrainedValue :: forall (t :: T) (c :: T -> Constraint) instr. c t => Value' instr t -> SomeConstrainedValue' instr c |
Instances
Show (SomeConstrainedValue' instr c) Source # | |
Defined in Michelson.Typed.Value showsPrec :: Int -> SomeConstrainedValue' instr c -> ShowS # show :: SomeConstrainedValue' instr c -> String # showList :: [SomeConstrainedValue' instr c] -> ShowS # |
type ContractInp1 param st = TPair param st Source #
type ContractInp param st = '[ContractInp1 param st] Source #
type ContractOut1 st = TPair (TList TOperation) st Source #
type ContractOut st = '[ContractOut1 st] Source #
data CreateContract instr cp st Source #
(Show (instr (ContractInp cp st) (ContractOut st)), Eq (instr (ContractInp cp st) (ContractOut st))) => CreateContract | |
|
Instances
Eq (CreateContract instr cp st) Source # | |
Defined in Michelson.Typed.Value (==) :: CreateContract instr cp st -> CreateContract instr cp st -> Bool # (/=) :: CreateContract instr cp st -> CreateContract instr cp st -> Bool # | |
Show (CreateContract instr cp st) Source # | |
Defined in Michelson.Typed.Value showsPrec :: Int -> CreateContract instr cp st -> ShowS # show :: CreateContract instr cp st -> String # showList :: [CreateContract instr cp st] -> ShowS # | |
Buildable (CreateContract instr cp st) Source # | |
Defined in Michelson.Typed.Value build :: CreateContract instr cp st -> Builder # |
Representation of comparable value in Michelson language.
By specification, we're allowed to compare only following types: int, nat, string, bytes, mutez, bool, key_hash, timestamp, address.
Only these values can be used as map keys or set elements.
CvInt :: Integer -> CValue CInt | |
CvNat :: Natural -> CValue CNat | |
CvString :: MText -> CValue CString | |
CvBytes :: ByteString -> CValue CBytes | |
CvMutez :: Mutez -> CValue CMutez | |
CvBool :: Bool -> CValue CBool | |
CvKeyHash :: KeyHash -> CValue CKeyHash | |
CvTimestamp :: Timestamp -> CValue CTimestamp | |
CvAddress :: EpAddress -> CValue CAddress |
Instances
Eq (CValue t) Source # | |
Ord (CValue t) Source # | |
Defined in Michelson.Typed.CValue | |
Show (CValue t) Source # | |
Arbitrary (CValue CInt) Source # | |
Arbitrary (CValue CMutez) Source # | |
Arbitrary (CValue CKeyHash) Source # | |
Arbitrary (CValue CTimestamp) Source # | |
Defined in Michelson.Test.Gen arbitrary :: Gen (CValue CTimestamp) # shrink :: CValue CTimestamp -> [CValue CTimestamp] # |
data Operation' instr where Source #
Data type, representing operation, list of which is returned by Michelson contract (according to calling convention).
These operations are to be further executed against system state after the contract execution.
OpTransferTokens :: ParameterScope p => TransferTokens instr p -> Operation' instr | |
OpSetDelegate :: SetDelegate -> Operation' instr | |
OpCreateContract :: (Show (instr (ContractInp cp st) (ContractOut st)), Typeable instr, ParameterScope cp, StorageScope st) => CreateContract instr cp st -> Operation' instr |
Instances
data SetDelegate Source #
Instances
Eq SetDelegate Source # | |
Defined in Michelson.Typed.Value (==) :: SetDelegate -> SetDelegate -> Bool # (/=) :: SetDelegate -> SetDelegate -> Bool # | |
Show SetDelegate Source # | |
Defined in Michelson.Typed.Value showsPrec :: Int -> SetDelegate -> ShowS # show :: SetDelegate -> String # showList :: [SetDelegate] -> ShowS # | |
Buildable SetDelegate Source # | |
Defined in Michelson.Typed.Value build :: SetDelegate -> Builder # |
data TransferTokens instr p Source #
TransferTokens | |
|
Instances
Eq (TransferTokens instr p) Source # | |
Defined in Michelson.Typed.Value (==) :: TransferTokens instr p -> TransferTokens instr p -> Bool # (/=) :: TransferTokens instr p -> TransferTokens instr p -> Bool # | |
Show (TransferTokens instr p) Source # | |
Defined in Michelson.Typed.Value showsPrec :: Int -> TransferTokens instr p -> ShowS # show :: TransferTokens instr p -> String # showList :: [TransferTokens instr p] -> ShowS # | |
Buildable (TransferTokens instr p) Source # | |
Defined in Michelson.Typed.Value build :: TransferTokens instr p -> Builder # |
data RemFail (instr :: k -> k -> Type) (i :: k) (o :: k) where Source #
Wrapper over instruction which remembers whether this instruction always fails or not.
RfNormal :: instr i o -> RemFail instr i o | |
RfAlwaysFails :: (forall o'. instr i o') -> RemFail instr i o |
rfMerge :: (forall o'. instr i1 o' -> instr i2 o' -> instr i3 o') -> RemFail instr i1 o -> RemFail instr i2 o -> RemFail instr i3 o Source #
Merge two execution branches.
rfAnyInstr :: RemFail instr i o -> instr i o Source #
Get code disregard whether it always fails or not.
rfMapAnyInstr :: (forall o'. instr i1 o' -> instr i2 o') -> RemFail instr i1 o -> RemFail instr i2 o Source #
Modify inner code.
addressToVContract :: forall t instr. (ParameterScope t, ForbidOr t) => Address -> Value' instr (TContract t) Source #
Make value of contract
type which refers to the given address and
does not call any entrypoint.
compileEpLiftSequence :: EpLiftSequence arg param -> Value' instr arg -> Value' instr param Source #
Turn EpLiftSequence
into actual function on Value
s.