| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Morley.Michelson.Typed.Operation
Synopsis
- newtype OperationHash = OperationHash {}
- data OriginationOperation = forall cp st.(StorageScope st, ParameterScope cp) => OriginationOperation {
- ooOriginator :: Address
- ooDelegate :: Maybe KeyHash
- ooBalance :: Mutez
- ooStorage :: Value st
- ooContract :: Contract cp st
- ooCounter :: GlobalCounter
- data TransferOperation = TransferOperation {}
- data SetDelegateOperation = SetDelegateOperation {}
- mkContractAddress :: OperationHash -> GlobalCounter -> Address
- mkOriginationOperationHash :: OriginationOperation -> OperationHash
- mkTransferOperationHash :: ParameterScope t => Address -> Value t -> EpName -> Mutez -> OperationHash
- mkDelegationOperationHash :: SetDelegateOperation -> OperationHash
Documentation
newtype OperationHash Source #
Constructors
| OperationHash | |
Fields | |
Instances
data OriginationOperation Source #
Data necessary to originate a contract.
Constructors
| forall cp st.(StorageScope st, ParameterScope cp) => OriginationOperation | |
Fields
| |
Instances
| Show OriginationOperation Source # | |
Defined in Morley.Michelson.Typed.Operation Methods showsPrec :: Int -> OriginationOperation -> ShowS # show :: OriginationOperation -> String # showList :: [OriginationOperation] -> ShowS # | |
data TransferOperation Source #
Data necessary to send a transaction to given address which is assumed to be the address of an originated contract.
Constructors
| TransferOperation | |
Fields
| |
Instances
| Show TransferOperation Source # | |
Defined in Morley.Michelson.Typed.Operation Methods showsPrec :: Int -> TransferOperation -> ShowS # show :: TransferOperation -> String # showList :: [TransferOperation] -> ShowS # | |
data SetDelegateOperation Source #
Set contract's delegate
Constructors
| SetDelegateOperation | |
Fields
| |
Instances
| Show SetDelegateOperation Source # | |
Defined in Morley.Michelson.Typed.Operation Methods showsPrec :: Int -> SetDelegateOperation -> ShowS # show :: SetDelegateOperation -> String # showList :: [SetDelegateOperation] -> ShowS # | |
mkContractAddress :: OperationHash -> GlobalCounter -> Address Source #
Compute address of a contract from its origination operation and global counter.
However, in real Tezos encoding of the operation is more than just OriginationOperation.
There an Operation has several more meta-fields plus a big sum-type of all possible operations.
In other words, contract hash is calculated as the blake2b160 (20-byte) hash of origination operation hash + word64 global counter.
In Morley we do not yet support full encoding of Tezos Operations, therefore we choose to generate contract addresses in a simplified manner.
Namely, we encode OriginationOperation as we can and concat it with the global counter.
mkOriginationOperationHash :: OriginationOperation -> OperationHash Source #
Construct OperationHash for an OriginationOperation.
mkTransferOperationHash :: ParameterScope t => Address -> Value t -> EpName -> Mutez -> OperationHash Source #
mkDelegationOperationHash :: SetDelegateOperation -> OperationHash Source #
Construct OperationHash for a SetDelegateOperation.