1. 19 Jun, 2020 10 commits
    • Pinto Pasquale's avatar
      [TM-410] make Indigo's tutorial a buildable website · 9f3d3d66
      Pinto Pasquale authored
      Problem: we can use the existing tutorial to make a static website
      for Indigo using mkdocs.
      This needs changed in the documentation's content, namely:
      - we would like to statically include part of the example modules
      - there needs to be an index/home page
      - the appendices should be moved to be "reference" pages
      - the explanations should not be flat, but include note blocks, etc.
      - references to local files need to be removed, as they don't work
      Solution: Make a buildable website with:
      - configuration for mkdocs and its extension
      - CSS for customized styling
      - a python-markdown extension for example source code inclusion
    • Pinto Pasquale's avatar
      [TM-410] re-arrange indigo tutorial's files for website building · 1145fb98
      Pinto Pasquale authored
      Problem: A website for Indigo needs to be built from its current
      tutorial, however the tree structure is not ideal, in particular:
      - markdown files for the chapters are organized alonside the source
        code for the examples
      - the example modules are tied to the documentation structure
      These constitute a problem because we want the documentation's file
      tree structure to be independent from the examples and vice-versa.
      Solution: move the markdown files in a flat new directory and move
      the example modules in a topic-based tree structure.
    • Pinto Pasquale's avatar
      [#163] refactor typeCheckValImpl · 3a6e6965
      Pinto Pasquale authored
      Problem: `typeCheckValImpl` now has an additional parameter to carry
      around and pass recursively, this could be avoided by using another
      function that has it in its closure.
      Solution: put the logic of `typeCheckValImpl` in a separate
      `doTypeCheckVal` function and move the other functions part of the
      recursive calls as well.
    • Pinto Pasquale's avatar
      [#163] use typeCheck/Verify functions for Storage and Parameter · 359c44de
      Pinto Pasquale authored
      Problem: now that there are functions to typeCheck/Verify parameters
      exclusively the ones for "TopLevelValue" are only used for storage
      Solution: rename typeCheck/Verify functions for "TopLevelValue" to
      "Storage" and make common (un-exported) ones.
    • Pinto Pasquale's avatar
      [#163] remove unnecessary TcOriginatedContracts usages · b44f38ca
      Pinto Pasquale authored
      Problem: `TcOriginatedContracts` is used to typecheck a value of type
      `contract p`. After the Babylon update this can only happen in a parameter.
      However, we store `tcContracts` in `TypeCheckEnv` and often blindly pass
      `mempty` or set it to `error`.
      Solution: remove `tcContracts` from `TypeCheckEnv` and use
      `TcOriginatedContracts` only for typeCheck functions that needs it.
      `typeCheckParameter` has been added for this purpose.
      Additionally, unnecesary type-checking functions based on it have
      been removed.
    • Ivan Gromakovskii's avatar
      Override indigo's homepage · 99c0d9ab
      Ivan Gromakovskii authored
      Problem: indigo's homepage (stated in `indigo.cabal`) is
      the `morley` repo, but now we have a dedicated website which is
      more appropriate.
      Solution: override it in `package.yaml`. It complains about duplicated
      field, but handles it correctly, so I hope it's fine (better than
      copy-pasting or doing some verbose tricks).
    • Ivan Gromakovskii's avatar
      Remove unused dependences · 85fca464
      Ivan Gromakovskii authored
      Problem: `ghc-prim` seems to be unused by our packages, but
      is listed in dependencies.
      Solution: remove it.
    • Ivan Gromakovskii's avatar
      Add Hackage badge to lorentz · ef6cb4ab
      Ivan Gromakovskii authored
    • Ivan Gromakovskii's avatar
      [Chore] Prepare indigo release · 3e39afc9
      Ivan Gromakovskii authored
      Problem: we want to release indigo to Hackage to make it more
      Solution: prepare for that by adding a changelog and Hackage badge.
    • Sandeep.C.R's avatar
      [#242] Add better error for missing tezos-client program · fd69ab86
      Sandeep.C.R authored
      Problem: Right now the error message that is  printed when
      `tezos-client` program is missing from PATH, is not very helpful. It is
      also harder to spot in a large test log.
      Solution: Catch the error that is being thrown when `tezos-client`
      program is missing, and output a helpful message. Also, color the
      terminal output so that it could be easily noticed.
  2. 16 Jun, 2020 9 commits
    • Anton Myasnikov's avatar
      [#158] Remove deprecated Lorentz.Store module · fc3cf14a
      Anton Myasnikov authored
      Problem: We have deprecated `Lorentz.Store` module that needs to
      be removed in favor of `Lorentz.UStore`. Also we have unused
      `template-haskell` package in lorentz dependencies.
      Solution: Remove `Lorentz.Store` and update `Lorentz.UStore`
      comment. And remove `template-haskell` from lorent dependencies.
    • Anton Myasnikov's avatar
      [#158] Remove deprecated custom error functionality · a58d59bd
      Anton Myasnikov authored
      Problem: In `Lorentz.Errors` we have old interface for custom
      error values that needs to be removed.
      Solution: Remove old interface from `Lorentz.Errors` and its
      consequent test.
    • Moremi Vannak's avatar
      [#7] Rename `PairStruct` to `UnpairStruct` and use different `PairStruct` for PAPAIR · f8622e87
      Moremi Vannak authored
      Problem:  `PAPAIR` and `UNPAIR` use the same structure (called `PairStruct`),
      but current structure is correct only for `UNPAIR`, because `UNPAIR` can
      produce multiple items on stack and hence can have multiple variable
      annotations, while `PAPAIR` can't.
      So `VarAnn`s inside `PairStruct` inside `PAPAIR` are always ignored.
      Solution: Rename current `PairStruct` to `UnpairStruct` and use different
      `PairStruct` which exactly captures set of all possible `PAPAIR`s.
    • Roman Melnikov's avatar
      [#139] Calculate fee using tezos-client · 50e38704
      Roman Melnikov authored
      Problem: Currently fee is calculated using `calcFee` from
      `Morley.Client.Action.Common`, this function has logic which is
      different from the reference implementation, moreover, reference fee
      calculation is quite complex.
      Solution: Calculate fee for transfers and origination using dry-run
      calls in tezos-client.
    • Roman Melnikov's avatar
      [#139] Add transaction preapply · b24fbb38
      Roman Melnikov authored
      Problem: After estimating fee, gas and storage limit transaction can
      still fail due to invalid estimation, however, currently morley-client
      will try to inject such operation and it can appear in the block
      explorer in the backtracked state, which is not very useful.
      Solution: Add preapply call to the transaction, thus we check whether
      estimated values are sufficient before injecting operation to the chain.
    • Roman Melnikov's avatar
      [#139] Add tests for contract allocation · 564c9a01
      Roman Melnikov authored
      Motivation: Add simple scenario with contract that performs transfers to
      10 new addresses.
    • Roman Melnikov's avatar
      [#139] Pure and real-chain nettest in one suite · 9f2146ab
      Roman Melnikov authored
      Problem: Currently, `morley-nettest` has two test-suites, one runs pure
      nettest scenario, the other runs them on real chain. It doesn't make
      much sense to have two test-suites.
      Solution: Run both pure and real chain nettest scenarios in
      `morley-nettest-nettest` test-suite and remove the other.
    • Roman Melnikov's avatar
      [#139] Use intial balance during origination · c9900fd9
      Roman Melnikov authored
      Problem: Initial balance is unused in morley-client origination, thus
      contract is always originated with zero balance.
      Solution: Use initial balance.
    • Roman Melnikov's avatar
      [#139] Fix storage size computation · 9e10b225
      Roman Melnikov authored
      Problem: When we originate new contract or perform transfer to the
      implicit contract which is unknown for the chain, it's required to add
      257 bytes for each new address. However, we don't do such thing, thus
      some of our nettest scenarios fails.
      Solution: Unconditionally add 257 bytes to storage limit for contract
      origination. `run_operation` RPC output for transaction has
      `allocated_destination_contract` field that states whether contract
      receiver was allocated. So in order to correctly calculate storage limit
      for transaction, we simply count all newly allocated contract and add
      257 bytes to storage limit for each.
  3. 15 Jun, 2020 3 commits
  4. 14 Jun, 2020 1 commit
    • Maxim Koltsov's avatar
      [TM-151] Include location into typecheck errors · 99eaeb6e
      Maxim Koltsov authored
      Problem: we keep track of source code locations and let-bindings stacks,
      but this information is not reported in the typecheck error messages.
      Solution: include location and let-stack information.
  5. 12 Jun, 2020 5 commits
    • Diogo Castro's avatar
      Renamed `upperBoundMicroseconds` to `upperBound` · b43f150a
      Diogo Castro authored
      Problem: In commit 37b05c73, when I
      first started implementing `meanTimerUpperBound(NF)`, it took
      `upperBoundMicroseconds :: Int` as a parameter. In a later revision, I
      changed this from `Int` to `Time unit`, but forgot to rename the
      parameters accordingly.
      Solution: Rename `upperBoundMicroseconds` to `upperBound`
    • Diogo Castro's avatar
      [#210] Refactor integrational testing engine and its interface · 8cb57eab
      Diogo Castro authored
      Problem: The way the testing engine works (keep going even a contract
      interpretation error occurs, use Either+Validated to check the engine
      state) is in stark contrast with the standard way of writing testing
      frameworks in Haskell (errors are thrown in MonadError/MonadThrow,
      execution stops unless caught with catchError/catch). Over time this has
      proven to be an inconvenience.
      * Removed Validated, IntegrationalValidator, SuccessValidator.
      * Removed expectAnySuccess
      * Make use of MonadError to signal/inspect contract interpretation
      * For simplification, `validate` was removed from the public interface
    • Moremi Vannak's avatar
      [#237] Remove equality constraint in `assertRight` and `assertLeft` · e03e69de
      Moremi Vannak authored
      Problem: `assertRight` and `assertLeft` has type equal constraint on
      left and right even though there are not necessarily equal.
      Solution: Remove the type equal constraint.
    • Moremi Vannak's avatar
      [#237] Include `KnownValue` into `IsExpr` · 453095e5
      Moremi Vannak authored
      Problem: There seems to be no case of `IsExpr ex a` where
      `KnownValue a`  constitutes a problem, however we are
      required add the latter every time we use the former
      (where a is generic).
      Solution:  Include `KnownValue a` into `IsExpr ex a`
      and remove unnecessary use of `KnownValue`.
    • Anton Myasnikov's avatar
      [#211] Remove unused aliases from Michelson.Untyped.Type · 467b99ab
      Anton Myasnikov authored
      Problem: We have some unused aliases for `T` constructors such as
      `tint` that should be removed.
      Solution: Remove them.
  6. 10 Jun, 2020 4 commits
    • Maxim Koltsov's avatar
      [#243] Nicer REPL for morley-debugger · 0e22bdd5
      Maxim Koltsov authored
      Problem: morley-debugger reads command line-by-line, without any prompts
      or feedback. Therefore it seems that it hangs after each command, since
      there is no visual reaction that the command was processed.
      Solution: add a "morley> " prompt to repl. Also handle EOF (Ctrl-D) as
      graceful exit.
    • Moremi Vannak's avatar
      [#193] Remove tezos-bake-monitor-lib dependency · 249bedf3
      Moremi Vannak authored
      Problem: We use `tezos-bake-monitor-lib` to implement conversion
      between `Value` to `JSON` by binary round trip. Since we already
      have `Value` to binary, `tezos-bake-monitor-lib` allow us to convert
      binary to `Expression` then to `JSON`.
      However, this dependency has a few problem include: not quite stable and
      not on Hackage which make morley not being able to built on Hackage.
      Solution: Remove `tezos-bake-monitor-lib` and implement the binary round
      trip ourselves.
    • Diogo Castro's avatar
      [#186] Run criterion in quiet mode · 94d4008d
      Diogo Castro authored
      Problem: We use criterion to benchmark some expressions
      (see !409). But because criterion and tasty write to stdout in
      parallel, the test logs can be confusing and hard to read.
      Run criterion in quiet mode.
      We already print the estimated mean time (expected upper
      bound & actual) when the test fails, that info should be enough.
    • Diogo Castro's avatar
      [#186] Make `morley-test` output shorter · c77db19d
      Diogo Castro authored
      Problem: Some tests have very long names, they wrap around
      to multiple lines and make the test output hard to read.
      Solution: Shorten test names where possible.
      Avoid naming the test after the expression being tested,
      as that can accidentally lead to long test names.
  7. 09 Jun, 2020 5 commits
    • Pinto Pasquale's avatar
      [#124] update Indigo tests and split modules · 1ebf5682
      Pinto Pasquale authored
      Problem: code in Indigo tests needs to be updated, but with the new
      update there are many more names conflicts than before.
      Solution: split Indigo code from test machinery and update them.
    • Pinto Pasquale's avatar
      [#124] revise Indigo operators · 8a5a2539
      Pinto Pasquale authored
      Problem: some operators in Indigo are named in an odd way (usually with
      a `.`) to avoid conflicts with Haskell operators, additionally many of
      them operating on structures have been added organically and do not
      follow any convention, being confusing.
      Moreover, many of them do not have a prefix counterpart, which may be
      useful to have available.
      Solution: rename operators, replacing the ones from Prelude in case of
      name clashing and based on a convention in case of structure-based.
      Addionally, add all necessary prefix counterpart using the names of
      Michelson instructions where one exists.
    • Moremi Vannak's avatar
      [#221] Use mixins instead of base-noprelude · 07210557
      Moremi Vannak authored
      Problem: We are using `base-noprelude` dependency which is not a
      standard package. We can use `base` instead and just hide its
      `Prelude` module using `mixins` feature of Cabal. The advantage is
      that we will have less dependencies.
      Solution: Remove `base-noprelude`, use `base` with mixin `hiding
      Prelude` instead.
    • Moremi Vannak's avatar
      [#207] Add `whenNone` to Lorentz · 93d459e6
      Moremi Vannak authored
      Problem: Oddly `Lorentz` has a macro for `whenSome` that does `nop`
      on the `none` branch of an `ifSome`, but does not have a macro to do
      the opposite.
      Solution: Add `whenNone` to `Lorentz.Macro`.
    • Moremi Vannak's avatar
      [#226] Merge `IsObject` and `IsObjectClass` · 84b9d51c
      Moremi Vannak authored
      Problem: In `Indigo.Internal.Object` we have both `IsObject` and
      `IsObjectClass`, the latter being a class & instance redefinition
      of the former (to allow partial application).
      However `IsObject` itself could be written as a class & instance of
      `IsObject' (TypeDecision a) a` so there is no need to have both of
      Solution: Remove `IsObjectClass` and define `IsObject a` as a class
      and instance of `IsObject' (TypeDecision a) a`.
  8. 08 Jun, 2020 1 commit
    • Pinto Pasquale's avatar
      [#147] add stored entrypoint machinery in Lorentz for lazy code processing · 872242bf
      Pinto Pasquale authored
      Problem: putting all the code in the `code` section of smart contracts
      can cause them to be expensive, because it requires to parse it fully
      (and do some processing) even tho often you only need to use one of its
      Solution: make it fairly easy and convenient to develop and use
      entrypoints as lambda stored in a big_map. Since big_map are lazy, this
      allows to process only the code that you are going to use.
  9. 05 Jun, 2020 2 commits