small update

This commit is contained in:
Lars Brünjes 2021-07-24 19:27:23 +02:00
parent e19af4cd80
commit c74fb6fefa
No known key found for this signature in database
GPG key ID: B488B9045DC1A087

View file

@ -12,24 +12,24 @@
module Week05.Signed where module Week05.Signed where
import Control.Monad hiding (fmap) import Control.Monad hiding (fmap)
import Data.Aeson (ToJSON, FromJSON) import Data.Aeson (ToJSON, FromJSON)
import Data.Text (Text) import Data.Text (Text)
import Data.Void (Void) import Data.Void (Void)
import GHC.Generics (Generic) import GHC.Generics (Generic)
import Plutus.Contract as Contract import Plutus.Contract as Contract
import Plutus.Trace.Emulator as Emulator import Plutus.Trace.Emulator as Emulator
import qualified PlutusTx import qualified PlutusTx
import PlutusTx.Prelude hiding (Semigroup(..), unless) import PlutusTx.Prelude hiding (Semigroup(..), unless)
import Ledger hiding (mint, singleton) import Ledger hiding (mint, singleton)
import Ledger.Constraints as Constraints import Ledger.Constraints as Constraints
import qualified Ledger.Typed.Scripts as Scripts import qualified Ledger.Typed.Scripts as Scripts
import Ledger.Value as Value import Ledger.Value as Value
import Playground.Contract (printJson, printSchemas, ensureKnownCurrencies, stage, ToSchema) import Playground.Contract (printJson, printSchemas, ensureKnownCurrencies, stage, ToSchema)
import Playground.TH (mkKnownCurrencies, mkSchemaDefinitions) import Playground.TH (mkKnownCurrencies, mkSchemaDefinitions)
import Playground.Types (KnownCurrency (..)) import Playground.Types (KnownCurrency (..))
import Prelude (IO, Show (..), String) import Prelude (IO, Show (..), String)
import Text.Printf (printf) import Text.Printf (printf)
import Wallet.Emulator.Wallet import Wallet.Emulator.Wallet
{-# INLINABLE mkPolicy #-} {-# INLINABLE mkPolicy #-}
@ -40,7 +40,7 @@ policy :: PubKeyHash -> Scripts.MintingPolicy
policy pkh = mkMintingPolicyScript $ policy pkh = mkMintingPolicyScript $
$$(PlutusTx.compile [|| Scripts.wrapMintingPolicy . mkPolicy ||]) $$(PlutusTx.compile [|| Scripts.wrapMintingPolicy . mkPolicy ||])
`PlutusTx.applyCode` `PlutusTx.applyCode`
PlutusTx.liftCode pkh (PlutusTx.liftCode pkh)
curSymbol :: PubKeyHash -> CurrencySymbol curSymbol :: PubKeyHash -> CurrencySymbol
curSymbol = scriptCurrencySymbol . policy curSymbol = scriptCurrencySymbol . policy