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