Alpha: rename endorsement_bond_cost into endorsement_security_deposit

This commit is contained in:
Grégoire Henry 2018-03-15 15:07:06 +01:00 committed by Benjamin Canou
parent 74d334463e
commit 6b53e3f578
6 changed files with 9 additions and 9 deletions

View File

@ -107,7 +107,7 @@ let test_endorsement_rewards block0 =
done ;
return (!account, !cpt) in
let bond = Tez.to_mutez Constants.endorsement_bond_cost in
let bond = Tez.to_mutez Constants.endorsement_security_deposit in
(* Endorsement Rights *)
(* #1 endorse & inject in a block *)

View File

@ -261,7 +261,7 @@ module Constants : sig
val seed_nonce_revelation_tip: Tez.t
val origination_burn: Tez.t
val block_security_deposit: Tez.t
val endorsement_bond_cost: Tez.t
val endorsement_security_deposit: Tez.t
val faucet_credit: Tez.t
val preserved_cycles: context -> int

View File

@ -140,7 +140,7 @@ let freeze_baking_bond ctxt { Block_header.priority ; _ } delegate =
return (ctxt, bond)
let freeze_endorsement_bond ctxt delegate =
let bond = Constants.endorsement_bond_cost in
let bond = Constants.endorsement_security_deposit in
Delegate.freeze_bond ctxt delegate bond
|> trace Cannot_freeze_endorsement_bond

View File

@ -44,7 +44,7 @@ val freeze_baking_bond:
(context * Tez.t) tzresult Lwt.t
(** [freeze_endorsement_bond: ctxt delegate]
Freeze the endorsement bond (See !Constants.endorsement_bond_cost)
Freeze the endorsement bond (See !Constants.endorsement_security_deposit)
from the delegate account.
Raise an error if the baker account does not have enough

View File

@ -25,7 +25,7 @@ let block_security_deposit =
Tez_repr.(mul_exn one 512)
(* 64 tez *)
let endorsement_bond_cost =
let endorsement_security_deposit =
Tez_repr.(mul_exn one 64)
(* 16 tez *)

View File

@ -69,14 +69,14 @@ let test_endorsement_payment () =
result.tezos_context protocol_data root.tezos_header.shell.timestamp
>>=? fun baker_pub ->
let baker_hpub = Ed25519.Public_key.hash baker_pub in
let endorsement_bond_cost =
Constants.endorsement_bond_cost in
let endorsement_security_deposit =
Constants.endorsement_security_deposit in
let baking = baker_hpub = contract_p.hpub && block_priority < 4 in
let block_security_deposit =
if baking
then Constants.block_security_deposit
else Tez.zero in
let cost = Cast.tez_add endorsement_bond_cost block_security_deposit in
let cost = Cast.tez_add endorsement_security_deposit block_security_deposit in
let expected_balance = Cast.tez_sub init_balance cost in
Assert.equal_tez ~msg: __LOC__ expected_balance bond_balance ;
(* After one cycle, (4 blocks in test/proto_alpha/sandbox),
@ -86,7 +86,7 @@ let test_endorsement_payment () =
get_balance_res contract_p result >>=? fun reward_balance ->
Proto_alpha.Baking.endorsement_reward ~block_priority >>=? fun reward ->
let expected_balance = Cast.tez_add expected_balance reward in
let expected_balance = Cast.tez_add expected_balance endorsement_bond_cost in
let expected_balance = Cast.tez_add expected_balance endorsement_security_deposit in
Assert.equal_tez ~msg: __LOC__ expected_balance reward_balance ;
return ()
in