lorentz 0.9.0 → 0.9.1
raw patch · 5 files changed
+44/−3 lines, 5 filesnew-uploaderPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
+ Lorentz: customGeneric' :: Maybe Type -> Name -> Type -> [Con] -> GenericStrategy -> Q [Dec]
+ Lorentz: data Keccak :: HashAlgorithmKind
+ Lorentz: data Sha3 :: HashAlgorithmKind
+ Lorentz: deriveFullType :: Name -> Maybe Kind -> [TyVarBndr] -> TypeQ
+ Lorentz: keccak :: BytesLike bs => (bs : s) :-> (Hash Keccak bs : s)
+ Lorentz: level :: s :-> (Natural : s)
+ Lorentz: reifyDataType :: Name -> Q (Name, Cxt, Maybe Kind, [TyVarBndr], [Con])
+ Lorentz: sha3 :: BytesLike bs => (bs : s) :-> (Hash Sha3 bs : s)
+ Lorentz.Bytes: data Keccak :: HashAlgorithmKind
+ Lorentz.Bytes: data Sha3 :: HashAlgorithmKind
+ Lorentz.Bytes: instance Lorentz.Bytes.KnownHashAlgorithm Lorentz.Bytes.Keccak
+ Lorentz.Bytes: instance Lorentz.Bytes.KnownHashAlgorithm Lorentz.Bytes.Sha3
+ Lorentz.Instr: keccak :: BytesLike bs => (bs : s) :-> (Hash Keccak bs : s)
+ Lorentz.Instr: level :: s :-> (Natural : s)
+ Lorentz.Instr: sha3 :: BytesLike bs => (bs : s) :-> (Hash Sha3 bs : s)
- Lorentz: cCodeL :: forall cp_a1Id8 st_a1Id9 cp_a1IxT st_a1IxU. Lens (Contract cp_a1Id8 st_a1Id9) (Contract cp_a1IxT st_a1IxU) (ContractCode cp_a1Id8 st_a1Id9) (ContractCode cp_a1IxT st_a1IxU)
+ Lorentz: cCodeL :: forall cp_a1Mww st_a1Mwx cp_a1MRe st_a1MRf. Lens (Contract cp_a1Mww st_a1Mwx) (Contract cp_a1MRe st_a1MRf) (ContractCode cp_a1Mww st_a1Mwx) (ContractCode cp_a1MRe st_a1MRf)
- Lorentz: cCompilationOptionsL :: forall cp_a1Id8 st_a1Id9. Lens' (Contract cp_a1Id8 st_a1Id9) CompilationOptions
+ Lorentz: cCompilationOptionsL :: forall cp_a1Mww st_a1Mwx. Lens' (Contract cp_a1Mww st_a1Mwx) CompilationOptions
- Lorentz: cDisableInitialCastL :: forall cp_a1Id8 st_a1Id9. Lens' (Contract cp_a1Id8 st_a1Id9) Bool
+ Lorentz: cDisableInitialCastL :: forall cp_a1Mww st_a1Mwx. Lens' (Contract cp_a1Mww st_a1Mwx) Bool
- Lorentz.Run: cCodeL :: forall cp_a1Id8 st_a1Id9 cp_a1IxT st_a1IxU. Lens (Contract cp_a1Id8 st_a1Id9) (Contract cp_a1IxT st_a1IxU) (ContractCode cp_a1Id8 st_a1Id9) (ContractCode cp_a1IxT st_a1IxU)
+ Lorentz.Run: cCodeL :: forall cp_a1Mww st_a1Mwx cp_a1MRe st_a1MRf. Lens (Contract cp_a1Mww st_a1Mwx) (Contract cp_a1MRe st_a1MRf) (ContractCode cp_a1Mww st_a1Mwx) (ContractCode cp_a1MRe st_a1MRf)
- Lorentz.Run: cCompilationOptionsL :: forall cp_a1Id8 st_a1Id9. Lens' (Contract cp_a1Id8 st_a1Id9) CompilationOptions
+ Lorentz.Run: cCompilationOptionsL :: forall cp_a1Mww st_a1Mwx. Lens' (Contract cp_a1Mww st_a1Mwx) CompilationOptions
- Lorentz.Run: cDisableInitialCastL :: forall cp_a1Id8 st_a1Id9. Lens' (Contract cp_a1Id8 st_a1Id9) Bool
+ Lorentz.Run: cDisableInitialCastL :: forall cp_a1Mww st_a1Mwx. Lens' (Contract cp_a1Mww st_a1Mwx) Bool
Files
- CHANGES.md +12/−0
- lorentz.cabal +1/−1
- src/Lorentz/Bytes.hs +14/−0
- src/Lorentz/Entrypoints/Manual.hs +2/−2
- src/Lorentz/Instr.hs +15/−0
CHANGES.md view
@@ -1,3 +1,15 @@+Unreleased+==========+<!-- Append new entries here -->+++0.9.1+=====+* [!751](https://gitlab.com/morley-framework/morley/-/merge_requests/751)+ + Add new Edo instruction: `LEVEL`.+* [!741](https://gitlab.com/morley-framework/morley/-/merge_requests/741)+ + Add new Edo instructions: `SHA3` and `KECCAK`.+ 0.9.0 ===== * [!731](https://gitlab.com/morley-framework/morley/-/merge_requests/731)
lorentz.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: lorentz-version: 0.9.0+version: 0.9.1 synopsis: EDSL for the Michelson Language description: Lorentz is a powerful meta-programming tool which allows one to write Michelson contracts directly in Haskell. It has the same instructions as Michelson, but operates on Haskell values and allows one to use Haskell features. category: Language
src/Lorentz/Bytes.hs view
@@ -20,6 +20,8 @@ , Sha256 , Sha512 , Blake2b+ , Sha3+ , Keccak ) where import qualified Data.Kind as Kind@@ -214,3 +216,15 @@ instance KnownHashAlgorithm Blake2b where computeHash = Crypto.blake2b toHash = I T.BLAKE2B++data Sha3 :: HashAlgorithmKind++instance KnownHashAlgorithm Sha3 where+ computeHash = Crypto.sha3+ toHash = I T.SHA3++data Keccak :: HashAlgorithmKind++instance KnownHashAlgorithm Keccak where+ computeHash = Crypto.keccak+ toHash = I T.KECCAK
src/Lorentz/Entrypoints/Manual.hs view
@@ -2,7 +2,7 @@ -- -- SPDX-License-Identifier: LicenseRef-MIT-TQ --- | Allows specifying entrypoints without declaring 'ParamterHasEntrypoints'+-- | Allows specifying entrypoints without declaring 'ParameterHasEntrypoints' -- instance. module Lorentz.Entrypoints.Manual ( ParameterWrapper (..)@@ -12,8 +12,8 @@ import Lorentz.Constraints import Lorentz.Entrypoints.Core-import Michelson.Typed import Lorentz.Wrappable (Wrappable)+import Michelson.Typed -- | Wrap parameter into this to locally assign a way to derive entrypoints for -- it.
src/Lorentz/Instr.hs view
@@ -100,11 +100,14 @@ , sha256 , sha512 , blake2B+ , sha3+ , keccak , hashKey , source , sender , address , chainId+ , level , framed , LorentzFunctor (..) , NonZero (..)@@ -662,6 +665,14 @@ blake2B :: BytesLike bs => bs : s :-> Hash Blake2b bs : s blake2B = I BLAKE2B +{-# WARNING sha3 "Introduced by the Edo Protocol (008); This won't work on previous versions." #-}+sha3 :: BytesLike bs => bs : s :-> Hash Sha3 bs : s+sha3 = I SHA3++{-# WARNING keccak "Introduced by the Edo Protocol (008); This won't work on previous versions." #-}+keccak :: BytesLike bs => bs : s :-> Hash Keccak bs : s+keccak = I KECCAK+ hashKey :: PublicKey : s :-> KeyHash : s hashKey = I HASH_KEY @@ -679,6 +690,10 @@ chainId :: s :-> ChainId : s chainId = I CHAIN_ID++{-# WARNING level "Introduced by the Edo Protocol (008); This won't work on previous versions." #-}+level :: s :-> Natural : s+level = I LEVEL -- | Execute given instruction on truncated stack. --