aleeusgr / plutus-tests

fixing plutus starter
Apache License 2.0
1 stars 1 forks source link

gimbalabs: build test via plutus-starter #3

Closed aleeusgr closed 1 year ago

aleeusgr commented 1 year ago

think there exists V2 version of
https://gitlab.com/gimbalabs/plutus-pbl-summer-2022/plutus-always-succeeds

Therefore I should add plutus-always-succeds and see if it works.
its tag is specified to be v2022-04-06

to test:

nix-shell$ cd /always-succeeds

# this may take a while the first time
cabal update
cabal repl 

Prelude MyFirstPlutusCompiler>

Right()
aleeusgr commented 1 year ago
cabal: Could not resolve dependencies:
[__0] trying: plutus-starter-0.1.0.0 (user goal)
[__1] unknown package: serialize (dependency of plutus-starter)
[__1] fail (backjumping, conflict set: plutus-starter, serialize)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: plutus-starter, serialize

error: attribute 'shellFor' missing

its serialise

aleeusgr commented 1 year ago
src/MyFirstPlutusCompiler.hs:30:31: error:
    Not in scope: type constructor or class ‘Ledger.Validator’
    Perhaps you meant one of these:
      ‘Ledger.Validation’ (imported from Ledger),
      ‘Ledger.ValidatorMode’ (imported from Ledger)
    Module ‘Ledger’ does not export ‘Validator’.
   |
30 | writeValidator :: FilePath -> Ledger.Validator -> IO (Either (FileError ()) ())
   |                               ^^^^^^^^^^^^^^^^

src/MyFirstPlutusCompiler.hs:31:157: error:
    Not in scope: ‘Ledger.unValidatorScript’
    Perhaps you meant data constructor ‘Ledger.ValidatorScript’ (imported from Ledger)
    Module ‘Ledger’ does not export ‘unValidatorScript’.
   |
31 | writeValidator file = writeFileTextEnvelope @(PlutusScript PlutusScriptV1) file Nothing . PlutusScriptSerialised . SBS.toShort . LBS.toStrict . serialise . Ledger.unValidatorScript
aleeusgr commented 1 year ago

Hm, there could be an alternative; does plutus-apps not have examples of v2 contracts?

https://github.com/input-output-hk/plutus-apps/tree/main/plutus-example/src/PlutusExample/PlutusVersion2

TODO: formulate tests;

aleeusgr commented 1 year ago
error: attribute 'v2022-04-06' missing

       at /nix/store/dv269kw7fp6y81n0k20w9s4a05s2z4f7-source/lib/cabal-project-parser.nix:82:14:

           81|       if sha256map != null
           82|         then sha256map."${repo.location}"."${repo.tag}"
             |              ^
           83|         else null);
(use '--show-trace' to show detailed location information)
aleeusgr commented 1 year ago

find the map and change the hash;

https://input-output-hk.github.io/haskell.nix/tutorials/source-repository-hashes.html

Is there any tooling to do that?