Skip to content

Commit

Permalink
QuorumPreimage test: Reduce quorum threshold
Browse files Browse the repository at this point in the history
  • Loading branch information
hewison-chris committed Mar 14, 2022
1 parent 1636658 commit c05fa03
Showing 1 changed file with 24 additions and 22 deletions.
46 changes: 24 additions & 22 deletions source/agora/test/QuorumPreimage.d
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ unittest
};
conf.node.network_discovery_interval = 2.seconds;
conf.node.retry_delay = 250.msecs;
conf.consensus.quorum_threshold = 51;

auto network = makeTestNetwork!TestAPIManager(conf);
network.start();
scope(exit) network.shutdown();
Expand Down Expand Up @@ -64,22 +66,22 @@ unittest

enum quorums_1 = [
// 0
QuorumConfig(4, [0, 1, 3, 4, 5]),
QuorumConfig(3, [0, 1, 3, 4, 5]),

// 1
QuorumConfig(4, [0, 1, 2, 3, 4]),
QuorumConfig(3, [0, 1, 2, 3, 4]),

// 2
QuorumConfig(4, [0, 2, 3, 4, 5]),
QuorumConfig(3, [0, 2, 3, 4, 5]),

// 3
QuorumConfig(4, [0, 1, 2, 3, 5]),
QuorumConfig(3, [0, 1, 2, 3, 5]),

// 4
QuorumConfig(4, [0, 1, 2, 4, 5]),
QuorumConfig(3, [0, 1, 2, 4, 5]),

// 5
QuorumConfig(4, [0, 2, 3, 4, 5]),
QuorumConfig(3, [0, 2, 3, 4, 5]),

QuorumConfig.init,
QuorumConfig.init,
Expand Down Expand Up @@ -120,28 +122,28 @@ unittest

enum quorums_2 = [
// 0
QuorumConfig(5, [0, 1, 3, 4, 6, 7]),
QuorumConfig(4, [0, 1, 3, 4, 6, 7]),

// 1
QuorumConfig(5, [0, 1, 3, 4, 5, 6]),
QuorumConfig(4, [0, 1, 3, 4, 5, 6]),

// 2
QuorumConfig(5, [0, 1, 3, 4, 5, 6]),
QuorumConfig(4, [0, 1, 3, 4, 5, 6]),

// 3
QuorumConfig(5, [0, 1, 3, 4, 5, 6]),
QuorumConfig(4, [0, 1, 3, 4, 5, 6]),

// 4
QuorumConfig(5, [0, 1, 3, 4, 5, 6]),
QuorumConfig(4, [0, 1, 3, 4, 5, 6]),

// 5
QuorumConfig(5, [0, 1, 3, 4, 5, 6]),
QuorumConfig(4, [0, 1, 3, 4, 5, 6]),

// 6
QuorumConfig(5, [0, 1, 2, 3, 4, 5]),
QuorumConfig(4, [0, 1, 2, 3, 4, 5]),

// 7
QuorumConfig(5, [0, 1, 3, 4, 5, 7]),
QuorumConfig(4, [0, 1, 3, 4, 5, 7]),
];

static assert(quorums_1 != quorums_2);
Expand Down Expand Up @@ -173,28 +175,28 @@ unittest
// which use a different preimage
enum quorums_3 = [
// 0
QuorumConfig(5, [0, 1, 3, 4, 5, 6]),
QuorumConfig(4, [0, 1, 3, 4, 5, 6]),

// 1
QuorumConfig(5, [0, 1, 3, 4, 5, 6]),
QuorumConfig(4, [0, 1, 3, 4, 5, 6]),

// 2
QuorumConfig(5, [0, 1, 3, 4, 5, 6]),
QuorumConfig(4, [0, 1, 3, 4, 5, 6]),

// 3
QuorumConfig(5, [0, 1, 3, 4, 5, 6]),
QuorumConfig(4, [0, 1, 3, 4, 5, 6]),

// 4
QuorumConfig(5, [0, 1, 3, 4, 5, 6]),
QuorumConfig(4, [0, 1, 3, 4, 5, 6]),

// 5
QuorumConfig(5, [0, 1, 3, 4, 5, 6]),
QuorumConfig(4, [0, 1, 3, 4, 5, 6]),

// 6
QuorumConfig(5, [1, 2, 3, 4, 5, 6]),
QuorumConfig(4, [1, 2, 3, 4, 5, 6]),

// 7
QuorumConfig(5, [0, 1, 4, 5, 6, 7]),
QuorumConfig(4, [0, 1, 4, 5, 6, 7]),
];

static assert(quorums_2 != quorums_3);
Expand Down

0 comments on commit c05fa03

Please sign in to comment.