Skip to content

Fix CLI option `-e` for `compile parameter` & `compile storage`

Melwyn Saldanha requested to merge fix/cli_entrypoints_flag into dev

Motivation and Context

The entrypoint(s) passed via the CLI option -e were ignored in the case of ligo compile parameter & ligo compile storage

Description

This MR fixes the bug

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

The CLI option -e for passing entrypoint has been fixed ligo compile parameter & ligo compile storage

Example

let main (_ : unit) (_ : unit) : operation list * unit = [], ()

let ep2 (_ : string) (s : int) : operation list * int = [], s

Before

$ ligo.64 compile parameter x.mligo '"Hello"' -e ep2
Invalid command line argument. 
The provided parameter does not have the correct type for the given entrypoint.
File "x.mligo", line 1, characters 0-63:
  1 | let main (_ : unit) (_ : unit) : operation list * unit = [], ()
  2 | 

Invalid type(s).
Expected: "unit", but got: "string".

$ ligo.64 compile storage x.mligo '1' -e ep2
Invalid command line argument. 
The provided storage does not have the correct type for the contract.
File "x.mligo", line 1, characters 0-63:
  1 | let main (_ : unit) (_ : unit) : operation list * unit = [], ()
  2 | 

Invalid type(s).
Expected: "unit", but got: "int".

After

$ ligo compile parameter x.mligo '"Hello"' -e ep2
"Hello"

$ _build/install/default/bin/ligo compile storage x.mligo '1' -e ep2
1

Checklist:

  • 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).
Edited by Melwyn Saldanha

Merge request reports