Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

Clique acceptance tests #290

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
8699cb8
[NC-1524] Clique miner acceptance test
jframe Oct 16, 2018
bc2fccf
Merge branch 'master' into feature/NC-1524_clique_acceptance_tests
jframe Oct 18, 2018
907739d
[NC-1524] Clique miner acceptance test - create clique extra data dyn…
jframe Oct 18, 2018
3440d5f
[NC-1524] Clique miner acceptance test - spotless and error prone
jframe Oct 18, 2018
5b3aefb
[NC-1524] Clique miner acceptance test - rpc tests
jframe Oct 19, 2018
5f76acb
Merge branch 'master' into feature/NC-1524_clique_acceptance_tests
jframe Oct 19, 2018
7a7f769
[NC-1524] Clique miner acceptance test - spotless
jframe Oct 19, 2018
4237915
[NC-1524] Clique miner acceptance test - fix bad merge
jframe Oct 19, 2018
6eaad43
[NC-1524] Clique miner acceptance test - enable clique rpc
jframe Oct 19, 2018
5dfb9c8
Merge branch 'master' into feature/NC-1524_clique_acceptance_tests
jframe Oct 23, 2018
5f3d5bb
[NC-1524] Clique miner acceptance test - discard and proposals rcp tests
jframe Oct 23, 2018
a113454
Merge branch 'master' into feature/NC-1524_clique_acceptance_tests
jframe Oct 23, 2018
74ba546
Merge branch 'master' into feature/NC-1524_clique_acceptance_tests
jframe Oct 24, 2018
73aa666
[NC-1524] Clique miner acceptance test - spotless
jframe Oct 24, 2018
3be7e0b
Merge branch 'master' into feature/NC-1524_clique_acceptance_tests
jframe Oct 24, 2018
d19fa8a
[NC-1524] Clique miner acceptance test - PR improvements
jframe Oct 25, 2018
b12e563
Merge branch 'feature/NC-1524_clique_acceptance_tests' of github.com:…
jframe Oct 26, 2018
7807a18
[NC-1524] clean up PantheonNodeConfig constructors
jframe Oct 26, 2018
03f9eae
[NC-1524] refactor to add a waitForChainHeadToProgress method
jframe Oct 26, 2018
de5a1e8
[NC-1524] change validator state and wait until blocks progress for a…
jframe Oct 26, 2018
ba6a232
[NC-1524] test to confirm clique vote details are in block header
jframe Oct 29, 2018
af45272
[NC-1524] test clique stalls if insufficient validators
jframe Oct 29, 2018
74af4e5
[NC-1524] cleanup
jframe Oct 29, 2018
e84e133
Merge branch 'master' into feature/NC-1524_clique_acceptance_tests
jframe Oct 31, 2018
83aa0ae
[NC-1524] cleanup
jframe Oct 31, 2018
da89fbe
[NC-1524] use web3j factory with added clique methods
jframe Oct 31, 2018
2dd7596
[NC-1524] clique transactions
jframe Oct 31, 2018
adb87fa
[NC-1524] move blockchain related conditions into package
jframe Oct 31, 2018
d829065
[NC-1524] move clique related conditions into package
jframe Oct 31, 2018
05cb7ce
[NC-1524] change clique conditions to use clique transactions
jframe Nov 1, 2018
e3fd3c9
[NC-1524] update clique tests to use clique transactions
jframe Nov 1, 2018
138e58e
[NC-1524] delete clique node
jframe Nov 1, 2018
11ca449
[NC-1524] wait condition
jframe Nov 3, 2018
044f8a1
Merge branch 'master' into feature/nc-1524_clique_acc_tests_rework
jframe Nov 19, 2018
40bd5bd
[NC-1524] refactor clique tests after acceptance test framework changes
jframe Nov 20, 2018
853c403
[NC-1524] improve clique test stability by adding wait conditions
jframe Nov 21, 2018
7af4671
Merge branch 'master' into feature/nc-1524_clique_acc_tests_rework
jframe Nov 21, 2018
ab01541
[NC-1524] fix merge issues
jframe Nov 21, 2018
cd3451f
[NC-1524] spotless warnings
jframe Nov 21, 2018
5273625
[NC-1524] code review changes
jframe Nov 22, 2018
b0cd99f
[NC-1524] code review changes
jframe Nov 22, 2018
04dbd3b
Merge branch 'master' into feature/nc-1524_clique_acceptance_tests
jframe Nov 22, 2018
9f814f1
[NC-1524] fix broken tests after merge from master
jframe Nov 22, 2018
219830b
[NC-1524] additional validator checks in getSigners test
jframe Nov 23, 2018
9d35daf
[NC-1524] added no block created expectation
jframe Nov 26, 2018
2afe001
[NC-1524] rename clique proposal methods
jframe Nov 26, 2018
478f95c
Merge branch 'master' into feature/nc-1524_clique_acceptance_tests
jframe Nov 26, 2018
819d5c5
[NC-1524] wait for peers to disconnect in miner instability test
jframe Nov 26, 2018
2689a06
Merge branch 'feature/nc-1524_clique_acceptance_tests' of github.com:…
jframe Nov 26, 2018
cde87bd
[NC-1524] add initial wait in no block created expectation
jframe Nov 26, 2018
e78b394
[NC-1524] fail no new block condition immediately if there is a new b…
jframe Nov 27, 2018
cb88863
Merge branch 'master' into feature/nc-1524_clique_acceptance_tests
jframe Nov 27, 2018
3863b53
[NC-1524] spotless fixes
jframe Nov 27, 2018
69e93b9
[NC-1524] drop miner from createCliqueMinerNode methods as all nodes …
jframe Nov 28, 2018
bd5ec67
[NC-1524] add wait to ensure chain is at expected block
jframe Nov 28, 2018
4178105
Merge branch 'master' into feature/nc-1524_clique_acceptance_tests
jframe Nov 28, 2018
026fa0f
Merge branch 'master' into feature/nc-1524_clique_acceptance_tests
jframe Nov 29, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions acceptance-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ dependencies {
testImplementation project(':ethereum:blockcreation')
testImplementation project(':ethereum:jsonrpc')
testImplementation project(':pantheon')
testImplementation project(':config')
testImplementation project(':consensus:clique')
testImplementation project(':util')
testImplementation project(path: ':ethereum:core', configuration: 'testSupportArtifacts')

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* Copyright 2018 ConsenSys AG.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package tech.pegasys.pantheon.tests.acceptance.clique;

import tech.pegasys.pantheon.tests.acceptance.dsl.AcceptanceTestBase;
import tech.pegasys.pantheon.tests.acceptance.dsl.node.PantheonNode;

import java.io.IOException;

import org.junit.Test;

public class CliqueDiscardRpcAcceptanceTest extends AcceptanceTestBase {

@Test
public void shouldDiscardVotes() throws IOException {
final String[] initialValidators = {"miner1", "miner2"};
final PantheonNode minerNode1 =
rain-on marked this conversation as resolved.
Show resolved Hide resolved
pantheon.createCliqueNodeWithValidators("miner1", initialValidators);
final PantheonNode minerNode2 =
pantheon.createCliqueNodeWithValidators("miner2", initialValidators);
final PantheonNode minerNode3 =
pantheon.createCliqueNodeWithValidators("miner3", initialValidators);
cluster.start(minerNode1, minerNode2, minerNode3);

minerNode1.execute(cliqueTransactions.createRemoveProposal(minerNode2));
minerNode2.execute(cliqueTransactions.createRemoveProposal(minerNode2));
minerNode1.execute(cliqueTransactions.createAddProposal(minerNode3));
minerNode2.execute(cliqueTransactions.createAddProposal(minerNode3));
minerNode1.execute(cliqueTransactions.createDiscardProposal(minerNode2));
minerNode1.execute(cliqueTransactions.createDiscardProposal(minerNode3));

minerNode1.waitUntil(wait.chainHeadHasProgressed(minerNode1, 2));
jframe marked this conversation as resolved.
Show resolved Hide resolved

cluster.verify(clique.validatorsEqual(minerNode1, minerNode2));
minerNode1.verify(clique.noProposals());
minerNode2.verify(
clique.proposalsEqual().removeProposal(minerNode2).addProposal(minerNode3).build());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*
* Copyright 2018 ConsenSys AG.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package tech.pegasys.pantheon.tests.acceptance.clique;

import static tech.pegasys.pantheon.tests.acceptance.dsl.transaction.clique.CliqueTransactions.LATEST;

import tech.pegasys.pantheon.tests.acceptance.dsl.AcceptanceTestBase;
import tech.pegasys.pantheon.tests.acceptance.dsl.node.PantheonNode;

import org.junit.Before;
import org.junit.Test;

public class CliqueGetSignersRpcTest extends AcceptanceTestBase {
private PantheonNode minerNode1;
private PantheonNode minerNode2;
private PantheonNode minerNode3;
private PantheonNode[] allNodes;
private PantheonNode[] initialNodes;

@Before
public void setUp() throws Exception {
final String[] validators = {"miner1", "miner2"};
minerNode1 = pantheon.createCliqueNodeWithValidators("miner1", validators);
minerNode2 = pantheon.createCliqueNodeWithValidators("miner2", validators);
minerNode3 = pantheon.createCliqueNodeWithValidators("miner3", validators);
initialNodes = new PantheonNode[] {minerNode1, minerNode2};
allNodes = new PantheonNode[] {minerNode1, minerNode2, minerNode3};
cluster.start(allNodes);
}

@Test
public void shouldBeAbleToGetValidatorsForBlockNumber() {
jframe marked this conversation as resolved.
Show resolved Hide resolved
cluster.verify(clique.validatorsAtBlockEqual("0x0", initialNodes));
cluster.waitUntil(wait.chainHeadIsAt(1));
minerNode1.execute(cliqueTransactions.createAddProposal(minerNode3));
minerNode2.execute(cliqueTransactions.createAddProposal(minerNode3));

cluster.waitUntil(wait.chainHeadHasProgressed(minerNode1, 1));
cluster.verify(clique.validatorsAtBlockEqual("0x2", initialNodes));

minerNode1.waitUntil(wait.chainHeadHasProgressed(minerNode1, 1));
cluster.verify(clique.validatorsAtBlockEqual("0x3", allNodes));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this work with 0x2? or does it have to be 3?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are already at block 1 when vote in the new validator, so it is working after 2 blocks have progressed.

cluster.verify(clique.validatorsAtBlockEqual(LATEST, allNodes));
}

@Test
public void shouldBeAbleToGetValidatorsForBlockHash() {
cluster.verify(clique.validatorsAtBlockHashFromBlockNumberEqual(minerNode1, 0, initialNodes));
minerNode1.execute(cliqueTransactions.createAddProposal(minerNode3));
minerNode2.execute(cliqueTransactions.createAddProposal(minerNode3));

minerNode1.waitUntil(wait.chainHeadHasProgressed(minerNode1, 1));
cluster.verify(clique.validatorsAtBlockHashFromBlockNumberEqual(minerNode1, 1, initialNodes));

minerNode1.waitUntil(wait.chainHeadHasProgressed(minerNode1, 1));
cluster.verify(clique.validatorsAtBlockHashFromBlockNumberEqual(minerNode1, 3, allNodes));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/*
* Copyright 2018 ConsenSys AG.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package tech.pegasys.pantheon.tests.acceptance.clique;

import tech.pegasys.pantheon.tests.acceptance.dsl.AcceptanceTestBase;
import tech.pegasys.pantheon.tests.acceptance.dsl.account.Account;
import tech.pegasys.pantheon.tests.acceptance.dsl.node.PantheonNode;

import java.io.IOException;

import org.junit.Test;

public class CliqueMiningAcceptanceTest extends AcceptanceTestBase {

@Test
public void shouldMineTransactionsOnSingleNode() throws IOException {
final PantheonNode minerNode = pantheon.createCliqueNode("miner1");
cluster.start(minerNode);

final Account sender = accounts.createAccount("account1");
final Account receiver = accounts.createAccount("account2");

minerNode.execute(transactions.createTransfer(sender, 50));
cluster.verify(sender.balanceEquals(50));

minerNode.execute(transactions.createIncrementalTransfers(sender, receiver, 1));
cluster.verify(receiver.balanceEquals(1));

minerNode.execute(transactions.createIncrementalTransfers(sender, receiver, 2));
jframe marked this conversation as resolved.
Show resolved Hide resolved
cluster.verify(receiver.balanceEquals(3));
}

@Test
public void shouldMineTransactionsOnMultipleNodes() throws IOException {
final PantheonNode minerNode1 = pantheon.createCliqueNode("miner1");
final PantheonNode minerNode2 = pantheon.createCliqueNode("miner2");
final PantheonNode minerNode3 = pantheon.createCliqueNode("miner3");
cluster.start(minerNode1, minerNode2, minerNode3);

final Account sender = accounts.createAccount("account1");
final Account receiver = accounts.createAccount("account2");

minerNode1.execute(transactions.createTransfer(sender, 50));
cluster.verify(sender.balanceEquals(50));

minerNode2.execute(transactions.createIncrementalTransfers(sender, receiver, 1));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I suspect there's a risk that you haven't actually mined separate blocks - can the test be updated to ensure the transactions are spread across blocks?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The transfers are being done from different nodes so there should be multiple blocks.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Transactions are communicated between nodes. They're only guaranteed to be in different blocks if you wait for their effects to be applied before sending the next transaction. So:

minerNode1.execute(transactions.createTransfer(sender, 50));
    cluster.verify(sender.balanceEquals(50));

Must be in one block and any transaction sent after that must be in a different block.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah true, fortunately am following that pattern of during the transfer and then waiting for the effects the applied.

So this what is being done atm:
` minerNode1.execute(transactions.createTransfer(sender, 50));
cluster.verify(sender.balanceEquals(50));

minerNode2.execute(transactions.createIncrementalTransfers(sender, receiver, 1));
cluster.verify(receiver.balanceEquals(1));

minerNode3.execute(transactions.createIncrementalTransfers(sender, receiver, 2));
cluster.verify(receiver.balanceEquals(3));`

So I'm expecting that at least 3 blocks will be created by doing this.

cluster.verify(receiver.balanceEquals(1));

minerNode3.execute(transactions.createIncrementalTransfers(sender, receiver, 2));
cluster.verify(receiver.balanceEquals(3));
}

@Test
public void shouldStallMiningWhenInsufficientValidators() throws IOException {
final PantheonNode minerNode1 = pantheon.createCliqueNode("miner1");
final PantheonNode minerNode2 = pantheon.createCliqueNode("miner2");
final PantheonNode minerNode3 = pantheon.createCliqueNode("miner3");
cluster.start(minerNode1, minerNode2, minerNode3);

cluster.stopNode(minerNode2);
cluster.stopNode(minerNode3);
minerNode1.verify(net.awaitPeerCount(0));
minerNode1.verify(clique.noNewBlockCreated(minerNode1));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* Copyright 2018 ConsenSys AG.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package tech.pegasys.pantheon.tests.acceptance.clique;

import tech.pegasys.pantheon.tests.acceptance.dsl.AcceptanceTestBase;
import tech.pegasys.pantheon.tests.acceptance.dsl.node.PantheonNode;

import java.io.IOException;

import org.junit.Test;

public class CliqueProposalRpcAcceptanceTest extends AcceptanceTestBase {

@Test
public void shouldReturnProposals() throws IOException {
final String[] initialValidators = {"miner1", "miner2"};
final PantheonNode minerNode1 =
pantheon.createCliqueNodeWithValidators("miner1", initialValidators);
final PantheonNode minerNode2 =
pantheon.createCliqueNodeWithValidators("miner2", initialValidators);
final PantheonNode minerNode3 =
pantheon.createCliqueNodeWithValidators("miner3", initialValidators);
cluster.start(minerNode1, minerNode2, minerNode3);

cluster.verify(clique.noProposals());
minerNode1.execute(cliqueTransactions.createAddProposal(minerNode3));
minerNode1.execute(cliqueTransactions.createRemoveProposal(minerNode2));
minerNode2.execute(cliqueTransactions.createRemoveProposal(minerNode3));

minerNode1.verify(
clique.proposalsEqual().addProposal(minerNode3).removeProposal(minerNode2).build());
minerNode2.verify(clique.proposalsEqual().removeProposal(minerNode3).build());
minerNode3.verify(clique.noProposals());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
/*
jframe marked this conversation as resolved.
Show resolved Hide resolved
* Copyright 2018 ConsenSys AG.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package tech.pegasys.pantheon.tests.acceptance.clique;

import tech.pegasys.pantheon.tests.acceptance.dsl.AcceptanceTestBase;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.clique.ExpectNonceVote.CLIQUE_NONCE_VOTE;
import tech.pegasys.pantheon.tests.acceptance.dsl.node.PantheonNode;
import tech.pegasys.pantheon.tests.acceptance.dsl.waitcondition.WaitCondition;

import java.io.IOException;

import org.junit.Test;

public class CliqueProposeRpcAcceptanceTest extends AcceptanceTestBase {

@Test
public void shouldAddValidators() throws IOException {
final String[] initialValidators = {"miner1", "miner2"};
final PantheonNode minerNode1 =
pantheon.createCliqueNodeWithValidators("miner1", initialValidators);
final PantheonNode minerNode2 =
pantheon.createCliqueNodeWithValidators("miner2", initialValidators);
final PantheonNode minerNode3 =
pantheon.createCliqueNodeWithValidators("miner3", initialValidators);
cluster.start(minerNode1, minerNode2, minerNode3);

cluster.verify(clique.validatorsEqual(minerNode1, minerNode2));
final WaitCondition cliqueValidatorsChanged = wait.cliqueValidatorsChanged(minerNode1);
minerNode1.execute(cliqueTransactions.createAddProposal(minerNode3));
minerNode2.execute(cliqueTransactions.createAddProposal(minerNode3));
cluster.waitUntil(cliqueValidatorsChanged);
cluster.verify(clique.validatorsEqual(minerNode1, minerNode2, minerNode3));
}

@Test
public void shouldRemoveValidators() throws IOException {
final String[] initialValidators = {"miner1", "miner2", "miner3"};
final PantheonNode minerNode1 =
pantheon.createCliqueNodeWithValidators("miner1", initialValidators);
final PantheonNode minerNode2 =
pantheon.createCliqueNodeWithValidators("miner2", initialValidators);
final PantheonNode minerNode3 =
pantheon.createCliqueNodeWithValidators("miner3", initialValidators);
cluster.start(minerNode1, minerNode2, minerNode3);

cluster.verify(clique.validatorsEqual(minerNode1, minerNode2, minerNode3));
final WaitCondition cliqueValidatorsChanged = wait.cliqueValidatorsChanged(minerNode1);
minerNode1.execute(cliqueTransactions.createRemoveProposal(minerNode3));
minerNode2.execute(cliqueTransactions.createRemoveProposal(minerNode3));
cluster.waitUntil(cliqueValidatorsChanged);
cluster.verify(clique.validatorsEqual(minerNode1, minerNode2));
}

@Test
public void shouldNotAddValidatorWhenInsufficientVotes() throws IOException {
final String[] initialValidators = {"miner1", "miner2"};
final PantheonNode minerNode1 =
pantheon.createCliqueNodeWithValidators("miner1", initialValidators);
final PantheonNode minerNode2 =
pantheon.createCliqueNodeWithValidators("miner2", initialValidators);
final PantheonNode minerNode3 =
pantheon.createCliqueNodeWithValidators("miner3", initialValidators);
cluster.start(minerNode1, minerNode2, minerNode3);

cluster.verify(clique.validatorsEqual(minerNode1, minerNode2));
minerNode1.execute(cliqueTransactions.createAddProposal(minerNode3));
minerNode1.waitUntil(wait.chainHeadHasProgressed(minerNode1, 1));
cluster.verify(clique.validatorsEqual(minerNode1, minerNode2));
}

@Test
public void shouldNotRemoveValidatorWhenInsufficientVotes() throws IOException {
final PantheonNode minerNode1 = pantheon.createCliqueNode("miner1");
final PantheonNode minerNode2 = pantheon.createCliqueNode("miner2");
final PantheonNode minerNode3 = pantheon.createCliqueNode("miner3");
cluster.start(minerNode1, minerNode2, minerNode3);

cluster.verify(clique.validatorsEqual(minerNode1, minerNode2, minerNode3));
minerNode1.execute(cliqueTransactions.createRemoveProposal(minerNode3));
minerNode1.waitUntil(wait.chainHeadHasProgressed(minerNode1, 1));
cluster.verify(clique.validatorsEqual(minerNode1, minerNode2, minerNode3));
}

@Test
public void shouldIncludeVoteInBlockHeader() throws IOException {
final String[] initialValidators = {"miner1", "miner2"};
final PantheonNode minerNode1 =
pantheon.createCliqueNodeWithValidators("miner1", initialValidators);
final PantheonNode minerNode2 =
pantheon.createCliqueNodeWithValidators("miner2", initialValidators);
final PantheonNode minerNode3 =
pantheon.createCliqueNodeWithValidators("miner3", initialValidators);
cluster.start(minerNode1, minerNode2, minerNode3);

minerNode1.execute(cliqueTransactions.createAddProposal(minerNode3));
minerNode1.waitUntil(wait.chainHeadHasProgressed(minerNode1, 1));
minerNode1.verify(blockchain.beneficiaryEquals(minerNode3));
minerNode1.verify(clique.nonceVoteEquals(CLIQUE_NONCE_VOTE.AUTH));

minerNode1.execute(cliqueTransactions.createRemoveProposal(minerNode2));
minerNode1.waitUntil(wait.chainHeadHasProgressed(minerNode1, 1));
minerNode1.verify(blockchain.beneficiaryEquals(minerNode2));
minerNode1.verify(clique.nonceVoteEquals(CLIQUE_NONCE_VOTE.DROP));
}
}
Loading