-
Notifications
You must be signed in to change notification settings - Fork 16
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
Remove use of ScriptWitnessFiles
in spending scripts
#1025
base: master
Are you sure you want to change the base?
Remove use of ScriptWitnessFiles
in spending scripts
#1025
Conversation
( optional ((,,) | ||
<$> pScriptDatumOrFileSpendingCip69 sbe scriptFlagPrefix | ||
<*> pScriptRedeemerOrFile scriptFlagPrefix | ||
<*> ( case autoBalanceExecUnits of | ||
AutoBalance -> pure (ExecutionUnits 0 0) | ||
ManualBalance -> pExecutionUnits scriptFlagPrefix | ||
)) | ||
) |
Check notice
Code scanning / HLint
Redundant bracket Note
Found:
PlutusSpend.createPlutusScriptFromCliArgs
<$>
pScriptFor
(scriptFlagPrefix ++ "-script-file")
((++ "-script-file") <$> scriptFlagPrefixDeprecated)
("The file containing the script to witness " ++ help)
<>
(optional
((,,) <$> pScriptDatumOrFileSpendingCip69 sbe scriptFlagPrefix
<> pScriptRedeemerOrFile scriptFlagPrefix
<>
(case autoBalanceExecUnits of
AutoBalance -> pure (ExecutionUnits 0 0)
ManualBalance -> pExecutionUnits scriptFlagPrefix)))
Perhaps:
PlutusSpend.createPlutusScriptFromCliArgs
<$>
pScriptFor
(scriptFlagPrefix ++ "-script-file")
((++ "-script-file") <$> scriptFlagPrefixDeprecated)
("The file containing the script to witness " ++ help)
<>
optional
((,,) <$> pScriptDatumOrFileSpendingCip69 sbe scriptFlagPrefix
<> pScriptRedeemerOrFile scriptFlagPrefix
<>
(case autoBalanceExecUnits of
AutoBalance -> pure (ExecutionUnits 0 0)
ManualBalance -> pExecutionUnits scriptFlagPrefix))
[ PlutusSpend.PotentialDatum . Just <$> (pScriptDataOrFile | ||
(scriptFlagPrefix ++ "-datum") | ||
"The script datum." | ||
"The script datum file.") |
Check notice
Code scanning / HLint
Redundant bracket Note
Found:
PlutusSpend.PotentialDatum . Just
<$>
(pScriptDataOrFile
(scriptFlagPrefix ++ "-datum") "The script datum."
"The script datum file.")
Perhaps:
PlutusSpend.PotentialDatum . Just
<$>
pScriptDataOrFile
(scriptFlagPrefix ++ "-datum") "The script datum."
"The script datum file."
pScriptDatumOrFileSpendingCip69 :: ShelleyBasedEra era -> String -> Parser PlutusSpend.ScriptDatumOrFileSpending | ||
pScriptDatumOrFileSpendingCip69 sbe scriptFlagPrefix = | ||
caseShelleyToBabbageOrConwayEraOnwards | ||
(const $ datumMandatory) |
Check notice
Code scanning / HLint
Redundant $ Note
Found:
const $ datumMandatory
Perhaps:
const datumMandatory
pScriptDatumOrFileSpendingCip69 sbe scriptFlagPrefix = | ||
caseShelleyToBabbageOrConwayEraOnwards | ||
(const $ datumMandatory) | ||
(const $ datumOptional) |
Check notice
Code scanning / HLint
Redundant $ Note
Found:
const $ datumOptional
Perhaps:
const datumOptional
[ PlutusSpend.PotentialDatum . Just <$> (pScriptDataOrFile | ||
(scriptFlagPrefix ++ "-datum") | ||
"The script datum." | ||
"The script datum file.") |
Check notice
Code scanning / HLint
Redundant bracket Note
Found:
PlutusSpend.PotentialDatum . Just
<$>
(pScriptDataOrFile
(scriptFlagPrefix ++ "-datum") "The script datum."
"The script datum file.")
Perhaps:
PlutusSpend.PotentialDatum . Just
<$>
pScriptDataOrFile
(scriptFlagPrefix ++ "-datum") "The script datum."
"The script datum file."
{-# LANGUAGE DataKinds #-} | ||
{-# LANGUAGE FlexibleContexts #-} | ||
{-# LANGUAGE GADTs #-} | ||
{-# LANGUAGE TypeApplications #-} |
Check warning
Code scanning / HLint
Unused LANGUAGE pragma Warning
Found:
{-# LANGUAGE TypeApplications #-}
Perhaps you should remove it.
:: MonadIOTransError (FileError CliSpendScriptWitnessError) t m | ||
=> ScriptDatumOrFileSpending | ||
-> t m (ScriptDatum WitCtxTxIn) | ||
handlePotentialScriptDatum InlineDatum = return $ InlineScriptDatum |
Check notice
Code scanning / HLint
Redundant $ Note
Found:
return $ InlineScriptDatum
Perhaps:
return InlineScriptDatum
{-# LANGUAGE DataKinds #-} | ||
{-# LANGUAGE FlexibleContexts #-} | ||
{-# LANGUAGE GADTs #-} | ||
{-# LANGUAGE LambdaCase #-} |
Check warning
Code scanning / HLint
Unused LANGUAGE pragma Warning
Found:
{-# LANGUAGE LambdaCase #-}
Perhaps you should remove it.
data SpendScriptWitness era | ||
= SpendScriptWitness { sswScriptWitness :: ScriptWitness WitCtxTxIn era } | ||
deriving Show |
Check notice
Code scanning / HLint
Use newtype instead of data Note
Found:
data SpendScriptWitness era
= SpendScriptWitness {sswScriptWitness :: ScriptWitness WitCtxTxIn era}
deriving Show
Perhaps:
newtype SpendScriptWitness era
= SpendScriptWitness {sswScriptWitness :: ScriptWitness WitCtxTxIn era}
deriving Show
Note: decreases laziness
data SimpleOrPlutusScriptCliArgs | ||
= OnDiskPlutusScriptCliArgs | ||
(File ScriptInAnyLang In) | ||
(ScriptDatumOrFileSpending) -- ^ Optional Datum (CIP-69) |
Check warning
Code scanning / HLint
Redundant bracket Warning
Found:
(ScriptDatumOrFileSpending)
Perhaps:
ScriptDatumOrFileSpending
Changelog
Context
Additional context for the PR goes here. If the PR fixes a particular issue please provide a link to the issue.
How to trust this PR
Highlight important bits of the PR that will make the review faster. If there are commands the reviewer can run to observe the new behavior, describe them.
Checklist