proto_genesis: remove the dependency on proto_alpha
This commit is contained in:
parent
55d79bfd7a
commit
1a7cf2fead
@ -56,6 +56,18 @@ let file_parameter =
|
||||
else
|
||||
return p)
|
||||
|
||||
let fitness_from_int64 fitness =
|
||||
(* definition taken from src/proto_alpha/lib_protocol/src/constants_repr.ml *)
|
||||
let version_number = "\000" in
|
||||
(* definitions taken from src/proto_alpha/lib_protocol/src/fitness_repr.ml *)
|
||||
let int64_to_bytes i =
|
||||
let b = MBytes.create 8 in
|
||||
MBytes.set_int64 b 0 i;
|
||||
b
|
||||
in
|
||||
[ MBytes.of_string version_number ;
|
||||
int64_to_bytes fitness ]
|
||||
|
||||
let commands () =
|
||||
let open Clic in
|
||||
let args =
|
||||
@ -87,7 +99,7 @@ let commands () =
|
||||
file_parameter
|
||||
@@ stop)
|
||||
begin fun timestamp hash fitness sk param_json_file (cctxt : Client_context.full) ->
|
||||
let fitness = Proto_alpha.Fitness_repr.from_int64 fitness in
|
||||
let fitness = fitness_from_int64 fitness in
|
||||
Tezos_stdlib_unix.Lwt_utils_unix.Json.read_file param_json_file >>=? fun json ->
|
||||
let protocol_parameters = Data_encoding.Binary.to_bytes_exn Data_encoding.json json in
|
||||
bake cctxt ?timestamp cctxt#block
|
||||
|
@ -6,8 +6,7 @@
|
||||
tezos-client-base
|
||||
tezos-client-commands
|
||||
tezos-protocol-environment
|
||||
tezos-protocol-genesis
|
||||
tezos-protocol-alpha)
|
||||
tezos-protocol-genesis)
|
||||
(library_flags (:standard -linkall))
|
||||
(flags (:standard -w -9+27-30-32-40@8
|
||||
-safe-string
|
||||
|
@ -1,28 +0,0 @@
|
||||
(*****************************************************************************)
|
||||
(* *)
|
||||
(* Open Source License *)
|
||||
(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
|
||||
(* *)
|
||||
(* Permission is hereby granted, free of charge, to any person obtaining a *)
|
||||
(* copy of this software and associated documentation files (the "Software"),*)
|
||||
(* to deal in the Software without restriction, including without limitation *)
|
||||
(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *)
|
||||
(* and/or sell copies of the Software, and to permit persons to whom the *)
|
||||
(* Software is furnished to do so, subject to the following conditions: *)
|
||||
(* *)
|
||||
(* The above copyright notice and this permission notice shall be included *)
|
||||
(* in all copies or substantial portions of the Software. *)
|
||||
(* *)
|
||||
(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*)
|
||||
(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *)
|
||||
(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *)
|
||||
(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*)
|
||||
(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *)
|
||||
(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *)
|
||||
(* DEALINGS IN THE SOFTWARE. *)
|
||||
(* *)
|
||||
(*****************************************************************************)
|
||||
|
||||
module Name = struct let name = "genesis-alpha" end
|
||||
module Alpha_environment = Tezos_protocol_environment_faked.MakeV1(Name)()
|
||||
include Tezos_protocol_alpha.Functor.Make(Alpha_environment)
|
@ -15,7 +15,6 @@ depends: [
|
||||
"tezos-client-commands"
|
||||
"tezos-protocol-environment"
|
||||
"tezos-protocol-genesis"
|
||||
"tezos-protocol-alpha"
|
||||
]
|
||||
build: [
|
||||
[ "dune" "build" "-p" name "-j" jobs ]
|
||||
|
Loading…
Reference in New Issue
Block a user