1. 29 Oct, 2020 3 commits
    • Diogo Castro's avatar
      [#346] Added `checkStorage'` to read storages with big_maps · 690236c3
      Diogo Castro authored
      Problem: In Morley.Nettest, the only way to check a contract's storage
      is to use `checkStorage`. However, this function can only retrieve
      storages if they don't contain big_maps (due to a limitation in the
      Tezos RPC).
      Solution: In the future, we'll want to come up with a more permanent
      solution that works on both the emulator and a real network. But, for
      now, we added a `checkStorage'` function that works only on the emulator
      and is able to retrieve any storage.
    • Alyona Antonova's avatar
      [#319] Add test checking division with zero modulo in `divMich` · 2636465f
      Alyona Antonova authored
      Problem: There is no test for checking the correctness
      of integer division `divMich a b` when `mod a b == 0`.
      We need to check it because it's kind of an exception case
      for `divMich`.
      Solution: Add such a test to `test_EDIV` in `morley-test`.
    • Alyona Antonova's avatar
      [#319] Fix `divMich` function · 18a9b367
      Alyona Antonova authored
      Problem: `divMich` function from `Michelson.Typed.Polymorphic`
      processes the case of division with zero modulo incorrectly.
      Solution: Handle the case of `divMich a b` when `mod a b == 0`.
  2. 27 Oct, 2020 11 commits
    • Diogo Castro's avatar
      [#351] [#53] Add `getNow` and `advanceTime` to Morley.Nettest · de14dbaa
      Diogo Castro authored
      Problem: sometimes, we might want to test scenarios where we need to
      advance time by some given number of seconds.
      We've needed this in stablecoin and tezos-nbit before, and we're seeing
      the need for this again in BaseDAO.
      Additionally, in tezos-nbit we've also needed to know what the current
      time is. In `Integrational`, we can just use `dummyNow`, but there's no
      way to do this in Morley.Nettest at the moment.
      Solution: Add `getNow` and `advanceTime` to Morley.Nettest.
    • Ivan Gromakovskii's avatar
      morley-1.8.1 · 7f55100f
      Ivan Gromakovskii authored
      Problem: we also need a new version of morley because it has some
      instances used by latest cleveland.
      Older cleveland doesn't work with latest lorentz.
      Solution: bump morley version to 1.8.1.
    • Ivan Gromakovskii's avatar
      indigo-0.3.1 · d0ba0ed6
      Ivan Gromakovskii authored
      Problem: we need to release a new indigo version compatible with
      latest lorentz where `UStore` stuff was removed.
      Solution: update its version, record changes in the changelog.
    • Ivan Gromakovskii's avatar
      Rename U* constructors of Expr to St* · c71405c3
      Ivan Gromakovskii authored
      Problem: in indigo, things like `uUpdate` were renamed to `stUpdate`
      recently, however, the corresponding constructors were not renamed,
      so now naming is inconsistent and a bit confusing.
      Solution: rename constructors accordingly.
    • Roman Melnikov's avatar
      [#352] Explicitly define bin-path for indigo · fae7496f
      Roman Melnikov authored
      Problem: Currently `stack install` installs executables to
      `$HOME/.local/bin` and we use this fact in our tests. However,
      default location can be changed one day.
      Solution: Explicitly use default location via `--local-bin-path` option.
    • Roman Melnikov's avatar
      [#352] Install indigo via install.sh and test it · 5409683c
      Roman Melnikov authored
      Problem: We have an installation script for indigo that needs
      to be tested.
      Solution: Use `install.sh` script in the nearly bare ubuntu docker image
      to test that it correctly installs indigo with all its dependencies.
      Also run simple scenario that incorporates 'indigo' calls using newly
      script-based install indigo binary.
    • Konstantin Ivanov's avatar
      Make Lorentz release · 740bc12e
      Konstantin Ivanov authored
      Problem: there were quite a lot of breaking changes recently, it would
      be nice to make a release at this point.
      Solution: make it.
    • Konstantin Ivanov's avatar
      Fix other mentions of UStore · 810a2d04
      Konstantin Ivanov authored
      Problem: we are still mentions of 'UStore' in documentation, we should
      do something with them.
      Solution: fix accordingly.
    • Konstantin Ivanov's avatar
      Remove all UStore modules · ec2820e4
      Konstantin Ivanov authored
      Problem: `UStore` is saner to be defined in `morley-upgradeable`
      repository, since it is only usable in upgradeable contracts.
      Solution: remove everything here (and add there).
    • Konstantin Ivanov's avatar
      Remove UStore usages in indigo · c9eb8f4d
      Konstantin Ivanov authored
      Problem: indigo uses `UStore` in its operations, but `UStore` is going
      to be moved to another repository.
      Solution: be polymorphic over storage via using `StoreClass` module.
      Also replace `UStore` usages in tests with some simple storage
      containing `Map` (not `BigMap` for simplicity).
    • Roman Melnikov's avatar
      [#389] Fix haddock in the repo · 9f9a53ae
      Roman Melnikov authored
  3. 26 Oct, 2020 3 commits
    • Diogo Castro's avatar
      Renamed `--node-url` to `--node-addr` in morley-client · ad2e29d7
      Diogo Castro authored
      Problem: `--node-url` is a bit of a misnomer, since it only
      represents the node's host address, whereas a URL is supposed to also
      contain the protocol/port/etc.
      Solution: rename `url` to `addr`. This way, it also matches the naming
      in tezos-client.
      > -A --addr <IP addr|host>: IP address of the node
    • Diogo Castro's avatar
      Renamed `--nettest-node-url` to `--nettest-node-addr` in Morley.Nettest · c81872e6
      Diogo Castro authored
      Problem: `--nettest-node-url` is a bit of a misnomer, since it only
      represents the node's host address, whereas a URL is supposed to also
      contain the protocol/port/etc.
      Solution: rename `url` to `addr`. This way, it also matches the naming
      in tezos-client.
      > -A --addr <IP addr|host>: IP address of the node
    • Moremi Vannak's avatar
      [#349] Remove the usage of mixin from Indigo CLI's generated boilerplate · 7c670dd4
      Moremi Vannak authored
      Problem: Since `indigo` CLI calls `stack` behind the scene, the usage of
      mixin in `indigo` CLI causes a lot of issue due the fact that `stack`
      does not work well with mixin currently.
      Solution: Remove the usage of `mixin` from the generated boilerplate,
      replace `morley-prelude` with `universum` and update docker script to
      ensure that the REPL command of docker indigo works properly.
  4. 24 Oct, 2020 7 commits
    • Diogo Castro's avatar
      [#365] Added `nettestIngredients` · 40084716
      Diogo Castro authored
      Problem: If a test suite uses `nettestScenario`/`nettestScenarioCaps`,
      the relevant command line options will be automatically added to tasty's
      However, if a test suite intends to not use those functions, and use
      `withNettestEnv` only, then the CLI options need to be registered
      manually using an ingredient.
      Solution: add `nettestIngredients`, and change
      `nettestMain`/`nettestMainWithIngredients` to include this ingredient.
    • Diogo Castro's avatar
      [#365] Deprecate unnecessary functions · 44b39c78
      Diogo Castro authored
      Problem: Now that we can use nettests within Tasty tests suites, we
      should identify and deprecate functions we no longer need.
      * We should no longer need the `NettestConfig` data type
      * I think hspec integration `nettestTestExpectation` can be removed
        completely, for these reasons:
          * It was only being used in `morley-test`
          * It had limited use: it only worked for pure tests, not network
          * We're not too keen on using hspec anyway
      * Clean up the re-exports from the Morley.Nettest module
    • Diogo Castro's avatar
      [#365] Refactored nettests in `morley-test` to use the Tasty interface · 3957c613
      Diogo Castro authored
      Problem: now that we can integrate nettest with tasty, we should use it
      for our existing nettests
      Solution: refactor nettests in `morley-test` to use the Tasty interface
    • Diogo Castro's avatar
      [#365] Refactored nettests in `cleveland-nettest` to use the Tasty interface · f2978313
      Diogo Castro authored
      Problem: now that we can integrate nettest with tasty, we should use it
      for our existing nettests
      Solution: convert the existing `cleveland-nettest` test suite to use
    • Diogo Castro's avatar
      [#365] Added module for integrating Nettest with Tasty · 2fc0bd3b
      Diogo Castro authored
      Problem: we have no good way of structuring our nettests. As a result,
      we have to resort to `comment` to indicate which tests succeeded/failed,
      and the output is all jumbled together and hard to understand/parse.
      Furthermore, when one test fails, the whole suite aborts without
      executing the remaining tests.
      Solution: integrate Morley.Nettest with Tasty. This way, we get all the
      benefits that come with using Tasty:
        * structured tests and output
        * skipping/running only a few tests using `--patern`
        * run all tests and report those that failed
        * ability to have hunit/hspec/hedgehog + nettests all in the same
    • Diogo Castro's avatar
      [#365] Modify `MonadEmulated` to imply `MonadNettest` · 76eec154
      Diogo Castro authored
      Problem: when using Nettest's caps interface, if we want to write a test
      that can only be run on the emulator, its type must be:
      test :: (MonadNettest caps base m, MonadEmulated caps base m) => m ()
      Having to specify both constraints is a burden. Besides, I can't think
      of a scenario where you'd need the `EmulatedImpl` capability but not
      need the `NettestImpl`.
      Solution: modify the `MonadEmulated` constraint so that it implies the
      `MonadNettest` constraint This way, a test that can only be run on the
      emulator is typed as:
      test :: MonadEmulator caps base m => m ()
      And a test that can be run on the emulator and on a real network is
      typed as:
      test :: MonadNettest caps base m => m ()
    • Ivan Gromakovskii's avatar
      Prepare morley-1.8.0 · 9f08c2b4
      Ivan Gromakovskii authored
      Problem: recetly we removed all QuickCheck-related stuff from morley,
      so we want to make a new release to use a smaller morley in some
      Solution: since there are braking changes (e. g. this removal), we
      update the version to 1.8.0.
  5. 22 Oct, 2020 4 commits
  6. 21 Oct, 2020 3 commits
    • Roman Melnikov's avatar
      [#349] Strip useless stack cache parts · 892b1179
      Roman Melnikov authored
      Problem: We want to make resulting indigo image as small as possible.
      Solution: Remove some useless files and directories from /root/.stack
      that don't affect compilation time.
    • Roman Melnikov's avatar
      [#349] Move indigo dockerfiles and reuse contents · fe5c47c0
      Roman Melnikov authored
      Problem: Currently indigo related dockerfiles are located in the
      repository root. Also, they're very similar.
      Solution: Move them to `code/indigo` and base image for trial usage
      on the image that is used for indigo binary testing.
    • Roman Melnikov's avatar
      [#349] Use `--allow-different-user` in docker · d3ce53ad
      Roman Melnikov authored
      Problem: There is a different root user inside the docker container
      that builds indigo project, so it's required to use
      `--allow-different-user` stack flag when running indigo commands
      inside the container.
      Solution: Use `--allow-different-user` stack flag when
      `INDIGO_IN_DOCKER` env variable is set.
  7. 20 Oct, 2020 7 commits
    • Ilya Peresadin's avatar
      [#338] Update README, add logo. · e652682b
      Ilya Peresadin authored
      Problem: we need to update README with new information, also logo would be great.
      Solution: add sections how to build from scratch and download from the CI to README.
      Add plugin logo, which is using free bug image, so proper license is added too.
    • Ilya Peresadin's avatar
      [#338] Clean up configurations from .vscode/launch.json · ef6ecd59
      Ilya Peresadin authored
      Problem: the plugin extension is javascript code which is being launched by VS Code.
      This plugin can be launched and debugged itself by VSCode.
      Hence, in this case, the debuggee will be 'morley-debugger-vscode/src/extension.ts'
      (or, more precisely, .js file generate from the .ts file).
      As it can be run, there is 'morley-debugger-vscode/.vscode' folder that describes
      some details of launch configuration, particularly, there is 'launch.json'
      that declares different configurations (like to run this extensions as debugge,
      or to run 'debugAdapter.ts' as debuggee).
      Some configuration optios are just copy-pasted
      from the VS code debugger tutorial and are not actual for our plugin
      (we don't have debugger adapter in a .js but as a separate Haskell executable).
      Solution: remove 'Server' configuration, 'Mock' configuration, and compound 'Extension + Server'.
      So there will be only 'Extension' and 'Tests' left, 'Tests' doesn't run anything now, but if at some day
      we will have tests for extension.ts, it will.
    • Ilya Peresadin's avatar
      [#338] Spawn static binary from VS plugin extension. Change debugger configuration a bit · b4b7508b
      Ilya Peresadin authored
      Problem: we are passing path to the debugger adapter in 'launch.json' for now.
      It's not way to go when we build VS plugin.
      Solution: pass a path to 'bin/morley-debugger-adapter', which is bundled
      with the plugin. The another related tasks which have been done here:
      * Remove 'morley_dap_exe' parameter from 'lauch.json'
      * Add 'logDir' argument to 'launch.json', which is not specified by default
        and logs go into default VSCode dir. If you are developing some feature it's better
        to specify 'logDir' to have logs somewhere nearby.
      * Add Baking Bad Michelson plugin as a dependency to 'extensionDependencies' list
    • Roman Melnikov's avatar
      [#338] Build 'morley-debug-*.vsix' via nix · 34c04b6b
      Roman Melnikov authored
      Problem: We want to distribute our debugger plugin one day.
      For this we need a way to create '.vsix' file.
      Solution: Build code in 'code/morley-debugger/morley-debugger-vscode/'
      via yarn providing static morley-debug-adapter binary for it.
    • Konstantin Ivanov's avatar
      Improve error messages · e8a6ee10
      Konstantin Ivanov authored
      Problem: `withWTPm` and `unsafeWithTWP` provide slightly different
      errors messages despite they are about the same thing; `unsafeWithTWP`
      calls the subtype that turned to be non-comparable as not well-typed and
      that is not precise.
      Also, these error messages contain `show`n `T` which is not good.
      Solution: add a Buildable instance for `NotWellTyped` error, reuse it.
      Also use `pretty` on `T` within `NotWellTyped`.
    • Konstantin Ivanov's avatar
      [#381] Slightly refactor `genValue` · 9aed7976
      Konstantin Ivanov authored
      Problem: reading all these `(_ :: Sing l)` is a bit uncomfortable.
      Solution: carry a value of `Sing t` type instead of passing everything
      at type-level.
    • Konstantin Ivanov's avatar
      [#381] Improve WellTyped instances · 4121bd57
      Konstantin Ivanov authored
      Problem: with the current definition of `WellTyped` we, for instance,
      cannot figure out that `WellTyped ('TOption t)` ensures that `WellTyped
      t` holds. So in Hedgehog generator for `Value` (`genValue`) we couldn't
      use this knowledge and used `discard`s for impossible cases.
      Solution: GHC does not provide us with bi-directional instances, so we
      have to bring them ourselves.
      For that we tell a type family to `WellTyped` which designates the
      desired constraint of an instance, and added this type family to
      superclass constaints of `WellTyped`. This solution turned to be
      boilerplat-y at the side of `WellTyped` definition, but requires no
      boilerlate at the side of the user.
      Comparison with other solutions:
      Note that our issue with WellTyped didn't exist for `HasNoOp` and other
      constraints from `Scope.hs` because we defined them not as a typeclass +
      instances for all known types, but rather we used a type family to
      evaluate whether type satisfies the predicate or not. But we payed for
      that with
      * unpleasant errors (like `'True ~ 'False does not hold`);
      * mirroring constraints in eDLS (`NiceParameter` and others);
      * conversions between native and eDSL's
        constraints (`niceParameterEvi`);
      * other boilerplate at term-level (`HasNoOp t1` cannot be automatically
        deduced from `HasNoOp ('TPair t1 t2)`, and we have to prove this to
        the compiler in `Michelson.Interpreter.Unpack` and many other places).
      Probably it's a sign that we have to rewrite constraints from `Scope.hs`
      to use the same approach as with `WellTyped`.
  8. 19 Oct, 2020 2 commits
    • Ivan Gromakovskii's avatar
      [#394] Update documentation · 507670cb
      Ivan Gromakovskii authored
      Problem: after we dropped QuickCheck entirely the documentation in
      Michelson.Test is no longer accurate.
      Solution: update testing framework listed their to match current code,
      expand that documentation a bit.
    • Ivan Gromakovskii's avatar
      [#394] Remove arbitrary instances from lorentz · 177b4b13
      Ivan Gromakovskii authored
      Problem: we've just removed Arbitrary instances from morley.
      There are still a couple of instances in lorentz that we want
      to remove for the same reasons.
      Solution: remove those instances and QuickCheck dependency.