Skip to content

Testing framework: keep bigmap data locally

E. Rivas requested to merge internal/testing-framework-bigmaps into dev

This MR changes completely the handling of bigmaps: we keep a local store with the values for bigmaps.

Each time we bake an op, we check the receipts to update the local store. Moreover, there's no more identifiers as values, instead, each time an identifier bigmap is recovered from the testing helpers, it's looked up in the local store and replaced by a V_Map.

The main trouble is that we don't have the receipts for bootstrapped contracts. As a workaround for this, this MR also introduces a new operation Test.set_big_map : int -> ('k, 'v) big_map -> unit that will override the local store with the bigmap passed as argument. In the case of liquidity baking, we need to do this by hand as follows after resetting the state:

<     Test.reset_state 3n [10000000000mutez; 10000000000mutez; 10000000000mutez];
<     Test.set_now now;
<     // load by hand the big_maps
<     Test.set_big_map 0 tok_storage.tokens;
<     Test.set_big_map 1 tok_storage.allowances;
<     Test.set_big_map 2 lqt_storage.tokens;
<     Test.set_big_map 3 lqt_storage.allowances
>     Test.reset_state 3n [10000000000n; 10000000000n; 10000000000n];
>     Test.set_now now

i.e. call Test.set_big_map with the initial maps. It could get tricky to find the assigned map ids? Although this is a pretty niche test, and probably it will change when we move to Granada?

  • has a changelog entry
Edited by E. Rivas

Merge request reports