ligo/src/test/contracts/big_map.mligo

21 lines
522 B
Plaintext
Raw Normal View History

type foo = (int, int) big_map
2019-09-27 19:52:40 +04:00
let set_ (n : int) (m : foo) : foo = Big_map.update 23 (Some(n)) m
2019-09-27 19:52:40 +04:00
let rm (m : foo) : foo = Big_map.remove 42 m
2019-09-27 19:52:40 +04:00
let gf (m : foo) : int = Big_map.find 23 m
2019-09-27 19:52:40 +04:00
let get (m: foo): int option = Big_map.find_opt 42 m
let empty_map : foo = Big_map.empty
let map1 : foo = Big_map.literal
[ (23 , 0) ; (42, 0) ]
let map1 : foo = Big_map.literal
[ (23 , 0) ; (42, 0) ]
let mutimaps (m : foo) (n : foo) : foo =
let bar : foo = Big_map.update 42 (Some(0)) m in
Big_map.update 42 (get(bar)) n