mirror of
https://github.com/FiloSpaTeam/plutus-pioneer-program.git
synced 2024-11-14 02:42:35 +01:00
updated 'Signed'
This commit is contained in:
parent
34f21a1a47
commit
1c57956054
1 changed files with 3 additions and 3 deletions
|
@ -39,8 +39,8 @@ mkPolicy pkh ctx = txSignedBy (scriptContextTxInfo ctx) pkh
|
||||||
policy :: PubKeyHash -> Scripts.MonetaryPolicy
|
policy :: PubKeyHash -> Scripts.MonetaryPolicy
|
||||||
policy pkh = mkMonetaryPolicyScript $
|
policy pkh = mkMonetaryPolicyScript $
|
||||||
$$(PlutusTx.compile [|| Scripts.wrapMonetaryPolicy . mkPolicy ||])
|
$$(PlutusTx.compile [|| Scripts.wrapMonetaryPolicy . mkPolicy ||])
|
||||||
`PlutusTx.applyCode`
|
`PlutusTx.applyCode`
|
||||||
PlutusTx.liftCode pkh
|
PlutusTx.liftCode pkh
|
||||||
|
|
||||||
curSymbol :: PubKeyHash -> CurrencySymbol
|
curSymbol :: PubKeyHash -> CurrencySymbol
|
||||||
curSymbol = scriptCurrencySymbol . policy
|
curSymbol = scriptCurrencySymbol . policy
|
||||||
|
@ -54,7 +54,7 @@ type SignedSchema =
|
||||||
BlockchainActions
|
BlockchainActions
|
||||||
.\/ Endpoint "mint" MintParams
|
.\/ Endpoint "mint" MintParams
|
||||||
|
|
||||||
mint :: (HasBlockchainActions s, AsContractError e) => MintParams -> Contract w s e ()
|
mint :: MintParams -> Contract w SignedSchema Text ()
|
||||||
mint mp = do
|
mint mp = do
|
||||||
pkh <- pubKeyHash <$> Contract.ownPubKey
|
pkh <- pubKeyHash <$> Contract.ownPubKey
|
||||||
let val = Value.singleton (curSymbol pkh) (mpTokenName mp) (mpAmount mp)
|
let val = Value.singleton (curSymbol pkh) (mpTokenName mp) (mpAmount mp)
|
||||||
|
|
Loading…
Reference in a new issue