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 30, 2022
1 parent 75c421a commit fdc6b0a
Showing 1 changed file with 23 additions and 22 deletions.
45 changes: 23 additions & 22 deletions source/agora/test/QuorumPreimage.d
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ unittest
};
conf.node.network_discovery_interval = 2.seconds;
conf.node.retry_delay = 250.msecs;
conf.consensus.quorum_threshold = 60;
auto network = makeTestNetwork!TestAPIManager(conf);
network.start();
scope(exit) network.shutdown();
Expand Down Expand Up @@ -63,22 +64,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 @@ -119,28 +120,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 All @@ -165,28 +166,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 fdc6b0a

Please sign in to comment.