Skip to content

Fix Testing Framework in the JSOO build

Motivation and Context

ligo.js doesn't have a working testing framework.


This MR uses a patched version of protocol to let us use it for the testing framework.

Protocol is written with 64-bit environment in mind. Browsers, however, are 32-bit (as far as JSOO is concerned). This MR adapts to use Zarith's Z.t so that when compiled to JS, zarith's stubs get linked in and get us 64 bit emulation for integer arithmetic in the browser.

Note: one of the interpreter step invocation passes zero gas as the initial state. I don't know where this is coming from as of now. To workaround this, the gas costs of all instructions are temporarily made free.


  • 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)


Fixes testing framework in ligo.js


  • 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