Skip to content

[#346] Generate big_map IDs in interpreter

Diogo Castro requested to merge diogo/#346-interpreter-bigmaps into master

Description

We want cleveland to support retrieving storages with big_maps, on both the emulator and on a network. The chain seems to assign a unique ID to each new big_map, and when a storage with big_maps is retrieved via the RPC, only the ID is returned. We need our emulator to mimic this behaviour.

This MR changes the interpreter to generate and assign unique IDs whenever a new big_map is created.

big_maps can be created by:

  • originating a contract with big_maps in its initial storage.
  • calling a contract with a parameter with big_maps, and then saving those big_maps in the contract's storage.
  • executing the EMPTY_BIG_MAP instruction
  • executing the DUP or DUP n instructions on another big_map.

Please review one commit at a time.

Related issue(s)

Resolves part of #346 (closed)

Checklist for your Merge Request

Related changes (conditional)

  • Tests (see short guidelines)

    • If I added new functionality, I added tests covering it.
    • If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again.
  • Documentation

    • I checked whether I should update the docs and did so if necessary:
    • I updated changelog files of all affected packages released to Hackage if my changes are externally visible.

Stylistic guide (mandatory)

Edited by Diogo Castro

Merge request reports