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
|
module CamlinternalFormatBasics = struct include CamlinternalFormatBasics end
|
||||||
")))
|
")))
|
||||||
|
|
||||||
(rule
|
|
||||||
(targets registerer.mli)
|
|
||||||
(action (write-file %%{targets} "(* empty *)")))
|
|
||||||
|
|
||||||
(rule
|
(rule
|
||||||
(targets registerer.ml)
|
(targets registerer.ml)
|
||||||
(deps tezos_embedded_protocol_environment_%s.cmxa
|
(deps tezos_embedded_protocol_environment_%s.cmxa
|
||||||
|
@ -55,11 +55,10 @@ end
|
|||||||
|
|
||||||
let () =
|
let () =
|
||||||
Format.printf {|
|
Format.printf {|
|
||||||
let () =
|
module Registered =
|
||||||
let module Ignored = Tezos_protocol_updater.Registered_protocol.Register_embedded
|
Tezos_protocol_updater.Registered_protocol.Register_embedded
|
||||||
(Tezos_embedded_protocol_environment_%s.Environment)
|
(Tezos_embedded_protocol_environment_%s.Environment)
|
||||||
(Tezos_embedded_raw_protocol_%s.Main)
|
(Tezos_embedded_raw_protocol_%s.Main)
|
||||||
(Source) in
|
(Source)
|
||||||
()
|
|
||||||
@.|}
|
@.|}
|
||||||
version version
|
version version
|
||||||
|
@ -97,26 +97,27 @@ module Register_embedded
|
|||||||
val sources: Protocol.t
|
val sources: Protocol.t
|
||||||
end) = struct
|
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 () =
|
||||||
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
|
VersionTable.add
|
||||||
sources hash Source.sources ;
|
sources hash Source.sources ;
|
||||||
VersionTable.add
|
VersionTable.add
|
||||||
versions hash
|
versions hash (module Self : T)
|
||||||
(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)
|
|
||||||
|
|
||||||
|
include Self
|
||||||
end
|
end
|
||||||
|
@ -54,4 +54,8 @@ module Register_embedded
|
|||||||
(Source : sig
|
(Source : sig
|
||||||
val hash: Protocol_hash.t option
|
val hash: Protocol_hash.t option
|
||||||
val sources: Protocol.t
|
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