Skip to content

Commit

Permalink
Add changelog entries and make convertScriptRef pure
Browse files Browse the repository at this point in the history
  • Loading branch information
amirmrad committed Sep 30, 2022
1 parent 6217420 commit 5151fd3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Expand Up @@ -43,6 +43,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

- Reorganised the library into new namespaces. Namely: library internals, tests, and examples are now under `Ctl.Internal.*`, `Test.Ctl.*`, and `Ctl.Examples.*` respectively. Documentation and comments have been updated to use these new names, but not entries of previous releases in the changelog. ([#1039](https://github.com/Plutonomicon/cardano-transaction-lib/pull/1039))
- Switched to `preview` testnet by default ([#1030](https://github.com/Plutonomicon/cardano-transaction-lib/pull/1030))
- `MintingPolicy` to an enum consisting of `PlutusScript` or `NativeScript` ([#1056](https://github.com/Plutonomicon/cardano-transaction-lib/pull/1056))
- `Serialization.NativeScript`'s `convertNativeScript` is now pure ([#1056](https://github.com/Plutonomicon/cardano-transaction-lib/pull/1056))
- `Contract.Scripts` `applyArgs` and its internal definition are now monomorphic on the script parameter ([#1056](https://github.com/Plutonomicon/cardano-transaction-lib/pull/1056))

### Removed

Expand Down
2 changes: 0 additions & 2 deletions examples/OneShotMinting.purs
Expand Up @@ -137,8 +137,6 @@ mkOneShotMintingPolicy json ty mkPlutusScript oref = do
mintingPolicyArgs :: Array PlutusData
mintingPolicyArgs = Array.singleton (toData oref)

-- TODO: amir: remove the unnessary wrapping and unwrapping of plutus script
-- into `Validator`
liftedE $ map PlutusMintingPolicy <$> applyArgs unappliedMintingPolicy
mintingPolicyArgs

13 changes: 6 additions & 7 deletions src/Internal/Serialization.purs
Expand Up @@ -823,15 +823,14 @@ convertTxOutput
=<< fromJustEff "convertTxOutput"
(convertPlutusData $ unwrap datumValue)
for_ scriptRef $
convertScriptRef >=> transactionOutputSetScriptRef txo
convertScriptRef >>> transactionOutputSetScriptRef txo
pure txo

-- TODO: amir: doesn't need to be effectful?
convertScriptRef :: T.ScriptRef -> Effect ScriptRef
convertScriptRef (T.NativeScriptRef nativeScript) = do
pure <<< scriptRefNewNativeScript <<< convertNativeScript $ nativeScript
convertScriptRef (T.PlutusScriptRef plutusScript) = do
pure $ scriptRefNewPlutusScript $ convertPlutusScript plutusScript
convertScriptRef :: T.ScriptRef -> ScriptRef
convertScriptRef (T.NativeScriptRef nativeScript) =
scriptRefNewNativeScript <<< convertNativeScript $ nativeScript
convertScriptRef (T.PlutusScriptRef plutusScript) =
scriptRefNewPlutusScript <<< convertPlutusScript $ plutusScript

convertValue :: Value.Value -> Effect Value
convertValue val = do
Expand Down

0 comments on commit 5151fd3

Please sign in to comment.