diff --git a/src/proto/bootstrap/amendment.ml b/src/proto/bootstrap/amendment.ml index 4771bfea4..217445196 100644 --- a/src/proto/bootstrap/amendment.ml +++ b/src/proto/bootstrap/amendment.ml @@ -54,12 +54,12 @@ let start_new_voting_cycle ctxt = Vote.clear_listings ctxt >>=? fun ctxt -> match select_winning_proposal proposals with | None -> - Vote.froze_listings ctxt >>=? fun ctxt -> + Vote.freeze_listings ctxt >>=? fun ctxt -> Vote.clear_current_proposal ctxt >>=? fun ctxt -> return ctxt | Some proposal -> Vote.set_current_proposal ctxt proposal >>=? fun ctxt -> - Vote.froze_listings ctxt >>=? fun ctxt -> + Vote.freeze_listings ctxt >>=? fun ctxt -> Vote.set_current_period_kind ctxt Testing_vote >>=? fun ctxt -> return ctxt end @@ -75,11 +75,11 @@ let start_new_voting_cycle ctxt = return ctxt else Vote.clear_current_proposal ctxt >>=? fun ctxt -> - Vote.froze_listings ctxt >>=? fun ctxt -> + Vote.freeze_listings ctxt >>=? fun ctxt -> Vote.set_current_period_kind ctxt Proposal >>=? fun ctxt -> return ctxt | Testing -> - Vote.froze_listings ctxt >>=? fun ctxt -> + Vote.freeze_listings ctxt >>=? fun ctxt -> Vote.set_current_period_kind ctxt Promotion_vote >>=? fun ctxt -> return ctxt | Promotion_vote -> @@ -95,7 +95,7 @@ let start_new_voting_cycle ctxt = Vote.clear_ballots ctxt >>= fun ctxt -> Vote.clear_listings ctxt >>=? fun ctxt -> Vote.clear_current_proposal ctxt >>=? fun ctxt -> - Vote.froze_listings ctxt >>=? fun ctxt -> + Vote.freeze_listings ctxt >>=? fun ctxt -> Vote.set_current_period_kind ctxt Proposal >>=? fun ctxt -> return ctxt diff --git a/src/proto/bootstrap/apply.ml b/src/proto/bootstrap/apply.ml index 1248cd8f4..531498e4e 100644 --- a/src/proto/bootstrap/apply.ml +++ b/src/proto/bootstrap/apply.ml @@ -184,7 +184,7 @@ let may_start_new_cycle ctxt = Seed.clear_cycle ctxt last_cycle >>=? fun ctxt -> Seed.compute_for_cycle ctxt (Cycle.succ new_cycle) >>=? fun ctxt -> Roll.clear_cycle ctxt last_cycle >>=? fun ctxt -> - Roll.froze_rolls_for_cycle ctxt (Cycle.succ new_cycle) >>=? fun ctxt -> + Roll.freeze_rolls_for_cycle ctxt (Cycle.succ new_cycle) >>=? fun ctxt -> Timestamp.get_current ctxt >>=? fun timestamp -> Lwt.return (Timestamp.(timestamp +? (Constants.time_before_reward ctxt))) >>=? fun reward_date -> diff --git a/src/proto/bootstrap/init_storage.ml b/src/proto/bootstrap/init_storage.ml index 4d044d6b6..b53baa0b0 100644 --- a/src/proto/bootstrap/init_storage.ml +++ b/src/proto/bootstrap/init_storage.ml @@ -25,9 +25,9 @@ let initialize (ctxt:Context.t) = Contract_storage.init store >>=? fun store -> Reward_storage.init store >>=? fun store -> Bootstrap_storage.init store >>=? fun store -> - Roll_storage.froze_rolls_for_cycle + Roll_storage.freeze_rolls_for_cycle store Cycle_repr.root >>=? fun store -> - Roll_storage.froze_rolls_for_cycle + Roll_storage.freeze_rolls_for_cycle store Cycle_repr.(succ root) >>=? fun store -> Vote_storage.init store >>=? fun store -> return store diff --git a/src/proto/bootstrap/roll_storage.ml b/src/proto/bootstrap/roll_storage.ml index c7d1e7069..999bb988f 100644 --- a/src/proto/bootstrap/roll_storage.ml +++ b/src/proto/bootstrap/roll_storage.ml @@ -42,7 +42,7 @@ let fold ctxt ~f init = loop ctxt (Roll_repr.succ roll) (f roll contract acc) in loop ctxt Roll_repr.first (return init) -let froze_rolls_for_cycle ctxt cycle = +let freeze_rolls_for_cycle ctxt cycle = fold ctxt (ctxt, Roll_repr.first) ~f:(fun roll contract (ctxt, promoted_roll as acc) -> get_contract_delegate ctxt contract >>=? function diff --git a/src/proto/bootstrap/roll_storage.mli b/src/proto/bootstrap/roll_storage.mli index 6bfdcff77..5141c9b79 100644 --- a/src/proto/bootstrap/roll_storage.mli +++ b/src/proto/bootstrap/roll_storage.mli @@ -28,7 +28,7 @@ val fold : f:(Roll_repr.roll -> Contract_repr.t -> 'a -> 'a tzresult Lwt.t) -> 'a -> 'a tzresult Lwt.t -val froze_rolls_for_cycle : +val freeze_rolls_for_cycle : Storage.t -> Cycle_repr.t -> Storage.t tzresult Lwt.t val clear_cycle : diff --git a/src/proto/bootstrap/tezos_context.mli b/src/proto/bootstrap/tezos_context.mli index 587b712b1..15a935db7 100644 --- a/src/proto/bootstrap/tezos_context.mli +++ b/src/proto/bootstrap/tezos_context.mli @@ -397,7 +397,7 @@ module Vote : sig context -> int32 Protocol_hash_map.t tzresult Lwt.t val clear_proposals: context -> context tzresult Lwt.t - val froze_listings: context -> context tzresult Lwt.t + val freeze_listings: context -> context tzresult Lwt.t val clear_listings: context -> context tzresult Lwt.t val listing_size: context -> int32 tzresult Lwt.t val in_listings: context -> public_key_hash -> bool Lwt.t @@ -554,7 +554,7 @@ end module Roll : sig - val froze_rolls_for_cycle: context -> Cycle.t -> context tzresult Lwt.t + val freeze_rolls_for_cycle: context -> Cycle.t -> context tzresult Lwt.t val clear_cycle: context -> Cycle.t -> context tzresult Lwt.t val mining_rights_owner: diff --git a/src/proto/bootstrap/vote_storage.ml b/src/proto/bootstrap/vote_storage.ml index 51f886af1..226f37cbe 100644 --- a/src/proto/bootstrap/vote_storage.ml +++ b/src/proto/bootstrap/vote_storage.ml @@ -45,7 +45,7 @@ let get_ballots ctxt = let clear_ballots = Storage.Vote.Ballots.clear -let froze_listings ctxt = +let freeze_listings ctxt = Roll_storage.fold ctxt (ctxt, 0l) ~f:(fun _roll contract (ctxt, total as acc) -> Contract_storage.get_delegate_opt ctxt contract >>=? function diff --git a/src/proto/bootstrap/vote_storage.mli b/src/proto/bootstrap/vote_storage.mli index 28159dacc..010a822fd 100644 --- a/src/proto/bootstrap/vote_storage.mli +++ b/src/proto/bootstrap/vote_storage.mli @@ -28,7 +28,7 @@ val record_ballot: val get_ballots: Storage.t -> ballots tzresult Lwt.t val clear_ballots: Storage.t -> Storage.t Lwt.t -val froze_listings: Storage.t -> Storage.t tzresult Lwt.t +val freeze_listings: Storage.t -> Storage.t tzresult Lwt.t val clear_listings: Storage.t -> Storage.t tzresult Lwt.t val listing_size: Storage.t -> int32 tzresult Lwt.t