From 8f5f1143fe051e339360e0742ffb7e527afa4bc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Tue, 1 Mar 2022 21:25:18 -0500 Subject: [PATCH 1/4] Updated to fresh Plutus and plutus-extra --- cabal-haskell.nix.project | 284 ++++++++++---------- cabal.project | 2 +- flake.nix | 4 +- majority-multisign/majority-multisign.cabal | 7 +- majority-multisign/test/Spec/Direct.hs | 23 +- majority-multisign/test/Spec/Instances.hs | 4 - nix/sources.json | 104 ++++--- 7 files changed, 236 insertions(+), 192 deletions(-) diff --git a/cabal-haskell.nix.project b/cabal-haskell.nix.project index 2238100..dce3eb2 100644 --- a/cabal-haskell.nix.project +++ b/cabal-haskell.nix.project @@ -16,23 +16,47 @@ source-repository-package plutus-use-cases quickcheck-dynamic web-ghc - tag: 34fe6eeff441166fee0cd0ceba68c1439f0e93d2 + tag: 686b559d34c7bd934b327a1644f31fe42d643492 -- New testing functionality source-repository-package type: git - location: https://github.com/Liqwid-Labs/plutus-extra.git - tag: 4722305495c8c4b03ff06debf0f4a041768a5467 + location: https://github.com/mlabs-haskell/plutus-extra-1.git + tag: a5a8e323062c2a55ef8897d4bd0b1932108b8052 subdir: + plutus-collection + plutus-context-builder + plutus-deriving plutus-extra plutus-golden plutus-laws - plutus-list plutus-numeric plutus-pretty + plutus-size-check quickcheck-plutus-instances tasty-plutus +constraints: + docopt >= 0.7.0.6, + jwt >= 0.11, + +allow-newer: + MissingH:random, + size-based:template-haskell, + plutus-pab-executables:docopt, + plutus-size-check:cardano-api, + tasty-plutus:all, + +source-repository-package + type: git + location: https://github.com/docopt/docopt.hs + tag: bdc4c679bf0185ab6c1895172f011193d9e9922c + +source-repository-package + type: git + location: https://github.com/puffnfresh/haskell-jwt + tag: 4390e2e13ab16ae6d7421c8c49a399e0db80aa22 + -- The following sections are copied from the 'plutus-apps' repository cabal.project at the revision -- given above. -- This is necessary because the plutus' libraries depend on a number of other libraries which are @@ -43,15 +67,6 @@ source-repository-package -- The only sensible test display option test-show-details: streaming -allow-newer: - -- Copied from plutus-core - size-based:template-haskell - , ouroboros-consensus-byron:formatting - , beam-core:aeson - , beam-sqlite:aeson - , beam-sqlite:dlist - , beam-migrate:aeson - -- Copied from plutus-core constraints: -- big breaking change here, inline-r doens't have an upper bound @@ -87,184 +102,179 @@ package cardano-wallet-launcher package cardano-wallet-core-integration optimization: False --- Copied from plutus-core source-repository-package type: git - location: https://github.com/Quid2/flat.git - tag: ee59880f47ab835dbd73bea0847dab7869fc20d8 + location: https://github.com/input-output-hk/iohk-monitoring-framework + tag: 46f994e216a1f8b36fe4669b47b2a7011b0e153c + subdir: + contra-tracer + iohk-monitoring + tracer-transformers + plugins/backend-ekg --- TODO replace with something more sustainable (and maintained) +-- Direct dependency. source-repository-package type: git - location: https://github.com/input-output-hk/purescript-bridge.git - tag: 366fc70b341e2633f3ad0158a577d52e1cd2b138 + location: https://github.com/input-output-hk/plutus + --tag: 3f93f74bc565ec4ed0b1e1e9dbea1b7bb12f6bac + tag: d4f933d25ecc35a9c5bb057f5cf462112129cfdb + --tag: cc72a56eafb02333c96f662581b57504f8f8992f + subdir: + plutus-core + plutus-ledger-api + plutus-tx + plutus-tx-plugin + prettyprinter-configurable + stubs/plutus-ghc-stub + word-array +-- Should follow plutus. source-repository-package type: git - location: https://github.com/input-output-hk/servant-purescript.git - tag: ebea59c7bdfc0338d83fca772b9a57e28560bcde + location: https://github.com/Quid2/flat + tag: ee59880f47ab835dbd73bea0847dab7869fc20d8 --- Copied from plutus-core +-- Direct dependency. source-repository-package type: git - location: https://github.com/input-output-hk/cardano-crypto.git - tag: f73079303f663e028288f9f4a9e08bcca39a923e - --sha256: 1n87i15x54s0cjkh3nsxs4r1x016cdw1fypwmr68936n3xxsjn6q + location: https://github.com/input-output-hk/servant-purescript + tag: 44e7cacf109f84984cd99cd3faf185d161826963 --- Copied from plutus-core +-- Direct dependency. source-repository-package type: git - location: https://github.com/input-output-hk/cardano-base - tag: 654f5b7c76f7cc57900b4ddc664a82fc3b925fb0 - --sha256: 0j4x9zbx5dkww82sqi086h39p456iq5xr476ylmrnpwcpfb4xai4 - subdir: - base-deriving-via - binary - binary/test - cardano-crypto-class - cardano-crypto-praos - cardano-crypto-tests - measures - orphans-deriving-via - slotting - strict-containers + location: https://github.com/input-output-hk/purescript-bridge + tag: 47a1f11825a0f9445e0f98792f79172efef66c00 --- Copied from plutus-core +-- Direct dependency. +-- Compared to others, cardano-wallet doesn't bump dependencies very often. +-- Making it a good place to start when bumping dependencies. +-- As, for example, bumping the node first highly risks breaking API with the wallet. +-- Unless early bug fixes are required, this is fine as the wallet tracks stable releases of the node. +-- And it is indeed nice for plutus-apps to track stable releases of the node too. source-repository-package type: git - location: https://github.com/input-output-hk/cardano-prelude - tag: bb4ed71ba8e587f672d06edf9d2e376f4b055555 - --sha256: 00h10l5mmiza9819p9v5q5749nb9pzgi20vpzpy1d34zmh6gf1cj + location: https://github.com/input-output-hk/cardano-wallet + tag: a5085acbd2670c24251cf8d76a4e83c77a2679ba subdir: - cardano-prelude - cardano-prelude-test + lib/cli + lib/core + lib/core-integration + lib/dbvar + lib/launcher + lib/numeric + lib/shelley + lib/strict-non-empty-containers + lib/test-utils + lib/text-class +-- Should follow cardano-wallet. +-- Currently tracking v1.33.0. source-repository-package type: git - location: https://github.com/input-output-hk/cardano-addresses - tag: d2f86caa085402a953920c6714a0de6a50b655ec + location: https://github.com/input-output-hk/cardano-node + tag: 814df2c146f5d56f8c35a681fe75e85b905aed5d subdir: - core - command-line + cardano-api +-- Should follow cardano-wallet. source-repository-package type: git - location: https://github.com/input-output-hk/cardano-wallet - tag: 760140e238a5fbca61d1b286d7a80ece058dc729 - --sha256: 014njpddrlqm9bbab636h2gf58zkm0bx04i1jsn07vh5j3k0gri6 + location: https://github.com/input-output-hk/cardano-ledger + tag: 1a9ec4ae9e0b09d54e49b2a40c4ead37edadcce5 subdir: - lib/dbvar - lib/text-class - lib/strict-non-empty-containers - lib/core - lib/test-utils - lib/numeric - lib/launcher - lib/core-integration - lib/cli - lib/shelley + eras/alonzo/impl + eras/byron/chain/executable-spec + eras/byron/crypto + eras/byron/crypto/test + eras/byron/ledger/executable-spec + eras/byron/ledger/impl + eras/byron/ledger/impl/test + eras/shelley/impl + eras/shelley/test-suite + eras/shelley-ma/impl + libs/cardano-data + libs/cardano-ledger-core + libs/cardano-ledger-pretty + libs/cardano-protocol-tpraos + libs/compact-map + libs/non-integral + libs/set-algebra + libs/small-steps + libs/small-steps-test +-- Should follow cardano-wallet. source-repository-package type: git location: https://github.com/input-output-hk/ouroboros-network - tag: d613de3d872ec8b4a5da0c98afb443f322dc4dab - --sha256: 0lfbipfdrzay8v1pcazx0qgkda3d1j0505yig9jrml9j7991rmhl + tag: d2d219a86cda42787325bb8c20539a75c2667132 subdir: + io-classes + io-sim monoidal-synchronisation - typed-protocols - typed-protocols-cborg - typed-protocols-examples - ouroboros-network - ouroboros-network-testing - ouroboros-network-framework + network-mux + ntp-client ouroboros-consensus ouroboros-consensus-byron ouroboros-consensus-cardano + ouroboros-consensus-protocol ouroboros-consensus-shelley - io-sim - io-classes - network-mux - ntp-client + ouroboros-network + ouroboros-network-framework + ouroboros-network-testing + strict-stm + typed-protocols + typed-protocols-cborg + typed-protocols-examples +-- Should follow cardano-wallet. source-repository-package type: git - location: https://github.com/input-output-hk/iohk-monitoring-framework - -- Important Note: Read below, before changing this! - tag: 46f994e216a1f8b36fe4669b47b2a7011b0e153c - -- Are you thinking of updating this tag to some other commit? Please - -- ensure that the commit you are about to use is the latest one from - -- the *develop* branch of this repo: - -- * - -- (not master!) - -- - -- In particular we rely on the code from this PR: - -- * - -- being merged. + location: https://github.com/input-output-hk/cardano-base + tag: 41545ba3ac6b3095966316a99883d678b5ab8da8 subdir: - iohk-monitoring - tracer-transformers - contra-tracer - plugins/backend-aggregation - plugins/backend-ekg - plugins/backend-monitoring - plugins/backend-trace-forwarder - plugins/scribe-systemd + base-deriving-via + binary + binary/test + cardano-crypto-class + cardano-crypto-praos + measures + orphans-deriving-via + slotting + strict-containers +-- Should follow cardano-wallet. source-repository-package type: git - location: https://github.com/input-output-hk/cardano-ledger - tag: bf008ce028751cae9fb0b53c3bef20f07c06e333 - --sha256: 0my3801w1vinc0kf5yh9lxl6saqxgwm6ccg0vvzi104pafcwwcqx + location: https://github.com/input-output-hk/cardano-prelude + tag: bb4ed71ba8e587f672d06edf9d2e376f4b055555 subdir: - byron/ledger/impl - cardano-ledger-core - cardano-protocol-tpraos - eras/alonzo/impl - eras/byron/chain/executable-spec - eras/byron/crypto - eras/byron/crypto/test - eras/byron/ledger/executable-spec - eras/byron/ledger/impl/test - eras/shelley/impl - eras/shelley-ma/impl - eras/shelley/chain-and-ledger/executable-spec - eras/shelley/test-suite - shelley/chain-and-ledger/shelley-spec-ledger-test - libs/non-integral - libs/small-steps - libs/cardano-ledger-pretty - semantics/small-steps-test + cardano-prelude + cardano-prelude-test +-- Should follow cardano-wallet. source-repository-package type: git - location: https://github.com/input-output-hk/cardano-node.git - tag: 4f65fb9a27aa7e3a1873ab4211e412af780a3648 - --sha256: 00k9fqrm0gphjji23x0nc9z6bqh8bqrncgivn3mi3csacjzicrrx - subdir: - cardano-api + location: https://github.com/input-output-hk/cardano-crypto + tag: f73079303f663e028288f9f4a9e08bcca39a923e +-- Should follow cardano-wallet. source-repository-package type: git - location: https://github.com/input-output-hk/Win32-network - tag: 3825d3abf75f83f406c1f7161883c438dac7277d + location: https://github.com/input-output-hk/cardano-addresses + tag: 71006f9eb956b0004022e80aadd4ad50d837b621 + subdir: + command-line + core +-- Should follow cardano-wallet. source-repository-package type: git location: https://github.com/input-output-hk/goblins tag: cde90a2b27f79187ca8310b6549331e59595e7ba --- A lot of plutus-apps dependencies have to be syncronized with the dependencies of --- plutus. If you update plutus, please make sure that all dependencies of plutus --- are also updated +-- Should follow cardano-wallet. source-repository-package - type: git - location: https://github.com/input-output-hk/plutus - tag: 65bad0fd53e432974c3c203b1b1999161b6c2dce - subdir: - plutus-ledger-api - word-array - prettyprinter-configurable - stubs/plutus-ghc-stub - plutus-core - plutus-tx - plutus-tx-plugin + type: git + location: https://github.com/input-output-hk/Win32-network + tag: 3825d3abf75f83f406c1f7161883c438dac7277d diff --git a/cabal.project b/cabal.project index a3e4a8a..8433930 100644 --- a/cabal.project +++ b/cabal.project @@ -1,4 +1,4 @@ -index-state: 2021-08-14T00:00:00Z +-- index-state: 2021-08-14T00:00:00Z packages: ./majority-multisign diff --git a/flake.nix b/flake.nix index 4fa47a5..0b6811c 100644 --- a/flake.nix +++ b/flake.nix @@ -73,8 +73,8 @@ additional = ps: [ ps.tasty-plutus ps.quickcheck-plutus-instances + ps.plutus-collection ps.plutus-laws - ps.plutus-list ps.plutus-golden ps.base-deriving-via @@ -136,4 +136,4 @@ apps = perSystem (system: self.flake.${system}.apps); devShell = perSystem (system: self.flake.${system}.devShell); }; -} \ No newline at end of file +} diff --git a/majority-multisign/majority-multisign.cabal b/majority-multisign/majority-multisign.cabal index 8517426..c9e6338 100644 --- a/majority-multisign/majority-multisign.cabal +++ b/majority-multisign/majority-multisign.cabal @@ -68,11 +68,11 @@ library , lens ^>=4.19.2 , openapi3 <3.2 , playground-common + , plutus-collection >=1.0 && <2.2 , plutus-contract , plutus-ledger , plutus-ledger-api , plutus-ledger-constraints - , plutus-list >=1.0 && <2.1 , plutus-numeric , plutus-pab , plutus-tx @@ -102,13 +102,14 @@ test-suite majority-multisign-test , generic-arbitrary ==0.2.* , lens , majority-multisign + , plutus-collection + , plutus-context-builder ^>= 1.0 , plutus-contract , plutus-golden >=1.0 && <3.1 , plutus-laws >=1.0 && <3.1 , plutus-ledger , plutus-ledger-api , plutus-ledger-constraints - , plutus-list , plutus-numeric , plutus-tx , plutus-tx-plugin @@ -117,7 +118,7 @@ test-suite majority-multisign-test , quickcheck-plutus-instances , semigroupoids ^>=5.3 , tasty ^>=1.4.1 - , tasty-plutus >=5.1 && <7.1 + , tasty-plutus ^>=8.0 , tasty-quickcheck ^>=0.10.1.2 , text diff --git a/majority-multisign/test/Spec/Direct.hs b/majority-multisign/test/Spec/Direct.hs index c799b64..77efdaa 100644 --- a/majority-multisign/test/Spec/Direct.hs +++ b/majority-multisign/test/Spec/Direct.hs @@ -30,11 +30,12 @@ import PlutusTx.List.Natural qualified as Natural import PlutusTx.Natural (nat) import Test.QuickCheck (Gen, oneof, shrinkList, sublistOf) import Test.Tasty (TestTree, testGroup) -import Test.Tasty.Plutus.Context ( +import Test.Plutus.ContextBuilder ( ContextBuilder, Purpose (ForSpending), - paysToSelf, + ValidatorUTXO (ValidatorUTXO), signedWith, + validatorOutput, ) import Test.Tasty.Plutus.Script.Property (scriptProperty) import Test.Tasty.Plutus.Script.Size (fitsInto, fitsOnChain, kbytes) @@ -225,11 +226,11 @@ arbitraryTransactionFrom currentSigs newSigs knownSigs = do redeemer <- arbitraryRedeemerFrom newSigs let value = oneshotValue context = - fold1 (pays :| (signedWith . unPaymentPubKeyHash <$> currentSigs)) + fold1 (pays :| (signedWith "signature" . unPaymentPubKeyHash <$> currentSigs)) pays = case PlutusTx.fromData (PlutusTx.toData redeemer) of - Just Schema.UseSignaturesAct -> paysToSelf value datum + Just Schema.UseSignaturesAct -> validatorOutput "payout" (ValidatorUTXO datum value) Just (Schema.UpdateKeysAct keys) -> - paysToSelf value (Schema.MajorityMultiSignDatum keys) + validatorOutput "MMS" (ValidatorUTXO (Schema.MajorityMultiSignDatum keys) value) Nothing -> error "Unexpected redeemer type" pure (datum, redeemer, value, context) @@ -304,8 +305,8 @@ testPartialUse description positive currentSignatories knownSignatories = description (SpendingTest datum Schema.UseSignaturesAct mempty) ( fold1 - ( paysToSelf oneshotValue datum - :| (signedWith . unPaymentPubKeyHash <$> currentSignatories) + ( validatorOutput "MMS" (ValidatorUTXO datum oneshotValue) + :| (signedWith "signature" . unPaymentPubKeyHash <$> currentSignatories) ) ) where @@ -323,8 +324,8 @@ testUpdate description positive currentSignatories newSignatories knownSignatori description (SpendingTest oldDatum (Schema.UpdateKeysAct newSignatories) mempty) ( fold1 - ( paysToSelf oneshotValue newDatum - :| (signedWith . unPaymentPubKeyHash <$> currentSignatories) + ( validatorOutput "MMS" (ValidatorUTXO newDatum oneshotValue) + :| (signedWith "signature" . unPaymentPubKeyHash <$> currentSignatories) ) ) where @@ -336,7 +337,7 @@ testMissingOutputUse description signatories = shouldn'tValidate description (SpendingTest datum Schema.UseSignaturesAct mempty) - (sconcat $ signedWith . unPaymentPubKeyHash <$> signatories) + (sconcat $ signedWith "signature" . unPaymentPubKeyHash <$> signatories) where datum = Schema.MajorityMultiSignDatum (toList signatories) @@ -349,7 +350,7 @@ testMissingOutputUpdate description signatories newSignatories = shouldn'tValidate description (SpendingTest oldDatum (Schema.UpdateKeysAct newSignatories) mempty) - (sconcat $ signedWith . unPaymentPubKeyHash <$> signatories) + (sconcat $ signedWith "signature" . unPaymentPubKeyHash <$> signatories) where oldDatum = Schema.MajorityMultiSignDatum (toList signatories) diff --git a/majority-multisign/test/Spec/Instances.hs b/majority-multisign/test/Spec/Instances.hs index 8fc4417..272a9e8 100644 --- a/majority-multisign/test/Spec/Instances.hs +++ b/majority-multisign/test/Spec/Instances.hs @@ -2,7 +2,6 @@ module Spec.Instances () where -import Ledger (PaymentPubKey (PaymentPubKey), PaymentPubKeyHash (PaymentPubKeyHash)) import MajorityMultiSign.Schema qualified as Schema import Plutus.V1.Ledger.Value (AssetClass, assetClass) import Test.QuickCheck (Arbitrary (arbitrary), Gen, listOf, oneof) @@ -28,8 +27,5 @@ instance Arbitrary Schema.SetSignaturesParams where Schema.SetSignaturesParams <$> arbitrary <*> listOf arbitrary <*> listOf arbitrary -deriving newtype instance Arbitrary PaymentPubKey -deriving newtype instance Arbitrary PaymentPubKeyHash - arbitraryAssetClass :: Gen AssetClass arbitraryAssetClass = assetClass <$> arbitrary <*> arbitrary diff --git a/nix/sources.json b/nix/sources.json index 66149eb..73f0ab0 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -17,10 +17,10 @@ "homepage": "", "owner": "input-output-hk", "repo": "cardano-addresses", - "rev": "d2f86caa085402a953920c6714a0de6a50b655ec", - "sha256": "0p6jbnd7ky2yf7bwb1350k8880py8dgqg39k49q02a6ij4ld01ay", + "rev": "71006f9eb956b0004022e80aadd4ad50d837b621", + "sha256": "11dl3fmq7ry5wdmz8kw07ji8yvrxnrsf7pgilw5q9mi4aqyvnaqk", "type": "tarball", - "url": "https://github.com/input-output-hk/cardano-addresses/archive/d2f86caa085402a953920c6714a0de6a50b655ec.tar.gz", + "url": "https://github.com/input-output-hk/cardano-addresses/archive/71006f9eb956b0004022e80aadd4ad50d837b621.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "cardano-base": { @@ -29,10 +29,10 @@ "homepage": null, "owner": "input-output-hk", "repo": "cardano-base", - "rev": "654f5b7c76f7cc57900b4ddc664a82fc3b925fb0", - "sha256": "0j4x9zbx5dkww82sqi086h39p456iq5xr476ylmrnpwcpfb4xai4", + "rev": "41545ba3ac6b3095966316a99883d678b5ab8da8", + "sha256": "0icq9y3nnl42fz536da84414av36g37894qnyw4rk3qkalksqwir", "type": "tarball", - "url": "https://github.com/input-output-hk/cardano-base/archive/654f5b7c76f7cc57900b4ddc664a82fc3b925fb0.tar.gz", + "url": "https://github.com/input-output-hk/cardano-base/archive/41545ba3ac6b3095966316a99883d678b5ab8da8.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "cardano-crypto": { @@ -47,6 +47,18 @@ "url": "https://github.com/input-output-hk/cardano-crypto/archive/f73079303f663e028288f9f4a9e08bcca39a923e.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, + "cardano-ledger": { + "branch": "master", + "description": "The ledger implementation and specifications of the Cardano blockchain.", + "homepage": "", + "owner": "input-output-hk", + "repo": "cardano-ledger", + "rev": "1a9ec4ae9e0b09d54e49b2a40c4ead37edadcce5", + "sha256": "0avzyiqq0m8njd41ck9kpn992yq676b1az9xs77977h7cf85y4wm", + "type": "tarball", + "url": "https://github.com/input-output-hk/cardano-ledger/archive/1a9ec4ae9e0b09d54e49b2a40c4ead37edadcce5.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + }, "cardano-ledger-specs": { "branch": "master", "description": "A formal specification and executable model of the ledger rules introduced by the Shelley release", @@ -65,10 +77,10 @@ "homepage": "https://cardano.org", "owner": "input-output-hk", "repo": "cardano-node", - "rev": "4f65fb9a27aa7e3a1873ab4211e412af780a3648", - "sha256": "00k9fqrm0gphjji23x0nc9z6bqh8bqrncgivn3mi3csacjzicrrx", + "rev": "814df2c146f5d56f8c35a681fe75e85b905aed5d", + "sha256": "1hr00wqzmcyc3x0kp2hyw78rfmimf6z4zd4vv85b9zv3nqbjgrik", "type": "tarball", - "url": "https://github.com/input-output-hk/cardano-node/archive/4f65fb9a27aa7e3a1873ab4211e412af780a3648.tar.gz", + "url": "https://github.com/input-output-hk/cardano-node/archive/814df2c146f5d56f8c35a681fe75e85b905aed5d.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "cardano-prelude": { @@ -87,12 +99,24 @@ "branch": "master", "description": "HTTP server & command-line for managing UTxOs and HD wallets in Cardano.", "homepage": "", - "owner": "j-mueller", + "owner": "input-output-hk", "repo": "cardano-wallet", - "rev": "760140e238a5fbca61d1b286d7a80ece058dc729", - "sha256": "014njpddrlqm9bbab636h2gf58zkm0bx04i1jsn07vh5j3k0gri6", + "rev": "a5085acbd2670c24251cf8d76a4e83c77a2679ba", + "sha256": "1apzfy7qdgf6l0lb3icqz3rvaq2w3a53xq6wvhqnbfi8i7cacy03", "type": "tarball", - "url": "https://github.com/j-mueller/cardano-wallet/archive/760140e238a5fbca61d1b286d7a80ece058dc729.tar.gz", + "url": "https://github.com/input-output-hk/cardano-wallet/archive/a5085acbd2670c24251cf8d76a4e83c77a2679ba.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + }, + "docopt.hs": { + "branch": "master", + "description": "A command-line interface description language and parser that will make you smile", + "homepage": "http://docopt.org/", + "owner": "docopt", + "repo": "docopt.hs", + "rev": "bdc4c679bf0185ab6c1895172f011193d9e9922c", + "sha256": "1mj4dzgh53f4gliimys0z9y3dlfhkm8ivgkr8wp9nrr8ds3sswcq", + "type": "tarball", + "url": "https://github.com/docopt/docopt.hs/archive/bdc4c679bf0185ab6c1895172f011193d9e9922c.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "flat": { @@ -119,6 +143,18 @@ "url": "https://github.com/input-output-hk/goblins/archive/cde90a2b27f79187ca8310b6549331e59595e7ba.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, + "haskell-jwt": { + "branch": "master", + "description": "JSON Web Token (JWT) decoding and encoding", + "homepage": null, + "owner": "puffnfresh", + "repo": "haskell-jwt", + "rev": "4390e2e13ab16ae6d7421c8c49a399e0db80aa22", + "sha256": "0nx2dckhi28y1g3735xy52s4nhmyam2rc8qlgbba99731xi2h67a", + "type": "tarball", + "url": "https://github.com/puffnfresh/haskell-jwt/archive/4390e2e13ab16ae6d7421c8c49a399e0db80aa22.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + }, "haskell.nix": { "branch": "master", "description": "Alternative Haskell Infrastructure for Nixpkgs", @@ -197,10 +233,10 @@ "homepage": "", "owner": "input-output-hk", "repo": "ouroboros-network", - "rev": "d613de3d872ec8b4a5da0c98afb443f322dc4dab", - "sha256": "0lfbipfdrzay8v1pcazx0qgkda3d1j0505yig9jrml9j7991rmhl", + "rev": "d2d219a86cda42787325bb8c20539a75c2667132", + "sha256": "18xk7r0h2pxrbx76d6flsxifh0a9rz1cj1rjqs1pbs5kdmy8b7kx", "type": "tarball", - "url": "https://github.com/input-output-hk/ouroboros-network/archive/d613de3d872ec8b4a5da0c98afb443f322dc4dab.tar.gz", + "url": "https://github.com/input-output-hk/ouroboros-network/archive/d2d219a86cda42787325bb8c20539a75c2667132.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "plutus": { @@ -209,10 +245,10 @@ "homepage": "", "owner": "input-output-hk", "repo": "plutus", - "rev": "65bad0fd53e432974c3c203b1b1999161b6c2dce", - "sha256": "03x5vsjlbj4favghwrb14n6bkiwpypzjinw94hj7klai3xcj8pyj", + "rev": "d4f933d25ecc35a9c5bb057f5cf462112129cfdb", + "sha256": "1l6r2jlrxgswy9k59x5rapcw2035h1vs563k4vk6a9c4nhid1444", "type": "tarball", - "url": "https://github.com/input-output-hk/plutus/archive/65bad0fd53e432974c3c203b1b1999161b6c2dce.tar.gz", + "url": "https://github.com/input-output-hk/plutus/archive/d4f933d25ecc35a9c5bb057f5cf462112129cfdb.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "plutus-apps": { @@ -221,22 +257,22 @@ "homepage": "", "owner": "input-output-hk", "repo": "plutus-apps", - "rev": "34fe6eeff441166fee0cd0ceba68c1439f0e93d2", - "sha256": "1hs1h1bn86cb752lzswxbwjb0cyw2fayy5g723z3hdk8k91dhhji", + "rev": "686b559d34c7bd934b327a1644f31fe42d643492", + "sha256": "1ignycdl8mqsplmw7blq0m32gzqjwza7m24hy38005vz1lz453va", "type": "tarball", - "url": "https://github.com/input-output-hk/plutus-apps/archive/34fe6eeff441166fee0cd0ceba68c1439f0e93d2.tar.gz", + "url": "https://github.com/input-output-hk/plutus-apps/archive/686b559d34c7bd934b327a1644f31fe42d643492.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "plutus-extra": { - "branch": "master", + "branch": "mario/MalformedScript", "description": "Helper libraries for Plutus.", "homepage": "", - "owner": "Liqwid-Labs", - "repo": "plutus-extra", - "rev": "4722305495c8c4b03ff06debf0f4a041768a5467", - "sha256": "1vxv319fqwrg7qihq1g3vqbdhcp2k13bdss5zcjzhihc0jv7dykh", + "owner": "mlabs-haskell", + "repo": "plutus-extra-1", + "rev": "a5a8e323062c2a55ef8897d4bd0b1932108b8052", + "sha256": "1i2a08gz1ysjd4lhd5qr7gb5wxq6ap3famcnhhp7fzhwgi7viwkm", "type": "tarball", - "url": "https://github.com/Liqwid-Labs/plutus-extra/archive/4722305495c8c4b03ff06debf0f4a041768a5467.tar.gz", + "url": "https://github.com/mlabs-haskell/plutus-extra-1/archive/a5a8e323062c2a55ef8897d4bd0b1932108b8052.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "purescript-bridge": { @@ -245,10 +281,10 @@ "homepage": null, "owner": "input-output-hk", "repo": "purescript-bridge", - "rev": "366fc70b341e2633f3ad0158a577d52e1cd2b138", - "sha256": "18j0rysfccbmfpbw2d1rsjkpd5h84alpsn6b5rwzdxw9h5vqi9m5", + "rev": "47a1f11825a0f9445e0f98792f79172efef66c00", + "sha256": "0da1vn2l6iyfxcjk58qal1l4755v92zi6yppmjmqvxf1gacyf9px", "type": "tarball", - "url": "https://github.com/input-output-hk/purescript-bridge/archive/366fc70b341e2633f3ad0158a577d52e1cd2b138.tar.gz", + "url": "https://github.com/input-output-hk/purescript-bridge/archive/47a1f11825a0f9445e0f98792f79172efef66c00.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "servant-purescript": { @@ -257,10 +293,10 @@ "homepage": null, "owner": "input-output-hk", "repo": "servant-purescript", - "rev": "ebea59c7bdfc0338d83fca772b9a57e28560bcde", - "sha256": "0gjcq4y61kwb4w70pnswn5dp23wd13dac8d9hz84j374cm1kshsn", + "rev": "44e7cacf109f84984cd99cd3faf185d161826963", + "sha256": "10pb0yfp80jhb9ryn65a4rha2lxzsn2vlhcc6xphrrkf4x5lhzqc", "type": "tarball", - "url": "https://github.com/input-output-hk/servant-purescript/archive/ebea59c7bdfc0338d83fca772b9a57e28560bcde.tar.gz", + "url": "https://github.com/input-output-hk/servant-purescript/archive/44e7cacf109f84984cd99cd3faf185d161826963.tar.gz", "url_template": "https://github.com///archive/.tar.gz" } } From 791af8ddaa27482a99657a48ac336caf10840b98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Wed, 2 Mar 2022 09:30:30 -0500 Subject: [PATCH 2/4] Fixed the test failures caused by plutus-extra issue #193 --- majority-multisign/test/Spec/Direct.hs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/majority-multisign/test/Spec/Direct.hs b/majority-multisign/test/Spec/Direct.hs index 77efdaa..3624ca0 100644 --- a/majority-multisign/test/Spec/Direct.hs +++ b/majority-multisign/test/Spec/Direct.hs @@ -12,6 +12,7 @@ import Data.Ratio ((%)) import Data.Semigroup (sconcat) import Data.Semigroup.Foldable.Class (Foldable1 (fold1)) import Data.String (IsString) +import Data.Text qualified as Text import Data.Word (Word8) import Ledger ( PaymentPubKey (PaymentPubKey), @@ -226,7 +227,7 @@ arbitraryTransactionFrom currentSigs newSigs knownSigs = do redeemer <- arbitraryRedeemerFrom newSigs let value = oneshotValue context = - fold1 (pays :| (signedWith "signature" . unPaymentPubKeyHash <$> currentSigs)) + fold1 (pays :| (signedWith' <$> currentSigs)) pays = case PlutusTx.fromData (PlutusTx.toData redeemer) of Just Schema.UseSignaturesAct -> validatorOutput "payout" (ValidatorUTXO datum value) Just (Schema.UpdateKeysAct keys) -> @@ -306,7 +307,7 @@ testPartialUse description positive currentSignatories knownSignatories = (SpendingTest datum Schema.UseSignaturesAct mempty) ( fold1 ( validatorOutput "MMS" (ValidatorUTXO datum oneshotValue) - :| (signedWith "signature" . unPaymentPubKeyHash <$> currentSignatories) + :| (signedWith' <$> currentSignatories) ) ) where @@ -325,7 +326,7 @@ testUpdate description positive currentSignatories newSignatories knownSignatori (SpendingTest oldDatum (Schema.UpdateKeysAct newSignatories) mempty) ( fold1 ( validatorOutput "MMS" (ValidatorUTXO newDatum oneshotValue) - :| (signedWith "signature" . unPaymentPubKeyHash <$> currentSignatories) + :| (signedWith' <$> currentSignatories) ) ) where @@ -337,7 +338,7 @@ testMissingOutputUse description signatories = shouldn'tValidate description (SpendingTest datum Schema.UseSignaturesAct mempty) - (sconcat $ signedWith "signature" . unPaymentPubKeyHash <$> signatories) + (sconcat $ signedWith' <$> signatories) where datum = Schema.MajorityMultiSignDatum (toList signatories) @@ -350,7 +351,7 @@ testMissingOutputUpdate description signatories newSignatories = shouldn'tValidate description (SpendingTest oldDatum (Schema.UpdateKeysAct newSignatories) mempty) - (sconcat $ signedWith "signature" . unPaymentPubKeyHash <$> signatories) + (sconcat $ signedWith' <$> signatories) where oldDatum = Schema.MajorityMultiSignDatum (toList signatories) @@ -420,3 +421,9 @@ oneshotAsset = assetClass oneshotCS multiSignTokenName oneshotValue :: Value oneshotValue = assetClassValue oneshotAsset 1 + +signedWith' :: PaymentPubKeyHash -> ContextBuilder p +signedWith' ppkh = signedWith name pkh + where + pkh = unPaymentPubKeyHash ppkh + name = Text.pack (show pkh) From 59345cc8d87c68c5739d86486d7e379934f6d9db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Wed, 2 Mar 2022 13:05:56 -0500 Subject: [PATCH 3/4] Formatting --- majority-multisign/test/Spec/Direct.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/majority-multisign/test/Spec/Direct.hs b/majority-multisign/test/Spec/Direct.hs index 3624ca0..a6a9117 100644 --- a/majority-multisign/test/Spec/Direct.hs +++ b/majority-multisign/test/Spec/Direct.hs @@ -29,8 +29,6 @@ import Plutus.V1.Ledger.Value (AssetClass, Value, assetClass, assetClassValue) import PlutusTx qualified import PlutusTx.List.Natural qualified as Natural import PlutusTx.Natural (nat) -import Test.QuickCheck (Gen, oneof, shrinkList, sublistOf) -import Test.Tasty (TestTree, testGroup) import Test.Plutus.ContextBuilder ( ContextBuilder, Purpose (ForSpending), @@ -38,6 +36,8 @@ import Test.Plutus.ContextBuilder ( signedWith, validatorOutput, ) +import Test.QuickCheck (Gen, oneof, shrinkList, sublistOf) +import Test.Tasty (TestTree, testGroup) import Test.Tasty.Plutus.Script.Property (scriptProperty) import Test.Tasty.Plutus.Script.Size (fitsInto, fitsOnChain, kbytes) import Test.Tasty.Plutus.Script.Unit ( From ad7b07f454e1031e8a515c1fdc8fac5b70b2918c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Bla=C5=BEevi=C4=87?= Date: Fri, 4 Mar 2022 08:54:02 -0500 Subject: [PATCH 4/4] Revert the index-state --- cabal.project | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cabal.project b/cabal.project index 8433930..a3e4a8a 100644 --- a/cabal.project +++ b/cabal.project @@ -1,4 +1,4 @@ --- index-state: 2021-08-14T00:00:00Z +index-state: 2021-08-14T00:00:00Z packages: ./majority-multisign