Skip to content

Add support for `chain_id` literal in Testing Framework

Melwyn Saldanha requested to merge fix/chain_id_literal_testing_framework into dev

Motivation and Context

If a test has chain_id literals, we get the error Invalid interpretation of literal: when we run the test.

Description

This MR supports chain_id in tests and Changes the type of C_chain_id to Tezos_crypto.Chain_id.t

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

Support chain_id literals in Testing Framework

E.g.

let test_chain_id = 
  let chain_id = Test.eval ("NetXH12Aer3be93" : chain_id) in
  assert (chain_id = Test.eval (Tezos.get_chain_id ()))

Before changes

$ ligo.55 run test x.mligo 

Invalid interpretation of literal: Chain_id NetXH12Aer3be93

After changes

$ ligo run test x.mligo
Everything at the top-level was executed.
- test_chain_id exited with value ()

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).
  • Changelog title start 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

Loading