|
|
@ -18,53 +18,39 @@ import tech.pegasys.pantheon.tests.acceptance.dsl.AcceptanceTestBase; |
|
|
|
import tech.pegasys.pantheon.tests.acceptance.dsl.node.PantheonNode; |
|
|
|
import tech.pegasys.pantheon.tests.acceptance.dsl.node.PantheonNode; |
|
|
|
|
|
|
|
|
|
|
|
import org.junit.Before; |
|
|
|
import org.junit.Before; |
|
|
|
import org.junit.Ignore; |
|
|
|
|
|
|
|
import org.junit.Test; |
|
|
|
import org.junit.Test; |
|
|
|
|
|
|
|
|
|
|
|
@Ignore |
|
|
|
|
|
|
|
public class CliqueGetSignersRpcTest extends AcceptanceTestBase { |
|
|
|
public class CliqueGetSignersRpcTest extends AcceptanceTestBase { |
|
|
|
private PantheonNode minerNode1; |
|
|
|
private PantheonNode minerNode1; |
|
|
|
private PantheonNode minerNode2; |
|
|
|
private PantheonNode minerNode2; |
|
|
|
private PantheonNode minerNode3; |
|
|
|
|
|
|
|
private PantheonNode[] allNodes; |
|
|
|
|
|
|
|
private PantheonNode[] initialNodes; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Before |
|
|
|
@Before |
|
|
|
public void setUp() throws Exception { |
|
|
|
public void setUp() throws Exception { |
|
|
|
final String[] validators = {"miner1", "miner2"}; |
|
|
|
final String[] validators = {"miner1"}; |
|
|
|
minerNode1 = pantheon.createCliqueNodeWithValidators("miner1", validators); |
|
|
|
minerNode1 = pantheon.createCliqueNodeWithValidators("miner1", validators); |
|
|
|
minerNode2 = pantheon.createCliqueNodeWithValidators("miner2", validators); |
|
|
|
minerNode2 = pantheon.createCliqueNodeWithValidators("miner2", validators); |
|
|
|
minerNode3 = pantheon.createCliqueNodeWithValidators("miner3", validators); |
|
|
|
cluster.start(minerNode1, minerNode2); |
|
|
|
initialNodes = new PantheonNode[] {minerNode1, minerNode2}; |
|
|
|
|
|
|
|
allNodes = new PantheonNode[] {minerNode1, minerNode2, minerNode3}; |
|
|
|
|
|
|
|
cluster.start(allNodes); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void shouldBeAbleToGetValidatorsForBlockNumber() { |
|
|
|
public void shouldBeAbleToGetValidatorsForBlockNumber() { |
|
|
|
cluster.verify(clique.validatorsAtBlockEqual("0x0", initialNodes)); |
|
|
|
cluster.verify(clique.validatorsAtBlockEqual("0x0", minerNode1)); |
|
|
|
cluster.waitUntil(wait.chainHeadIsAt(1)); |
|
|
|
minerNode1.waitUntil(wait.chainHeadIsAt(1)); |
|
|
|
minerNode1.execute(cliqueTransactions.createAddProposal(minerNode3)); |
|
|
|
|
|
|
|
minerNode2.execute(cliqueTransactions.createAddProposal(minerNode3)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
minerNode1.execute(cliqueTransactions.createAddProposal(minerNode2)); |
|
|
|
cluster.waitUntil(wait.chainHeadHasProgressed(minerNode1, 1)); |
|
|
|
cluster.waitUntil(wait.chainHeadHasProgressed(minerNode1, 1)); |
|
|
|
cluster.verify(clique.validatorsAtBlockEqual("0x2", initialNodes)); |
|
|
|
cluster.verify(clique.validatorsAtBlockEqual("0x2", minerNode1, minerNode2)); |
|
|
|
|
|
|
|
cluster.verify(clique.validatorsAtBlockEqual(LATEST, minerNode1, minerNode2)); |
|
|
|
minerNode1.waitUntil(wait.chainHeadHasProgressed(minerNode1, 1)); |
|
|
|
|
|
|
|
cluster.verify(clique.validatorsAtBlockEqual("0x3", allNodes)); |
|
|
|
|
|
|
|
cluster.verify(clique.validatorsAtBlockEqual(LATEST, allNodes)); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void shouldBeAbleToGetValidatorsForBlockHash() { |
|
|
|
public void shouldBeAbleToGetValidatorsForBlockHash() { |
|
|
|
cluster.verify(clique.validatorsAtBlockHashFromBlockNumberEqual(minerNode1, 0, initialNodes)); |
|
|
|
cluster.verify(clique.validatorsAtBlockHashFromBlockNumberEqual(minerNode1, 0, minerNode1)); |
|
|
|
minerNode1.execute(cliqueTransactions.createAddProposal(minerNode3)); |
|
|
|
minerNode1.waitUntil(wait.chainHeadIsAt(1)); |
|
|
|
minerNode2.execute(cliqueTransactions.createAddProposal(minerNode3)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
minerNode1.waitUntil(wait.chainHeadHasProgressed(minerNode1, 1)); |
|
|
|
|
|
|
|
cluster.verify(clique.validatorsAtBlockHashFromBlockNumberEqual(minerNode1, 1, initialNodes)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
minerNode1.waitUntil(wait.chainHeadHasProgressed(minerNode1, 1)); |
|
|
|
minerNode1.execute(cliqueTransactions.createAddProposal(minerNode2)); |
|
|
|
cluster.verify(clique.validatorsAtBlockHashFromBlockNumberEqual(minerNode1, 3, allNodes)); |
|
|
|
cluster.waitUntil(wait.chainHeadHasProgressed(minerNode1, 1)); |
|
|
|
|
|
|
|
cluster.verify( |
|
|
|
|
|
|
|
clique.validatorsAtBlockHashFromBlockNumberEqual(minerNode1, 2, minerNode1, minerNode2)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|