diff --git a/src/proto_alpha/lib_protocol/src/alpha_context.ml b/src/proto_alpha/lib_protocol/src/alpha_context.ml index 15e14aa9b..f5ec8d9e5 100644 --- a/src/proto_alpha/lib_protocol/src/alpha_context.ml +++ b/src/proto_alpha/lib_protocol/src/alpha_context.ml @@ -107,8 +107,5 @@ let configure_sandbox = Raw_context.configure_sandbox let activate = Raw_context.activate let fork_test_chain = Raw_context.fork_test_chain -let faucet_count = Raw_context.faucet_count -let incr_faucet_count = Raw_context.incr_faucet_count - let endorsement_already_recorded = Raw_context.endorsement_already_recorded let record_endorsement = Raw_context.record_endorsement diff --git a/src/proto_alpha/lib_protocol/src/alpha_context.mli b/src/proto_alpha/lib_protocol/src/alpha_context.mli index 9657753c9..e83676a26 100644 --- a/src/proto_alpha/lib_protocol/src/alpha_context.mli +++ b/src/proto_alpha/lib_protocol/src/alpha_context.mli @@ -769,9 +769,3 @@ val fork_test_chain: context -> Protocol_hash.t -> Time.t -> context Lwt.t val endorsement_already_recorded: context -> int -> bool val record_endorsement: context -> int -> context - -(**/**) - -(* HACK alphanet *) -val faucet_count: context -> int -val incr_faucet_count: context -> context diff --git a/src/proto_alpha/lib_protocol/src/apply.ml b/src/proto_alpha/lib_protocol/src/apply.ml index 379faa685..ff6676384 100644 --- a/src/proto_alpha/lib_protocol/src/apply.ml +++ b/src/proto_alpha/lib_protocol/src/apply.ml @@ -15,7 +15,6 @@ type error += Wrong_voting_period of Voting_period.t * Voting_period.t (* `Tempo type error += Wrong_endorsement_predecessor of Block_hash.t * Block_hash.t (* `Temporary *) type error += Duplicate_endorsement of int (* `Branch *) type error += Bad_contract_parameter of Contract.t * Script.expr option * Script.expr option (* `Permanent *) -type error += Too_many_faucet type error += Invalid_endorsement_level type error += Invalid_commitment of { expected: bool } @@ -87,17 +86,6 @@ let () = Data_encoding.(obj1 (req "slot" uint16)) (function Duplicate_endorsement k -> Some k | _ -> None) (fun k -> Duplicate_endorsement k); - register_error_kind - `Temporary - ~id:"operation.too_many_faucet" - ~title:"Too many faucet" - ~description:"Trying to include a faucet operation in a block \ - \ with more than 5 faucet operations." - ~pp:(fun ppf () -> - Format.fprintf ppf "Too many faucet operation.") - Data_encoding.unit - (function Too_many_faucet -> Some () | _ -> None) - (fun () -> Too_many_faucet) ; register_error_kind `Temporary ~id:"operation.invalid_endorsement_level" @@ -556,16 +544,11 @@ let apply_anonymous_operation ctxt delegate origination_nonce kind = | Error _ -> Tez.zero in return (ctxt, origination_nonce, Tez.zero, reward) | Faucet { id = manager ; _ } -> - (* Free tez for all! *) - if Compare.Int.(faucet_count ctxt < 5) then - let ctxt = incr_faucet_count ctxt in - Contract.originate ctxt - origination_nonce - ~manager ~delegate ~balance:Constants.faucet_credit ?script:None - ~spendable:true ~delegatable:true >>=? fun (ctxt, _, origination_nonce) -> - return (ctxt, origination_nonce, Tez.zero, Tez.zero) - else - fail Too_many_faucet + Contract.originate ctxt + origination_nonce + ~manager ~delegate ~balance:Constants.faucet_credit ?script:None + ~spendable:true ~delegatable:true >>=? fun (ctxt, _, origination_nonce) -> + return (ctxt, origination_nonce, Tez.zero, Tez.zero) let apply_operation ctxt delegate pred_block block_prio hash operation = diff --git a/src/proto_alpha/lib_protocol/src/raw_context.ml b/src/proto_alpha/lib_protocol/src/raw_context.ml index 62e26aa69..1d4a47a86 100644 --- a/src/proto_alpha/lib_protocol/src/raw_context.ml +++ b/src/proto_alpha/lib_protocol/src/raw_context.ml @@ -16,7 +16,6 @@ type t = { level: Level_repr.t ; timestamp: Time.t ; fitness: Int64.t ; - faucet_count: int; endorsements_received: Int_set.t; } @@ -27,14 +26,12 @@ let current_level ctxt = ctxt.level let current_timestamp ctxt = ctxt.timestamp let current_fitness ctxt = ctxt.fitness let first_level ctxt = ctxt.first_level -let faucet_count ctxt = ctxt.faucet_count let constants ctxt = ctxt.constants let recover ctxt = ctxt.context let record_endorsement ctxt k = { ctxt with endorsements_received = Int_set.add k ctxt.endorsements_received } let endorsement_already_recorded ctxt k = Int_set.mem k ctxt.endorsements_received -let incr_faucet_count ctxt = { ctxt with faucet_count = ctxt.faucet_count + 1 } let set_current_fitness ctxt fitness = { ctxt with fitness } type storage_error = @@ -211,8 +208,8 @@ let prepare ~level ~timestamp ~fitness ctxt = ~blocks_per_commitment:constants.Constants_repr.blocks_per_commitment level in return ({ context = ctxt ; constants ; level ; - faucet_count = 0 ; endorsements_received = Int_set.empty ; timestamp ; fitness ; first_level ; + endorsements_received = Int_set.empty ; }, first_block) @@ -231,7 +228,6 @@ let register_resolvers enc resolve = level = Level_repr.root Raw_level_repr.root ; timestamp = Time.of_seconds 0L ; fitness = 0L ; - faucet_count = 0 ; endorsements_received = Int_set.empty ; } in resolve faked_context str in diff --git a/src/proto_alpha/lib_protocol/src/raw_context.mli b/src/proto_alpha/lib_protocol/src/raw_context.mli index 35ed54d15..3d8fbbfc3 100644 --- a/src/proto_alpha/lib_protocol/src/raw_context.mli +++ b/src/proto_alpha/lib_protocol/src/raw_context.mli @@ -138,8 +138,3 @@ include T with type t := t and type context := context val record_endorsement: context -> int -> context val endorsement_already_recorded: context -> int -> bool - -(** HACK alphanet *) -val double_roll_value: context -> int -> context tzresult Lwt.t -val faucet_count: context -> int -val incr_faucet_count: context -> context diff --git a/src/proto_alpha/lib_protocol/src/roll_storage.mli b/src/proto_alpha/lib_protocol/src/roll_storage.mli index 8c3d680c7..a82a0558b 100644 --- a/src/proto_alpha/lib_protocol/src/roll_storage.mli +++ b/src/proto_alpha/lib_protocol/src/roll_storage.mli @@ -74,5 +74,3 @@ val delegate_pubkey: val get_contract_delegate: Raw_context.t -> Contract_repr.t -> Ed25519.Public_key_hash.t option tzresult Lwt.t - -val value: Raw_context.t -> Tez_repr.t