From 19d9ce1f647d9796b2055f2b71b326f2c31376bd Mon Sep 17 00:00:00 2001 From: Benjamin Canou Date: Sun, 18 Mar 2018 18:11:04 +0100 Subject: [PATCH] Alpha: fix tests --- src/bin_client/test/sandbox.json | 17 +++++++++-------- .../lib_baking/test/sandbox-vote.json | 12 ++++++------ src/proto_alpha/lib_baking/test/sandbox.json | 8 ++++---- .../lib_baking/test/test_endorsement.ml | 4 ++-- 4 files changed, 21 insertions(+), 20 deletions(-) diff --git a/src/bin_client/test/sandbox.json b/src/bin_client/test/sandbox.json index 5aff1f9b2..e1e382b24 100644 --- a/src/bin_client/test/sandbox.json +++ b/src/bin_client/test/sandbox.json @@ -2,14 +2,15 @@ "genesis_pubkey": "edpkuSLWfVU1Vq7Jg9FucPyKmma6otcMHac9zG4oU1KMHSTBpJuGQ2", "bootstrap_keys": [ - "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav", - "edpktzNbDAUjUk697W7gYg2CRuBQjyPxbEg8dLccYYwKSKvkPvjtV9", - "edpkuTXkJDGcFd5nh6VvMz8phXxU3Bi7h6hqgywNFi1vZTfQNnS1RV", - "edpkuFrRoDSEbJYgxRtLx2ps82UdaYc1WwfS9sE11yhauZt5DgCHbU", - "edpkv8EUUH68jmo3f7Um5PezmfGrRF24gnfLpH3sVNwJnV5bVCxL2n" + "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav", + "edpktzNbDAUjUk697W7gYg2CRuBQjyPxbEg8dLccYYwKSKvkPvjtV9", + "edpkuTXkJDGcFd5nh6VvMz8phXxU3Bi7h6hqgywNFi1vZTfQNnS1RV", + "edpkuFrRoDSEbJYgxRtLx2ps82UdaYc1WwfS9sE11yhauZt5DgCHbU", + "edpkv8EUUH68jmo3f7Um5PezmfGrRF24gnfLpH3sVNwJnV5bVCxL2n" ], - "slot_durations" : [ 1, 0 ], - "cycle_length" : 128, - "block_per_roll_snapshot" : 32, + "time_between_blocks" : [ 1, 0 ], + "blocks_per_cycle" : 128, + "blocks_per_roll_snapshot" : 32, + "preserved_cycles" : 1, "first_free_baking_slot" : 4 } diff --git a/src/proto_alpha/lib_baking/test/sandbox-vote.json b/src/proto_alpha/lib_baking/test/sandbox-vote.json index f49e4424f..69fbaa1ba 100644 --- a/src/proto_alpha/lib_baking/test/sandbox-vote.json +++ b/src/proto_alpha/lib_baking/test/sandbox-vote.json @@ -8,10 +8,10 @@ "edpkuFrRoDSEbJYgxRtLx2ps82UdaYc1WwfS9sE11yhauZt5DgCHbU", "edpkv8EUUH68jmo3f7Um5PezmfGrRF24gnfLpH3sVNwJnV5bVCxL2n" ], - "slot_durations" : [ 1, 0 ], - "cycle_length" : 4, - "block_per_roll_snapshot" : 2, - "voting_period_length" : 2, - "time_before_reward" : 1, - "first_free_baking_slot" : 4 + "time_between_blocks" : [ 1, 0 ], + "blocks_per_cycle" : 4, + "blocks_per_roll_snapshot" : 2, + "preserved_cycles" : 1, + "first_free_baking_slot" : 4, + "blocks_per_voting_period": 2 } diff --git a/src/proto_alpha/lib_baking/test/sandbox.json b/src/proto_alpha/lib_baking/test/sandbox.json index 5466b46d4..81b7df766 100644 --- a/src/proto_alpha/lib_baking/test/sandbox.json +++ b/src/proto_alpha/lib_baking/test/sandbox.json @@ -8,9 +8,9 @@ "edpkuFrRoDSEbJYgxRtLx2ps82UdaYc1WwfS9sE11yhauZt5DgCHbU", "edpkv8EUUH68jmo3f7Um5PezmfGrRF24gnfLpH3sVNwJnV5bVCxL2n" ], - "slot_durations" : [ 1, 0 ], - "cycle_length" : 4, - "block_per_roll_snapshot" : 2, - "time_before_reward" : 1, + "time_between_blocks" : [ 1, 0 ], + "blocks_per_cycle" : 4, + "blocks_per_roll_snapshot" : 2, + "preserved_cycles" : 1, "first_free_baking_slot" : 4 } diff --git a/src/proto_alpha/lib_baking/test/test_endorsement.ml b/src/proto_alpha/lib_baking/test/test_endorsement.ml index 7d120018e..7ef632235 100644 --- a/src/proto_alpha/lib_baking/test/test_endorsement.ml +++ b/src/proto_alpha/lib_baking/test/test_endorsement.ml @@ -92,7 +92,7 @@ let test_invalid_endorsement_slot contract block = Helpers.Endorse.endorse ~slot:16 contract block >>=? fun op -> Helpers.Baking.bake block contract [ op ] >>= fun res -> Assert.failed_to_preapply ~msg:__LOC__ ~op begin function - | Baking.Invalid_endorsement_slot _ -> true + | Operation.Invalid_signature -> true | _ -> false end res ; return () @@ -211,7 +211,7 @@ let run genesis = Assert.equal_bool ~msg:__LOC__ has_right_to_endorse true ; Assert.balance_equal - ~block:block ~msg:__LOC__ b1 3_999_000_000_000L >>=? fun () -> + ~block:block ~msg:__LOC__ b1 3_999_488_000_000L >>=? fun () -> Assert.balance_equal ~block:block ~msg:__LOC__ b2 4_000_000_000_000L >>=? fun () -> Assert.balance_equal