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

Ibft Json Acceptance tests #634

Merged
merged 16 commits into from
Jan 29, 2019
Merged

Ibft Json Acceptance tests #634

merged 16 commits into from
Jan 29, 2019

Conversation

rain-on
Copy link
Contributor

@rain-on rain-on commented Jan 22, 2019

First drop of IBFT json Acceptances tests.

I blindly copied the Clique ones, and all associated Transactions etc. - so .... there might be quite a lot of room for finding commonalities.

@rain-on rain-on requested review from jframe and CjHare January 22, 2019 11:45
"ibft_discardValidatorVote", singletonList(address), web3jService, DiscardResponse.class);
}

public Request<?, ProposalsResponse> ibftProposals() {
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't really match up with the rpc method name. Original intent for the clique rpcs was that these method names corresponded to the underlying rpc method.

cluster.waitUntil(removedCondition);
cluster.verify(ibft.validatorsEqual(validator1, validator2, validator3));
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

A test to confirm that extra data has correct vote details would be nice

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Does that belong here? Or is that a lower level concept? I.e. do AcceptanceTests care how the vote gets around, or just that it does?


import static org.assertj.core.api.Assertions.assertThat;
import static tech.pegasys.pantheon.tests.acceptance.dsl.WaitUtils.waitFor;
import static tech.pegasys.pantheon.tests.acceptance.dsl.transaction.clique.CliqueTransactions.LATEST;
Copy link
Contributor

Choose a reason for hiding this comment

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

we shouldn't be depending on this constant Clique even though it will work. This seems very generic LATEST could probably move somewhere more common.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

true.

@Override
public List<Address> execute(final PantheonWeb3j node) {
try {
final SignersBlockResponse result = node.cliqueGetSignersAtHash(hash).send();
Copy link
Contributor

Choose a reason for hiding this comment

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

This is using the clique signers getSignersAtHash

import tech.pegasys.pantheon.tests.acceptance.dsl.node.Node;
import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.ibft.IbftTransactions;

public class ExpectValidatorsAtBlockHash implements Condition {
Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't look like this is being used

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed.

import tech.pegasys.pantheon.tests.acceptance.dsl.node.Node;
import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.ibft.IbftTransactions;

public class ExpectValidatorsAtBlock implements Condition {
Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't look like this is being used

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed.

private final EthTransactions eth;
private final IbftTransactions ibft;

public Ibft(final EthTransactions eth, final IbftTransactions ibft) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't look like EthTransactions is used

return new ExpectProposals(ibft, ImmutableMap.of());
}

public ProposalsConfig proposalsEqual() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Ibft is using pending votes instead of proposals for this concept, so I think it would be clearer in the ibft tests if we used the term pending votes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

SignersBlockResponse.class);
}

public Request<?, SignersBlockResponse> ibftGetSignersAtHash(final Hash hash) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't look this is being used. But we I think we should have a test to verify this rpc is working.

@Override
public Boolean execute(final JsonRequestFactories node) {
try {
final ProposeResponse result = node.ibft().ibftPropose(address, auth).send();
Copy link
Contributor

Choose a reason for hiding this comment

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

If you're in the mood for sweeping renaming, with the addition of the split of the PanethonWeb3j into factories the method prefix becomes redundant and can be dropped ie. node.ibft().ibftPropose(address, auth).send(); -> node.ibft().propose(address, auth).send();

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I COMPLETELy agree with this, but would like to get this in first.

Copy link
Contributor

@CjHare CjHare left a comment

Choose a reason for hiding this comment

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

The split of the PantheonWeb3j into factories is a far better direction.

From me there's just the open question about dropping (the now duplicated) prefix for the method name.

@rain-on rain-on merged commit 22527e6 into PegaSysEng:master Jan 29, 2019
vinistevam pushed a commit to vinistevam/pantheon that referenced this pull request Jan 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants