More renaming: 'mine' -> 'bake'

This commit is contained in:
Grégoire Henry 2017-11-20 03:37:06 +01:00 committed by Grégoire
parent 42681dfea5
commit 13dd470d06
22 changed files with 83 additions and 83 deletions

View File

@ -329,7 +329,7 @@ let call_describe0 cctxt service path arg =
type block = Node_rpc_services.Blocks.block
let last_mined_block = function
let last_baked_block = function
| `Prevalidation -> `Head 0
| `Test_prevalidation -> `Test_head 0
| `Genesis | `Head _ | `Test_head _ | `Hash _ as block -> block

View File

@ -80,7 +80,7 @@ val call_describe0:
type block = Node_rpc_services.Blocks.block
val last_mined_block:
val last_baked_block:
block -> [>
| `Genesis
| `Head of int

View File

@ -68,7 +68,7 @@ let monitor cctxt
return (Lwt_stream.map_s convert block_stream)
let blocks_from_cycle cctxt block cycle =
let block = Client_rpcs.last_mined_block block in
let block = Client_rpcs.last_baked_block block in
Client_proto_rpcs.Context.level cctxt block >>=? fun level ->
Client_proto_rpcs.Helpers.levels cctxt block cycle >>=? fun (first, last) ->
let length = Int32.to_int (Raw_level.diff level.level first) in

View File

@ -118,7 +118,7 @@ let get_signing_slots cctxt ?max_priority block delegate level =
let inject_endorsement cctxt
block level ?async ?force
src_sk source slot =
let block = Client_rpcs.last_mined_block block in
let block = Client_rpcs.last_baked_block block in
Client_node_rpcs.Blocks.info cctxt.rpc_config block >>=? fun bi ->
Client_proto_rpcs.Helpers.Forge.Delegate.endorsement cctxt.rpc_config
block
@ -152,7 +152,7 @@ let check_endorsement cctxt level slot =
let forge_endorsement cctxt
block ?(force = false)
~src_sk ?slot ?max_priority src_pk =
let block = Client_rpcs.last_mined_block block in
let block = Client_rpcs.last_baked_block block in
let src_pkh = Ed25519.Public_key.hash src_pk in
Client_proto_rpcs.Context.next_level cctxt.rpc_config block >>=? fun { level } ->
begin

View File

@ -100,7 +100,7 @@ let forge_block cctxt block
?timestamp
~priority
~seed_nonce_hash ~src_sk () =
let block = Client_rpcs.last_mined_block block in
let block = Client_rpcs.last_baked_block block in
begin
match operations with
| None ->
@ -444,7 +444,7 @@ let insert_blocks cctxt ?max_priority state bis =
Format.eprintf "Error: %a" pp_print_error err ;
Lwt.return_unit
let mine cctxt state =
let bake cctxt state =
let slots = pop_baking_slots state in
let seed_nonce = generate_seed_nonce () in
let seed_nonce_hash = Nonce.hash seed_nonce in
@ -592,7 +592,7 @@ let create
| `Timeout ->
lwt_debug "Waking up for baking..." >>= fun () ->
begin
mine cctxt state >>= function
bake cctxt state >>= function
| Ok () -> Lwt.return_unit
| Error errs ->
lwt_log_error "Error while baking:\n%a"

View File

@ -9,7 +9,7 @@
open Client_commands
let mine_block cctxt block
let bake_block cctxt block
?force ?max_priority ?(free_baking=false) ?src_sk delegate =
begin
match src_sk with
@ -85,7 +85,7 @@ let reveal_block_nonces cctxt ?force block_hashes =
do_reveal cctxt ?force cctxt.config.block blocks
let reveal_nonces cctxt ?force () =
let block = Client_rpcs.last_mined_block cctxt.config.block in
let block = Client_rpcs.last_baked_block cctxt.config.block in
Client_baking_forge.get_unrevealed_nonces
cctxt ?force block >>=? fun nonces ->
do_reveal cctxt ?force cctxt.config.block nonces
@ -129,12 +129,12 @@ let commands () =
~force ?max_priority delegate) ;
command ~group ~desc: "Forge and inject block using the delegate rights"
(args3 max_priority_arg force_switch free_baking_switch)
(prefixes [ "mine"; "for" ]
(prefixes [ "bake"; "for" ]
@@ Client_keys.Public_key_hash.alias_param
~name:"baker" ~desc: "name of the delegate owning the baking right"
@@ stop)
(fun (max_priority, force, free_baking) (_, delegate) cctxt ->
mine_block cctxt cctxt.config.block
bake_block cctxt cctxt.config.block
~force ?max_priority ~free_baking delegate) ;
command ~group ~desc: "Forge and inject a seed-nonce revelation operation"
(args1 force_switch)

View File

@ -7,7 +7,7 @@
(* *)
(**************************************************************************)
val mine_block:
val bake_block:
Client_commands.context ->
Client_proto_rpcs.block ->
?force:bool ->

View File

@ -14,7 +14,7 @@ let inject_seed_nonce_revelation rpc_config block ?force ?async nonces =
List.map
(fun (level, nonce) ->
Seed_nonce_revelation { level ; nonce }) nonces in
let block = Client_rpcs.last_mined_block block in
let block = Client_rpcs.last_baked_block block in
Client_node_rpcs.Blocks.info rpc_config block >>=? fun bi ->
Client_proto_rpcs.Helpers.Forge.Anonymous.operations rpc_config
block ~branch:bi.hash operations >>=? fun bytes ->

View File

@ -29,7 +29,7 @@ let rec find_predecessor rpc_config h n =
let get_branch rpc_config block branch =
let branch = Utils.unopt ~default:0 branch in (* TODO export parameter *)
let block = Client_rpcs.last_mined_block block in
let block = Client_rpcs.last_baked_block block in
begin
match block with
| `Head n -> return (`Head (n+branch))
@ -219,7 +219,7 @@ let group =
title = "Block contextual commands (see option -block)" }
let dictate rpc_config ?force block command seckey =
let block = Client_rpcs.last_mined_block block in
let block = Client_rpcs.last_baked_block block in
Client_node_rpcs.Blocks.info
rpc_config block >>=? fun { net_id ; hash = branch } ->
Client_proto_rpcs.Helpers.Forge.Dictator.operation

View File

@ -33,8 +33,8 @@ let demo cctxt =
cctxt.answer "All good!" >>= fun () ->
return ()
let mine cctxt =
let block = Client_rpcs.last_mined_block cctxt.Client_commands.config.block in
let bake cctxt =
let block = Client_rpcs.last_baked_block cctxt.Client_commands.config.block in
Client_node_rpcs.Blocks.info cctxt.rpc_config block >>=? fun bi ->
let fitness =
match bi.fitness with
@ -80,10 +80,10 @@ let commands () =
(fun () _cctxt ->
Error.demo_error 101010
>|= Environment.wrap_error) ;
command ~group ~desc: "Mine an empty block"
command ~group ~desc: "Bake an empty block"
no_options
(fixed [ "mine" ])
(fun () cctxt -> mine cctxt) ;
(fixed [ "bake" ])
(fun () cctxt -> bake cctxt) ;
]
let () =

View File

@ -26,7 +26,7 @@ let call_error_service1 rpc_config s block a1 =
let forge_block
rpc_config block net_id ?(timestamp = Time.now ()) command fitness =
let block = Client_rpcs.last_mined_block block in
let block = Client_rpcs.last_baked_block block in
Client_node_rpcs.Blocks.info rpc_config block >>=? fun pred ->
let proto_level =
match command with
@ -37,8 +37,8 @@ let forge_block
((net_id, Int32.succ pred.level, proto_level,
pred.hash, timestamp, fitness), command)
let mine rpc_config ?timestamp block command fitness seckey =
let block = Client_rpcs.last_mined_block block in
let bake rpc_config ?timestamp block command fitness seckey =
let block = Client_rpcs.last_baked_block block in
Client_node_rpcs.Blocks.info rpc_config block >>=? fun bi ->
forge_block
rpc_config ?timestamp block bi.net_id command fitness >>=? fun blk ->
@ -78,7 +78,7 @@ let commands () =
begin fun timestamp hash fitness seckey cctxt ->
let fitness =
Tezos_embedded_raw_protocol_alpha.Fitness_repr.from_int64 fitness in
mine cctxt.rpc_config ?timestamp cctxt.config.block
bake cctxt.rpc_config ?timestamp cctxt.config.block
(Activate hash) fitness seckey >>=? fun hash ->
cctxt.answer "Injected %a" Block_hash.pp_short hash >>= fun () ->
return ()
@ -99,7 +99,7 @@ let commands () =
begin fun timestamp hash fitness seckey cctxt ->
let fitness =
Tezos_embedded_raw_protocol_alpha.Fitness_repr.from_int64 fitness in
mine cctxt.rpc_config ?timestamp cctxt.config.block
bake cctxt.rpc_config ?timestamp cctxt.config.block
(Activate_testnet (hash, Int64.mul 24L 3600L))
fitness seckey >>=? fun hash ->
cctxt.answer "Injected %a" Block_hash.pp_short hash >>= fun () ->

View File

@ -9,7 +9,7 @@
open Tezos_embedded_raw_protocol_genesis
val mine:
val bake:
Client_rpcs.config ->
?timestamp: Time.t ->
Client_node_rpcs.Blocks.block ->

View File

@ -23,7 +23,7 @@ val paying_priorities: context -> int list
(** [minimal_time ctxt priority pred_block_time] returns the minimal
time, given the predecessor block timestamp [pred_block_time],
after which a baker with priority [priority] is allowed to
mine. Fail with [Invalid_slot_durations_constant] if the minimal
bake. Fail with [Invalid_slot_durations_constant] if the minimal
time cannot be computed. *)
val minimal_time: context -> int -> Time.t -> Time.t tzresult Lwt.t
@ -73,7 +73,7 @@ val base_baking_reward: context -> priority:int -> Tez.t
val endorsement_reward: block_priority:int -> Tez.t tzresult Lwt.t
(** [baking_priorities ctxt level] is the lazy list of contract's
public key hashes that are allowed to mine for [level]. *)
public key hashes that are allowed to bake for [level]. *)
val baking_priorities:
context -> Level.t -> public_key_hash lazy_list
@ -84,7 +84,7 @@ val endorsement_priorities:
(** [first_baking_priorities ctxt ?max_priority contract_hash level]
is a list of priorities of max [?max_priority] elements, where the
delegate of [contract_hash] is allowed to mine for [level]. If
delegate of [contract_hash] is allowed to bake for [level]. If
[?max_priority] is [None], a sensible number of priorities is
returned. *)
val first_baking_priorities:

View File

@ -479,7 +479,7 @@ module Helpers = struct
let baking_rights custom_root =
RPC.service
~description:
"List gelegates allowed to mine for the next level, \
"List gelegates allowed to bake for the next level, \
ordered by priority."
~input: (obj1 (opt "max_priority" int31))
~output: (wrap_tzerror @@
@ -495,7 +495,7 @@ module Helpers = struct
let baking_rights_for_level custom_root =
RPC.service
~description:
"List delegate allowed to mine for a given level, \
"List delegate allowed to bake for a given level, \
ordered by priority."
~input: (obj1 (opt "max_priority" int31))
~output: (wrap_tzerror @@

View File

@ -27,7 +27,7 @@ let dictator_sk =
let activate_alpha () =
let fitness = Fitness_repr.from_int64 0L in
Client_embedded_genesis.Client_proto_main.mine
Client_embedded_genesis.Client_proto_main.bake
!rpc_config (`Head 0)
(Activate Client_proto_main.protocol)
fitness dictator_sk
@ -420,7 +420,7 @@ end
module Baking = struct
let mine block (contract: Account.t) operations =
let bake block (contract: Account.t) operations =
let seed_nonce =
match Nonce.of_bytes @@
Sodium.Random.Bigbytes.generate Constants.nonce_length with
@ -454,7 +454,7 @@ module Endorse = struct
src_sk
source
slot =
let block = Client_rpcs.last_mined_block block in
let block = Client_rpcs.last_baked_block block in
Client_node_rpcs.Blocks.info !rpc_config block >>=? fun { hash } ->
Client_proto_rpcs.Helpers.Forge.Delegate.endorsement !rpc_config
block

View File

@ -95,7 +95,7 @@ end
module Baking : sig
val mine:
val bake:
Client_node_rpcs.Blocks.block ->
Account.t ->
Operation.raw list ->

View File

@ -19,25 +19,25 @@ let default_account =
let test_double_endorsement contract block =
(* Double endorsement for the same level *)
Helpers.Baking.mine block contract [] >>=? fun b1 ->
Helpers.Baking.bake block contract [] >>=? fun b1 ->
(* branch root *)
Helpers.Baking.mine (`Hash b1) contract [] >>=? fun b2 ->
Helpers.Baking.bake (`Hash b1) contract [] >>=? fun b2 ->
(* changing branch *)
Helpers.Baking.mine (`Hash b1) contract [] >>=? fun b2' ->
Helpers.Baking.bake (`Hash b1) contract [] >>=? fun b2' ->
(* branch root *)
Helpers.Endorse.endorse contract (`Hash b2) >>=? fun op ->
Helpers.Baking.mine (`Hash b2) contract [ op ] >>=? fun _b3 ->
Helpers.Baking.bake (`Hash b2) contract [ op ] >>=? fun _b3 ->
Helpers.Endorse.endorse contract (`Hash b2') >>=? fun op ->
Helpers.Baking.mine (`Hash b2') contract [ op ] >>=? fun b3' ->
Helpers.Baking.bake (`Hash b2') contract [ op ] >>=? fun b3' ->
Helpers.Endorse.endorse contract (`Hash b3') >>=? fun op ->
Helpers.Baking.mine (`Hash b3') contract [ op ] >>=? fun b4' ->
Helpers.Baking.bake (`Hash b3') contract [ op ] >>=? fun b4' ->
(* TODO: Inject double endorsement op ! *)
Helpers.Baking.mine (`Hash b4') contract []
Helpers.Baking.bake (`Hash b4') contract []
(* FIXME: Baking.Invalid_signature is unclassified *)
let test_invalid_signature block =
@ -50,7 +50,7 @@ let test_invalid_signature block =
DYfTKhq7rDQujdn5WWzwUMeV3agaZ6J2vPQT58jJAJPi" in
let account =
Helpers.Account.create ~keys:(secret_key, public_key) "WRONG SIGNATURE" in
Helpers.Baking.mine block account [] >>= fun res ->
Helpers.Baking.bake block account [] >>= fun res ->
Assert.generic_economic_error ~msg:__LOC__ res ;
return ()
@ -61,18 +61,18 @@ let contain_tzerror ?(msg="") ~f t =
failwith "@[<v 2>Unexpected error@ %a@]" pp_print_error error
| _ -> return ()
let test_wrong_delegate ~miner contract block =
let test_wrong_delegate ~baker contract block =
begin
Helpers.Endorse.endorse ~slot:1 contract block >>=? fun op ->
Helpers.Baking.mine block miner [ op ] >>=? fun _ ->
Helpers.Baking.bake block baker [ op ] >>=? fun _ ->
Helpers.Endorse.endorse ~slot:2 contract block >>=? fun op ->
Helpers.Baking.mine block miner [ op ] >>=? fun _ ->
Helpers.Baking.bake block baker [ op ] >>=? fun _ ->
Helpers.Endorse.endorse ~slot:3 contract block >>=? fun op ->
Helpers.Baking.mine block miner [ op ] >>=? fun _ ->
Helpers.Baking.bake block baker [ op ] >>=? fun _ ->
Helpers.Endorse.endorse ~slot:4 contract block >>=? fun op ->
Helpers.Baking.mine block miner [ op ] >>=? fun _ ->
Helpers.Baking.bake block baker [ op ] >>=? fun _ ->
Helpers.Endorse.endorse ~slot:5 contract block >>=? fun op ->
Helpers.Baking.mine block miner [ op ] >>=? fun _ ->
Helpers.Baking.bake block baker [ op ] >>=? fun _ ->
return ()
end >>= fun res ->
Assert.failed_to_preapply ~msg:__LOC__ begin function
@ -83,13 +83,13 @@ let test_wrong_delegate ~miner contract block =
let test_invalid_endorsement_slot contract block =
Helpers.Endorse.endorse ~slot:~-1 contract block >>=? fun op ->
Helpers.Baking.mine block contract [ op ] >>= fun res ->
Helpers.Baking.bake block contract [ op ] >>= fun res ->
Assert.failed_to_preapply ~msg:__LOC__ ~op begin function
| Baking.Invalid_endorsement_slot _ -> true
| _ -> false
end res ;
Helpers.Endorse.endorse ~slot:16 contract block >>=? fun op ->
Helpers.Baking.mine block contract [ op ] >>= fun res ->
Helpers.Baking.bake block contract [ op ] >>= fun res ->
Assert.failed_to_preapply ~msg:__LOC__ ~op begin function
| Baking.Invalid_endorsement_slot _ -> true
| _ -> false
@ -114,7 +114,7 @@ let test_endorsement_rewards block0 =
get_endorser_except [ b1 ] accounts >>=? fun (account0, slot0) ->
Helpers.Account.balance ~block:block0 account0 >>=? fun balance0 ->
Helpers.Endorse.endorse ~slot:slot0 account0 block0 >>=? fun op ->
Helpers.Baking.mine block0 b1 [ op ] >>=? fun hash1 ->
Helpers.Baking.bake block0 b1 [ op ] >>=? fun hash1 ->
Helpers.display_level (`Hash hash1) >>=? fun () ->
Assert.balance_equal ~block:(`Hash hash1) ~msg:__LOC__ account0
(Int64.sub (Tez.to_cents balance0) bond) >>=? fun () ->
@ -125,17 +125,17 @@ let test_endorsement_rewards block0 =
get_endorser_except [ b1 ; account0 ] accounts >>=? fun (account1, slot1) ->
Helpers.Account.balance ~block:block1 account1 >>=? fun balance1 ->
Helpers.Endorse.endorse ~slot:slot1 account1 block1 >>=? fun op ->
Helpers.Baking.mine block1 b1 [ op ] >>=? fun hash2 ->
Helpers.Baking.bake block1 b1 [ op ] >>=? fun hash2 ->
Helpers.display_level (`Hash hash2) >>=? fun () ->
Assert.balance_equal ~block:(`Hash hash2) ~msg:__LOC__ account1
(Int64.sub (Tez.to_cents balance1) bond) >>=? fun () ->
(* Check rewards after one cycle for account0 *)
Helpers.Baking.mine (`Hash hash2) b1 [] >>=? fun hash3 ->
Helpers.Baking.bake (`Hash hash2) b1 [] >>=? fun hash3 ->
Helpers.display_level (`Hash hash3) >>=? fun () ->
Helpers.Baking.mine (`Hash hash3) b1 [] >>=? fun hash4 ->
Helpers.Baking.bake (`Hash hash3) b1 [] >>=? fun hash4 ->
Helpers.display_level (`Hash hash4) >>=? fun () ->
Helpers.Baking.mine (`Hash hash4) b1 [] >>=? fun hash5 ->
Helpers.Baking.bake (`Hash hash4) b1 [] >>=? fun hash5 ->
Helpers.display_level (`Hash hash5) >>=? fun () ->
Helpers.Baking.endorsement_reward block1 >>=? fun rw0 ->
Assert.balance_equal ~block:(`Hash hash5) ~msg:__LOC__ account0
@ -147,9 +147,9 @@ let test_endorsement_rewards block0 =
(Int64.add (Tez.to_cents balance1) rw1) >>=? fun () ->
(* #2 endorse and check reward only on the good chain *)
Helpers.Baking.mine (`Hash hash5) b1 []>>=? fun hash6a ->
Helpers.Baking.bake (`Hash hash5) b1 []>>=? fun hash6a ->
Helpers.display_level (`Hash hash6a) >>=? fun () ->
Helpers.Baking.mine (`Hash hash5) b1 [] >>=? fun hash6b ->
Helpers.Baking.bake (`Hash hash5) b1 [] >>=? fun hash6b ->
Helpers.display_level (`Hash hash6b) >>=? fun () ->
(* working on head *)
@ -158,7 +158,7 @@ let test_endorsement_rewards block0 =
Helpers.Account.balance ~block:(`Hash hash6a) account3 >>=? fun balance3 ->
Helpers.Endorse.endorse
~slot:slot3 account3 (`Hash hash6a) >>=? fun ops ->
Helpers.Baking.mine (`Hash hash6a) b1 [ ops ] >>=? fun hash7a ->
Helpers.Baking.bake (`Hash hash6a) b1 [ ops ] >>=? fun hash7a ->
Helpers.display_level (`Hash hash7a) >>=? fun () ->
(* working on fork *)
@ -166,13 +166,13 @@ let test_endorsement_rewards block0 =
get_endorser_except [ b1 ] accounts >>=? fun (account4, slot4) ->
Helpers.Account.balance ~block:(`Hash hash7a) account4 >>=? fun _balance4 ->
Helpers.Endorse.endorse ~slot:slot4 account4 (`Hash hash6b) >>=? fun ops ->
Helpers.Baking.mine (`Hash hash6b) b1 [ ops ] >>=? fun _new_fork ->
Helpers.Baking.bake (`Hash hash6b) b1 [ ops ] >>=? fun _new_fork ->
Helpers.display_level (`Hash _new_fork) >>=? fun () ->
Helpers.Account.balance ~block:(`Hash hash7a) account4 >>=? fun balance4 ->
Helpers.Baking.mine (`Hash hash7a) b1 [] >>=? fun hash8a ->
Helpers.Baking.bake (`Hash hash7a) b1 [] >>=? fun hash8a ->
Helpers.display_level (`Hash hash8a) >>=? fun () ->
Helpers.Baking.mine (`Hash hash8a) b1 [] >>=? fun hash9a ->
Helpers.Baking.bake (`Hash hash8a) b1 [] >>=? fun hash9a ->
Helpers.display_level (`Hash hash9a) >>=? fun () ->
(* Check rewards after one cycle *)
@ -220,8 +220,8 @@ let run genesis =
(* Endorse with a contract with wrong delegate:
- contract with no endorsement rights
- contract which signs at every available slots *)
test_wrong_delegate ~miner:b1 default_account genesis >>= fun () ->
test_wrong_delegate ~miner:b1 b5 genesis >>= fun () ->
test_wrong_delegate ~baker:b1 default_account genesis >>= fun () ->
test_wrong_delegate ~baker:b1 b5 genesis >>= fun () ->
(* Endorse with a wrong slot : -1 and max (16) *)
test_invalid_endorsement_slot b3 genesis >>=? fun () ->

View File

@ -12,7 +12,7 @@ module Assert = Helpers.Assert
let run blkid ({ b1 ; b2 ; _ } : Helpers.Account.bootstrap_accounts) =
Helpers.Baking.mine blkid b1 [] >>=? fun blkh ->
Helpers.Baking.bake blkid b1 [] >>=? fun blkh ->
let foo = Helpers.Account.create "foo" in
(* Origination with amount = 0 tez *)

View File

@ -12,7 +12,7 @@ module Assert = Helpers.Assert
let run blkid ({ b1 ; b2 ; b3 ; _ } : Helpers.Account.bootstrap_accounts) =
Helpers.Baking.mine blkid b1 [] >>=? fun blkh ->
Helpers.Baking.bake blkid b1 [] >>=? fun blkh ->
let foo = Helpers.Account.create "foo" in
let bar = Helpers.Account.create "bar" in

View File

@ -20,11 +20,11 @@ let print_level head =
let run_change_to_demo_proto block
({ b1 ; b2 ; b3 ; b4 ; b5 } : Account.bootstrap_accounts) =
Baking.mine block b1 [] >>=? fun head ->
Baking.bake block b1 [] >>=? fun head ->
Format.eprintf "Entering `Proposal` voting period@.";
Assert.check_voting_period_kind ~msg:__LOC__ ~block:(`Hash head)
Voting_period.Proposal >>=? fun () ->
Baking.mine (`Hash head) b2 [] >>=? fun head ->
Baking.bake (`Hash head) b2 [] >>=? fun head ->
(* 1. Propose the 'demo' protocol as b1 (during the Proposal period) *)
Protocol.proposals
@ -33,9 +33,9 @@ let run_change_to_demo_proto block
[demo_protocol] >>=? fun op ->
(* Mine blocks to switch to next vote period (Testing_vote) *)
Baking.mine (`Hash head) b3 [op] >>=? fun head ->
Baking.bake (`Hash head) b3 [op] >>=? fun head ->
Format.eprintf "Entering `Testing_vote` voting period@.";
Baking.mine (`Hash head) b4 [] >>=? fun head ->
Baking.bake (`Hash head) b4 [] >>=? fun head ->
Assert.check_voting_period_kind ~msg:__LOC__ ~block:(`Hash head)
Voting_period.Testing_vote >>=? fun () ->
@ -54,18 +54,18 @@ let run_change_to_demo_proto block
all_accounts >>=? fun operations ->
(* Mine blocks to switch to next vote period (Testing) *)
Baking.mine (`Hash head) b5 operations >>=? fun head ->
Baking.bake (`Hash head) b5 operations >>=? fun head ->
Format.eprintf "Entering `Testing` voting period@.";
Baking.mine (`Hash head) b1 [] >>=? fun head ->
Baking.bake (`Hash head) b1 [] >>=? fun head ->
Assert.check_voting_period_kind ~msg:__LOC__ ~block:(`Hash head)
Voting_period.Testing >>=? fun () ->
(* 3. Test the proposed protocol *)
(* Mine blocks to switch to next vote period (Promote_vote) *)
Baking.mine (`Hash head) b2 [] >>=? fun head ->
Baking.bake (`Hash head) b2 [] >>=? fun head ->
Format.eprintf "Entering `Promote_vote` voting period@.";
Baking.mine (`Hash head) b3 [] >>=? fun head ->
Baking.bake (`Hash head) b3 [] >>=? fun head ->
Assert.check_voting_period_kind ~msg:__LOC__ ~block:(`Hash head)
Voting_period.Promotion_vote >>=? fun () ->
@ -75,8 +75,8 @@ let run_change_to_demo_proto block
(* Mine blocks to switch to end the vote cycle (back to Proposal) *)
Format.eprintf "Switching to `demo` protocol@.";
Baking.mine (`Hash head) b4 operations >>=? fun head ->
Baking.mine (`Hash head) b5 [] >>=? fun head ->
Baking.bake (`Hash head) b4 operations >>=? fun head ->
Baking.bake (`Hash head) b5 [] >>=? fun head ->
Assert.check_protocol
~msg:__LOC__ ~block:(`Hash head) demo_protocol >>=? fun () ->

View File

@ -33,7 +33,7 @@ $client get balance for $key2 | assert "999.95 ꜩ"
# wait for the delay between two block
sleep 1
$client mine for bootstrap1 -max-priority 512
$client bake for bootstrap1 -max-priority 512
$client remember program noop file:contracts/noop.tz
$client typecheck program noop

View File

@ -72,16 +72,16 @@ retry() {
retry 2 15 assert_protocol "ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK"
$client1 mine for bootstrap1 -max-priority 512
$client1 bake for bootstrap1 -max-priority 512
retry 2 15 assert_propagation_level 2
$client2 mine for bootstrap2 -max-priority 512
$client2 bake for bootstrap2 -max-priority 512
retry 2 15 assert_propagation_level 3
$client3 mine for bootstrap3 -max-priority 512
$client3 bake for bootstrap3 -max-priority 512
retry 2 15 assert_propagation_level 4
$client4 mine for bootstrap4 -max-priority 512
$client4 bake for bootstrap4 -max-priority 512
retry 2 15 assert_propagation_level 5
endorse_hash=$($client3 endorse for bootstrap3 | extract_operation_hash)
@ -100,7 +100,7 @@ assert_contains_operation() {
done
}
$client4 mine for bootstrap4 -max-priority 512
$client4 bake for bootstrap4 -max-priority 512
retry 2 15 assert_contains_operation $endorse_hash
retry 2 15 assert_contains_operation $transfer_hash