diff --git a/src/proto_alpha/lib_protocol/init_storage.ml b/src/proto_alpha/lib_protocol/init_storage.ml index b0de089b17e9e7d7e9b150b272a56b978b5f9484..2e49c84bf06279f343477bc3630377140701f48f 100644 --- a/src/proto_alpha/lib_protocol/init_storage.ml +++ b/src/proto_alpha/lib_protocol/init_storage.ml @@ -70,7 +70,11 @@ module Patch_dictator_for_ghostnet = struct let patch_constant chain_id ctxt = if Chain_id.equal chain_id ghostnet_id then Raw_context.patch_constants ctxt (fun c -> - {c with testnet_dictator = Some oxhead_testnet_baker}) + { + c with + testnet_dictator = Some oxhead_testnet_baker; + cycles_per_voting_period = 1l; + }) else Lwt.return ctxt end diff --git a/tezt/tests/ghostnet_dictator_migration.ml b/tezt/tests/ghostnet_dictator_migration.ml index 638fb23d277860ed5cfe277bfacc7d1a967d1c86..843cccd4baeae3b16faa3b115b732cc55153add5 100644 --- a/tezt/tests/ghostnet_dictator_migration.ml +++ b/tezt/tests/ghostnet_dictator_migration.ml @@ -79,7 +79,7 @@ let init chain_id ~from_protocol ~to_protocol = ~base:(Right (from_protocol, None)) [ (["blocks_per_cycle"], Some "4"); - (["cycles_per_voting_period"], Some "1"); + (["cycles_per_voting_period"], Some "2"); ] in let* () = @@ -110,13 +110,26 @@ let register_migration_test chain_id = client (Protocol.hash from_protocol, Protocol.hash to_protocol) in - let expected_dictator = + let expected_dictator, expected_remaining = match chain_id with | Chain_id_ghostnet when to_protocol = Alpha -> - Some "tz1Xf8zdT3DbAX9cHw3c3CXh79rc4nK4gCe8" - | _ -> None + (Some "tz1Xf8zdT3DbAX9cHw3c3CXh79rc4nK4gCe8", 1) + | _ -> (None, 5) in - check_dictator client expected_dictator + + let* () = check_dictator client expected_dictator in + let* () = + Voting.check_current_period + client + { + Voting.index = 0; + kind = Proposal; + start_position = 0; + position = 2; + remaining = expected_remaining; + } + in + return () let register ~protocols = (* Testing migration with the chain_id of Ghostnet.