From a024fb915ce41daab7f9d78f08212ec0648dc49b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20Br=C3=BCnjes?= Date: Wed, 7 Jul 2021 15:12:16 +0200 Subject: [PATCH] small changes --- README.md | 2 +- code/week02/src/Week02/Gift.hs | 43 ++++++++++++++++++++++++++++++++-- 2 files changed, 42 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b77c529..5bc432f 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ - [`Plutus.V1.Ledger.Interval`](https://github.com/input-output-hk/plutus/blob/master/plutus-ledger-api/src/Plutus/V1/Ledger/Interval.hs), contains the definition of and helper functions for the `Interval` type. - [`Plutus.V1.Ledger.Slot`](https://github.com/input-output-hk/plutus/blob/master/plutus-ledger-api/src/Plutus/V1/Ledger/Slot.hs), contains the definition of the `Slot` type. - [`Plutus.V1.Ledger.Value`](https://github.com/input-output-hk/plutus/blob/master/plutus-ledger-api/src/Plutus/V1/Ledger/Value.hs), contains the definition of and helper functions for the `Value` type. -- [`PlutusTx.Data`](https://github.com/input-output-hk/plutus/blob/master/plutus-tx/src/PlutusTx/Data.hs), contains the definition of the `Data` type. +- [`PlutusTx.Builtins.Data`](https://github.com/input-output-hk/plutus/blob/master/plutus-core/plutus-core/src/PlutusCore/Data.hs), contains the definition of the `Data` type. - [`PlutusTx.IsData.Class`](https://github.com/input-output-hk/plutus/blob/master/plutus-tx/src/PlutusTx/IsData/Class.hs), defines the `IsData` class. ## Additional Resources diff --git a/code/week02/src/Week02/Gift.hs b/code/week02/src/Week02/Gift.hs index 6450fac..c03d3ab 100644 --- a/code/week02/src/Week02/Gift.hs +++ b/code/week02/src/Week02/Gift.hs @@ -24,8 +24,6 @@ import Ledger.Ada as Ada import Playground.Contract (printJson, printSchemas, ensureKnownCurrencies, stage) import Playground.TH (mkKnownCurrencies, mkSchemaDefinitions) import Playground.Types (KnownCurrency (..)) -import Prelude (Semigroup (..), String) -import Text.Printf (printf) {-# OPTIONS_GHC -fno-warn-unused-imports #-} @@ -42,6 +40,46 @@ valHash = Scripts.validatorHash validator scrAddress :: Ledger.Address scrAddress = scriptAddress validator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +{- +{-# INLINABLE mkValidator #-} +mkValidator :: Data -> Data -> Data -> () +mkValidator _ _ _ = () + +validator :: Validator +validator = mkValidatorScript $$(PlutusTx.compile [|| mkValidator ||]) + type GiftSchema = Endpoint "give" Integer .\/ Endpoint "grab" () @@ -74,3 +112,4 @@ endpoints = (give' `select` grab') >> endpoints mkSchemaDefinitions ''GiftSchema mkKnownCurrencies [] +-}