Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Currency v2 #369

Merged
merged 3 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
2. Rename `Cooked.testFailsFrom'` into `Cooked.testFailsFrom`.
3. (Bonus) simplify, knowing that ``Cooked.testFailsFrom o x def ==
Cooked.testFails o x``
- Quick and permanent value minting policies have been migrated to PlutusV2.

### Fixes

Expand Down
9 changes: 4 additions & 5 deletions src/Cooked/Currencies.hs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@ module Cooked.Currencies
where

import qualified Ledger.Typed.Scripts as Scripts
import qualified Plutus.Script.Utils.V1.Scripts as Validation
import qualified Plutus.V1.Ledger.Scripts as V1
import qualified Plutus.V1.Ledger.Value as Pl
import qualified Plutus.Script.Utils.V2.Scripts as Validation
import qualified Plutus.Script.Utils.Value as Pl
import qualified Plutus.V2.Ledger.Api as Pl
import qualified PlutusTx
import qualified PlutusTx.Builtins.Class as Pl
Expand Down Expand Up @@ -72,7 +71,7 @@ mkQuickCurrencyPolicy _ _ = True

quickCurrencyPolicy :: Scripts.MintingPolicy
quickCurrencyPolicy =
V1.mkMintingPolicyScript
Pl.mkMintingPolicyScript
$$(PlutusTx.compile [||Scripts.mkUntypedMintingPolicy mkQuickCurrencyPolicy||])

quickCurrencySymbol :: Pl.CurrencySymbol
Expand All @@ -98,7 +97,7 @@ mkPermanentCurrencyPolicy _ _ = False

permanentCurrencyPolicy :: Scripts.MintingPolicy
permanentCurrencyPolicy =
V1.mkMintingPolicyScript
Pl.mkMintingPolicyScript
$$(PlutusTx.compile [||Scripts.mkUntypedMintingPolicy mkPermanentCurrencyPolicy||])

permanentCurrencySymbol :: Pl.CurrencySymbol
Expand Down
2 changes: 1 addition & 1 deletion tests/Cooked/ShowBSSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ tests =
"Value (fromList [(CurrencySymbol \"\",fromList [(TokenName \"\",123)])])"
),
( showBS @Pl.Value (quickValue "banana" 4),
"Value (fromList [(CurrencySymbol \"35a527970f2e1b64ed7cf429f1594ce8b5f0cf09e37473ab628082bd\",fromList [(TokenName \"62616e616e61\",4)])])"
"Value (fromList [(CurrencySymbol \"ce10165e35b6d1e09617cb0f8a2bf6e2fedc347ddd497c8d4b02741c\",fromList [(TokenName \"62616e616e61\",4)])])"
),
( showBS (Pl.mkConstr 0 [Pl.mkMap [(Pl.mkI 1, Pl.mkList [Pl.mkB "abc"])]]),
"BuiltinData (Constr 0 [Map [(I 1,List [B \"616263\"])]])"
Expand Down
Loading