Updater: registration or a protocol now returns the registered module
This commit is contained in:
parent
32d2bf606d
commit
6510869b73
@ -27,10 +27,6 @@ let () = Format.kasprintf Jbuild_plugin.V1.send {|
|
||||
module CamlinternalFormatBasics = struct include CamlinternalFormatBasics end
|
||||
")))
|
||||
|
||||
(rule
|
||||
(targets registerer.mli)
|
||||
(action (write-file %%{targets} "(* empty *)")))
|
||||
|
||||
(rule
|
||||
(targets registerer.ml)
|
||||
(deps tezos_embedded_protocol_environment_%s.cmxa
|
||||
|
@ -55,11 +55,10 @@ end
|
||||
|
||||
let () =
|
||||
Format.printf {|
|
||||
let () =
|
||||
let module Ignored = Tezos_protocol_updater.Registered_protocol.Register_embedded
|
||||
module Registered =
|
||||
Tezos_protocol_updater.Registered_protocol.Register_embedded
|
||||
(Tezos_embedded_protocol_environment_%s.Environment)
|
||||
(Tezos_embedded_raw_protocol_%s.Main)
|
||||
(Source) in
|
||||
()
|
||||
(Source)
|
||||
@.|}
|
||||
version version
|
||||
|
@ -97,26 +97,27 @@ module Register_embedded
|
||||
val sources: Protocol.t
|
||||
end) = struct
|
||||
|
||||
let hash =
|
||||
match Source.hash with
|
||||
| None -> Protocol.hash Source.sources
|
||||
| Some hash -> hash
|
||||
module Name = struct
|
||||
let name = Protocol_hash.to_b58check hash
|
||||
end
|
||||
module Self = struct
|
||||
module P = struct
|
||||
let hash = hash
|
||||
include Env.Lift(Proto)
|
||||
end
|
||||
include P
|
||||
module Block_services = Block_services.Make(P)(P)
|
||||
let complete_b58prefix = Env.Context.complete
|
||||
end
|
||||
let () =
|
||||
let hash =
|
||||
match Source.hash with
|
||||
| None -> Protocol.hash Source.sources
|
||||
| Some hash -> hash in
|
||||
let module Name = struct
|
||||
let name = Protocol_hash.to_b58check hash
|
||||
end in
|
||||
VersionTable.add
|
||||
sources hash Source.sources ;
|
||||
VersionTable.add
|
||||
versions hash
|
||||
(module struct
|
||||
module P = struct
|
||||
let hash = hash
|
||||
include Env.Lift(Proto)
|
||||
end
|
||||
include P
|
||||
module Block_services = Block_services.Make(P)(P)
|
||||
let complete_b58prefix = Env.Context.complete
|
||||
end : T)
|
||||
versions hash (module Self : T)
|
||||
|
||||
include Self
|
||||
end
|
||||
|
@ -54,4 +54,8 @@ module Register_embedded
|
||||
(Source : sig
|
||||
val hash: Protocol_hash.t option
|
||||
val sources: Protocol.t
|
||||
end) : sig end
|
||||
end) :
|
||||
T with type P.block_header_data = Proto.block_header_data
|
||||
and type P.operation_data = Proto.operation_data
|
||||
and type P.operation_receipt = Proto.operation_receipt
|
||||
and type P.validation_state = Proto.validation_state
|
||||
|
Loading…
Reference in New Issue
Block a user