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

Depend on plutus-script-utils #1656

Closed
wants to merge 2 commits into from
Closed
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
10 changes: 10 additions & 0 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,13 @@ benchmarks: True

-- Always show detailed output for tests
test-show-details: direct

source-repository-package
type: git
location: https://github.com/IntersectMBO/cardano-node-emulator
tag: 20f3faf2ef9ca97edcdb7b037507b35a5d76673b
--sha256: sha256-bhaJsWqjhojpbwxLX1+vVPSPz86tbhDcBUHk6M1HPzU=
subdir:
plutus-script-utils
plutus-ledger
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we use the packages from CHaP?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It isn't merged yet because it's a monorepo that would require fixes to cardano-node-enulator as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need the plutus-ledger entry here? I don't see it used in our cabal files.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This dependency will not help us much anymore if we switch to aiken. We should close this.


32 changes: 2 additions & 30 deletions hydra-plutus-extras/src/Hydra/Plutus/Extras.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,45 +18,17 @@ import Cardano.Api (
import Cardano.Api.Shelley (PlutusScript (PlutusScriptSerialised))
import PlutusLedgerApi.Common (SerialisedScript)
import PlutusLedgerApi.V2 (ScriptHash (..))
import PlutusTx (BuiltinData, UnsafeFromData (..))
import PlutusTx.Prelude (BuiltinUnit, check, toBuiltin)
import PlutusTx (BuiltinData)
import PlutusTx.Prelude (BuiltinUnit, toBuiltin)

-- * Vendored from plutus-ledger

-- | Signature of an untyped validator script.
type ValidatorType = BuiltinData -> BuiltinData -> BuiltinData -> BuiltinUnit

-- | Wrap a typed validator to get the basic `ValidatorType` signature which can
-- be passed to `PlutusTx.compile`.
-- REVIEW: There might be better ways to name this than "wrap"
wrapValidator ::
(UnsafeFromData datum, UnsafeFromData redeemer, UnsafeFromData context) =>
(datum -> redeemer -> context -> Bool) ->
ValidatorType
wrapValidator f d r c =
check $ f datum redeemer context
where
datum = unsafeFromBuiltinData d
redeemer = unsafeFromBuiltinData r
context = unsafeFromBuiltinData c
{-# INLINEABLE wrapValidator #-}

-- | Signature of an untyped minting policy script.
type MintingPolicyType = BuiltinData -> BuiltinData -> BuiltinUnit

-- | Wrap a typed minting policy to get the basic `MintingPolicyType` signature
-- which can be passed to `PlutusTx.compile`.
wrapMintingPolicy ::
(UnsafeFromData redeemer, UnsafeFromData context) =>
(redeemer -> context -> Bool) ->
MintingPolicyType
wrapMintingPolicy f r c =
check $ f redeemer context
where
redeemer = unsafeFromBuiltinData r
context = unsafeFromBuiltinData c
{-# INLINEABLE wrapMintingPolicy #-}

-- * Similar utilities as plutus-ledger

-- | Compute the on-chain 'ScriptHash' for a given serialised plutus script. Use
Expand Down
1 change: 1 addition & 0 deletions hydra-plutus/hydra-plutus.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ library
, hydra-prelude
, plutus-core ^>=1.30
, plutus-ledger-api ^>=1.30
, plutus-script-utils
, plutus-tx ^>=1.30
, plutus-tx-plugin ^>=1.30
, QuickCheck
Expand Down
4 changes: 2 additions & 2 deletions hydra-plutus/scripts/mHead.plutus

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions hydra-plutus/scripts/vCommit.plutus
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"type": "PlutusScriptV2",
"description": "hydra-vCommit-0.17.0-348-gd8c94a18c3",
"cborHex": "5906cc5906c9010000323233223322323232323323232322222533533300430050033232325333573466e1d2000002112200115333573466e1d200200211220021300c00b35573c0046aae74004dd50011991919191911919192999ab9a3370e90000010999109198008018011919192999ab9a3370e9000001099191919191919191919199999999999911111111111091999999999998008068060058050048040038030028020018011980e11919192999ab9a3370e900000109991091980080180118109aba10013016357426ae880044c08c088d55cf0011aab9d00137540026ae8402cd5d08051980e0091aba100933301675ca02a6ae84020ccc059d7280a9aba10073574200c6ae84014d5d08021980e3ae357420066ae84008ccc059d710009aba1001357426ae88004d5d10009aba2001357440026ae88004d5d10009aba2001357440026ae88004d5d10009aba20011301501435573c0046aae74004dd51aba10013232325333573466e1d2000002132122223003005375c6ae8400454ccd5cd19b87480080084c848888c004014c04cd5d08008a999ab9a3370e900200109909111180100298049aba100115333573466e1d20060021321222230040053232325333573466e1d2000002132122222223005008300c357420022a666ae68cdc3a400400426424444444600e01060186ae8400454ccd5cd19b87480100084cc8848888888cc018024020c030d5d08009bae357426ae8800454ccd5cd19b87480180084cc8848888888cc008024020dd71aba1001375c6ae84d5d10008a999ab9a3370e90040010999109111111198008048041bae357420026eb4d5d09aba200115333573466e1d200a00211222222200415333573466e1d200c0021122222220031301801735573c0046aae74004dd51aba10011301501435573c0046aae74004dd51aba135744002260240226aae78008d55ce8009baa0013223232325333573466e1d200000213232333322221233330010050040030023232325333573466e1d2000002133221233001003002300c35742002660140166ae84d5d10008980b80b1aab9e00235573a0026ea8d5d0801999805bae500a35742004646464a666ae68cdc3a4000004224440062a666ae68cdc3a4004004264244460020086eb8d5d08008a999ab9a3370e9002001099091118010021aba10011301701635573c0046aae74004dd51aba10013300775c6ae84d5d10009aba200135744002260240226aae78008d55ce8009baa001223232325333573466e1d2002002112200115333573466e1d20000021321223002003300535742002260240226aae78008d55ce8009baa00123232325333573466e1d200000213212230020033005357420022a666ae68cdc3a400400426466644424466600200a0080066eb4d5d08011bad357420026eb4d5d09aba2001357440022602001e6aae78008d55ce8009baa00123232325333573466e1d20000021321223002003375c6ae8400454ccd5cd19b87480080084c8488c00400cdd71aba10011300f00e35573c0046aae74004dd5000899800bae75a4464460046eac004c05088cccd55cf800900a91919a80a9991091980080180118031aab9d001300535573c00260086ae8800cd5d08010070008a4c2601292103505435003223232325333573466e1d200000213233322212333001004003002375c6ae84008c018d5d08009bae357426ae88004d5d1000898048041aab9e00235573a0026ea8004c0048c8c8c94ccd5cd19b87480000084cc8848cc00400c008c018d5d08009bae357426ae880044c02001cd55cf0011aab9d0013754002464460046eb0004c03488cccd55cf8009007119a80698021aba100230033574400400e4646464a666ae68cdc3a4000004266442466002006004646464a666ae68cdc3a400000426eb8d5d0800898048041aab9e00235573a0026ea8d5d08009bad357426ae880044c018014d55cf0011aab9d001375400292103505431003232222350032223232533500713300a49010343303100300135300900622222222222200813300a49010343303200300235533535300900622222222222200a1300b491035054380022100222220033013225335001101022135002225333573466e3c0080204c0480044c01800cc048894cd4004403c884d4008894ccd5cd19b8f0020071301200113006003235001220022253350011008133573800400e464c66ae7000400848004c01c894cd40044010884d4008894ccd5cd19b8f00200c1333573466e1d2001001009008130060033006225335001100322135002225333573466e3c00802c4ccd5cd19b874800800402001c4c01800c488008488004488008488488cc00401000d22010b4879647261486561645631002323001001230022330020020011"
"description": "hydra-vCommit-0.19.0-38-g82827a181",
"cborHex": "59073b5907380100003233223233223232323233233232322222253353330043357389211944617461206465636f646564207375636365737366756c6c790030060033357389211d52656465656d6572206465636f646564207375636365737366756c6c790030050023357389212353637269707420636f6e74657874206465636f646564207375636365737366756c6c79003232325333573466e1d200000232323232321332212330010030023232325333573466e1d20000021323232323232323232323333333333332222222222221233333333333300100d00c00b00a0090080070060050040030023301c23232325333573466e1d200000213322123300100300230213574200260246ae84d5d1000898118111aab9e00235573a0026ea8004d5d08059aba100a3301c00e35742012666024eb94044d5d08041998093ae50113574200e6ae84018d5d08029aba10043301c75c6ae8400cd5d08011998093ae2001357420026ae84d5d10009aba2001357440026ae88004d5d10009aba2001357440026ae88004d5d10009aba2001357440022602a0286aae78008d55ce8009baa3574200c646464a666ae68cdc3a400000426424444600600a6eb8d5d08008a999ab9a3370e900100109909111180080298099aba100115333573466e1d20040021321222230020053005357420022a666ae68cdc3a400c00426424444600800a646464a666ae68cdc3a400000426424444444600a01060106ae8400454ccd5cd19b87480080084c848888888c01c020c020d5d08008a999ab9a3370e900200109991091111111980300480418041aba1001375c6ae84d5d10008a999ab9a3370e90030010999109111111198010048041bae357420026eb8d5d09aba200115333573466e1d2008002133221222222233001009008375c6ae84004dd69aba1357440022a666ae68cdc3a40140042244444440082a666ae68cdc3a40180042244444440062603002e6aae78008d55ce8009baa357420022602a0286aae78008d55ce8009baa357426ae88018c88c8c8c94ccd5cd19b87480000084c8c8cccc888848cccc00401401000c008c8c8c94ccd5cd19b87480000084cc8848cc00400c008c030d5d0800998050059aba135744002260360346aae78008d55ce8009baa35742006666016eb94028d5d08011919192999ab9a3370e9000001089110018a999ab9a3370e9001001099091118008021bae357420022a666ae68cdc3a4008004264244460040086ae840044c06c068d55cf0011aab9d00137546ae84004cc01dd71aba1357440026ae88004d5d10008980b00a9aab9e00235573a0026ea800488c8c8c94ccd5cd19b8748008008448800454ccd5cd19b87480000084c8488c00800cc014d5d08008980b00a9aab9e00235573a0026ea80048c8c8c94ccd5cd19b87480000084c8488c00800cc014d5d08008a999ab9a3370e90010010991999110911998008028020019bad357420046eb4d5d08009bad357426ae88004d5d10008980a0099aab9e00235573a0026ea80048c8c8c94ccd5cd19b87480000084c8488c00800cdd71aba100115333573466e1d20020021321223001003375c6ae840044c04c048d55cf0011aab9d0013754002266002eb9d69119118011bab00130182233335573e002402e46466a02e66442466002006004600c6aae74004c014d55cf00098021aba2003357420040242601a0186aae78008d55ce8009baa00114984c02924103505435003223232325333573466e1d200000213233322212333001004003002375c6ae84008c018d5d08009bae357426ae88004d5d1000898048041aab9e00235573a0026ea8004c0048c8c8c94ccd5cd19b87480000084cc8848cc00400c008c018d5d08009bae357426ae880044c02001cd55cf0011aab9d0013754002464460046eb0004c03488cccd55cf8009006119a80598021aba100230033574400400e4646464a666ae68cdc3a4000004266442466002006004646464a666ae68cdc3a400000426eb8d5d0800898048041aab9e00235573a0026ea8d5d08009bad357426ae880044c018014d55cf0011aab9d00137540024646464a666ae68cdc3a400000422440022a666ae68cdc3a400400422440042600c00a6aae78008d55ce8009baa00149103505431003232222350032223232533500713300a49010343303100300135300900622222222222200813300a49010343303200300235533535300900622222222222200a1300b491035054380022100222220033013225335001101322135002225333573466e3c0080204c0480044c01800cc048894cd40044048884d4008894ccd5cd19b8f002007130120011300600323500122002225335001100b1335738004014464c66ae7000400848004c01c894cd4004401c884d4008894ccd5cd19b8f00200a1333573466e1d200100100c00b130060033006225335001100622135002225333573466e3c0080244ccd5cd19b874800800402c0284c01800c488008488488cc00401000d22010b4879647261486561645631001220021220012323001001230022330020020011"
}
Loading