Alpha: minor renaming
This commit is contained in:
parent
cd5ac0a27d
commit
e42cd1ccd6
@ -68,14 +68,6 @@ end
|
||||
module Contract = struct
|
||||
include Contract_repr
|
||||
include Contract_storage
|
||||
|
||||
module Big_map_storage = struct
|
||||
let set ctx contract = Contract_storage.Big_map.set (ctx, contract)
|
||||
let remove ctx contract = Contract_storage.Big_map.remove (ctx, contract)
|
||||
let mem ctx contract = Contract_storage.Big_map.mem (ctx, contract)
|
||||
let get_opt ctx contract = Contract_storage.Big_map.get_opt (ctx, contract)
|
||||
end
|
||||
|
||||
end
|
||||
module Delegate = Delegate_storage
|
||||
module Roll = struct
|
||||
|
@ -452,7 +452,7 @@ module Contract : sig
|
||||
val check_counter_increment:
|
||||
context -> contract -> int32 -> unit tzresult Lwt.t
|
||||
|
||||
module Big_map_storage : sig
|
||||
module Big_map : sig
|
||||
val set:
|
||||
context -> contract ->
|
||||
string -> Script.expr -> context tzresult Lwt.t
|
||||
|
@ -211,9 +211,9 @@ let apply_manager_operation_content
|
||||
| Some diff ->
|
||||
fold_left_s (fun ctxt (key, value) ->
|
||||
match value with
|
||||
| None -> Contract.Big_map_storage.remove ctxt contract key
|
||||
| None -> Contract.Big_map.remove ctxt contract key
|
||||
| Some v ->
|
||||
Contract.Big_map_storage.set ctxt contract key v)
|
||||
Contract.Big_map.set ctxt contract key v)
|
||||
ctxt diff
|
||||
end >>=? fun ctxt ->
|
||||
return (ctxt, origination_nonce, None)
|
||||
|
@ -367,9 +367,9 @@ let init c =
|
||||
Storage.Contract.Global_counter.init c 0l
|
||||
|
||||
module Big_map = struct
|
||||
let set handle key value =
|
||||
Storage.Contract.Big_map.init_set handle key value >>= return
|
||||
let remove = Storage.Contract.Big_map.delete
|
||||
let mem = Storage.Contract.Big_map.mem
|
||||
let get_opt = Storage.Contract.Big_map.get_option
|
||||
let set ctxt contract key value =
|
||||
Storage.Contract.Big_map.init_set (ctxt, contract) key value >>= return
|
||||
let remove ctxt contract = Storage.Contract.Big_map.delete (ctxt, contract)
|
||||
let mem ctxt contract = Storage.Contract.Big_map.mem (ctxt, contract)
|
||||
let get_opt ctxt contract = Storage.Contract.Big_map.get_option (ctxt, contract)
|
||||
end
|
||||
|
@ -94,11 +94,11 @@ val init:
|
||||
|
||||
module Big_map : sig
|
||||
val set :
|
||||
Storage.Contract.bigmap_key ->
|
||||
Raw_context.t -> Contract_repr.t ->
|
||||
string -> Script_repr.expr -> Raw_context.t tzresult Lwt.t
|
||||
val remove :
|
||||
Storage.Contract.bigmap_key -> string -> Raw_context.t tzresult Lwt.t
|
||||
val mem : Storage.Contract.bigmap_key -> string -> bool Lwt.t
|
||||
Raw_context.t -> Contract_repr.t -> string -> Raw_context.t tzresult Lwt.t
|
||||
val mem : Raw_context.t -> Contract_repr.t -> string -> bool Lwt.t
|
||||
val get_opt :
|
||||
Storage.Contract.bigmap_key -> string -> Script_repr.expr option tzresult Lwt.t
|
||||
Raw_context.t -> Contract_repr.t -> string -> Script_repr.expr option tzresult Lwt.t
|
||||
end
|
||||
|
@ -2136,7 +2136,7 @@ let hash_data typ data =
|
||||
|
||||
let big_map_mem ctx contract key { diff ; key_type } =
|
||||
match map_get key diff with
|
||||
| None -> Alpha_context.Contract.Big_map_storage.mem ctx contract (hash_data key_type key)
|
||||
| None -> Alpha_context.Contract.Big_map.mem ctx contract (hash_data key_type key)
|
||||
| Some None -> Lwt.return false
|
||||
| Some (Some _) -> Lwt.return true
|
||||
|
||||
@ -2144,7 +2144,7 @@ let big_map_get ctx contract key { diff ; key_type ; value_type } =
|
||||
match map_get key diff with
|
||||
| Some x -> return x
|
||||
| None ->
|
||||
Alpha_context.Contract.Big_map_storage.get_opt
|
||||
Alpha_context.Contract.Big_map.get_opt
|
||||
ctx contract
|
||||
(hash_data key_type key) >>=? begin function
|
||||
| None -> return None
|
||||
|
@ -47,7 +47,7 @@ let expect_big_map tc contract print_key key_type print_data data_type contents
|
||||
iter_p
|
||||
(fun (n, exp) ->
|
||||
let key = Proto_alpha.Script_ir_translator.hash_data key_type n in
|
||||
Proto_alpha.Alpha_context.Contract.Big_map_storage.get_opt tc contract key >>=? fun data ->
|
||||
Proto_alpha.Alpha_context.Contract.Big_map.get_opt tc contract key >>=? fun data ->
|
||||
match data, exp with
|
||||
| None, None ->
|
||||
debug " - big_map[%a] is not defined (ok)" print_key n ;
|
||||
|
Loading…
Reference in New Issue
Block a user