clean big_map tests

This commit is contained in:
Lesenechal Remi 2019-10-18 17:36:33 +02:00
parent 9ad0859a4c
commit 23993a4488

View File

@ -1,30 +1,21 @@
type storage_ is big_map(int, int) * unit type storage_ is big_map(int, int) * unit
function main(const p : unit; const s : storage_) : list(operation) * storage_ is function main(const p : unit; const s : storage_) : list(operation) * storage_ is
var r : big_map(int, int) := s.0 ;
var toto : option (int) := Some(0); var toto : option (int) := Some(0);
block { block {
toto := r[23]; toto := s.0[23];
r[2] := 444; s.0[2] := 444;
s.0 := r;
} }
with ((nil: list(operation)), s) with ((nil: list(operation)), s)
function set_ (var n : int ; var m : storage_) : storage_ is block { function set_ (var n : int ; var m : storage_) : storage_ is block {
var tmp : big_map(int,int) := m.0 ; m.0[23] := n ;
tmp[23] := n ;
m.0 := tmp ;
} with m } with m
function rm (var m : storage_) : storage_ is block { function rm (var m : storage_) : storage_ is block {
var tmp : big_map(int,int) := m.0 ; remove 42 from map m.0;
remove 42 from map tmp;
m.0 := tmp;
} with m } with m
function gf (const m : storage_) : int is begin skip end with get_force(23, m.0) function gf (const m : storage_) : int is begin skip end with get_force(23, m.0)
function get (const m : storage_) : option(int) is function get (const m : storage_) : option(int) is begin skip end with m.0[42]
begin
skip
end with m.0[42]