Skip to content

fix(interpreter): allow performing operations on tickets in tests

Motivation and Context

LIGO's interpreter integrates with the protocol's Michelson interpreter. It does so by serializing LIGO values to their Micheline representation, adding code to PUSH these values onto the stack, executing the Michelson code and then deserializing the Michelson values back into their LIGO representation.

Currently, there are two bugs:

  • The Michelson interpreter we use doesn't permit forged values (such as tickets, operations, etc)
  • The serializer from LIGO tickets to Michelson tickets doesn't exist

Description

This MR rectifies the above two issues.

To checkout the Michelson changes, see: tezos-ligo@68fd3b07

Component

  • compiler
  • website
  • webide
  • vscode-plugin
  • debugger

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Performance improvement (non-breaking change that improves performance)
  • None (change with no changelog)

Changelog

fix(interpreter): allow performing operations on tickets in tests

For instance, the following demonstrates the use of create_ticket and read_ticket, which previously resulted in an error.

let () = 
  let ticket = Tezos.create_ticket "Hi" 10n in 
  let (ticketer, _, _, _) = Tezos.read_ticket ticket in 
  Test.log ticketer

Checklist:

  • If a new syntax has been introduced, put a message on slack ligo-lsp
  • Changes follow the existing coding style (use dune @fmt to check).
  • Tests for the changes have been added (for bug fixes / feature).
  • Documentation has been updated.
  • Changelog description has been added (if appropriate).
  • Start titles under ## Changelog section with #### (if appropriate).
  • There is no image or uploaded file in changelog
  • Examples in changed behaviour have been added to the changelog (for breaking change / feature).

Merge request reports

Loading