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

[PAN-2783] Invert dependency between permissioning and p2p #1557

Merged
merged 5 commits into from
Jun 14, 2019

Conversation

mbaxter
Copy link
Contributor

@mbaxter mbaxter commented Jun 12, 2019

PR description

Invert the dependency between p2p and permissioning packages. This allows us to move EnodeURL (a p2p-specific datastructure) into the p2p package.

@@ -363,13 +359,6 @@ public P2PNetwork build() {

private P2PNetwork doBuild() {
// Set up permissions
// Fold NodePermissioningController into peerPermissions
if (nodePermissioningController.isPresent()) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This setup has been moved into RunnerBuilder.

@@ -201,31 +184,6 @@ public void checkMaintainedConnectionPeers_connectingPeer() {
verify(rlpxAgent, times(0)).connect(peer);
}

@Test
public void whenBuildingNetworkWithNodePermissioningWithoutBlockchainShouldThrowIllegalState() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is no longer possible to construct the corresponding PeerPermissions object without supplying the nodePermissioning and blockchain objects.

@@ -269,71 +258,12 @@ public void rejectIncomingConnectionFromBlacklistedPeer() throws Exception {
}
}

@Test
public void rejectIncomingConnectionFromNonWhitelistedPeer() throws Exception {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This case is covered more generically by the test rejectIncomingConnectionFromDisallowedPeer.

@mbaxter mbaxter requested a review from lucassaldanha June 12, 2019 23:31
@mbaxter mbaxter changed the title Rearrange dependencies: permissioning depends on p2p [PAN-2783] Invert dependency between permissioning and p2p Jun 12, 2019
@mbaxter
Copy link
Contributor Author

mbaxter commented Jun 13, 2019

Closing while tests are being debugged

@mbaxter mbaxter closed this Jun 13, 2019
@mbaxter mbaxter reopened this Jun 13, 2019
Copy link
Contributor

@lucassaldanha lucassaldanha left a comment

Choose a reason for hiding this comment

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

LGTM. I'm glad to see this happening!

@mbaxter mbaxter merged commit 7c9f3e4 into PegaSysEng:master Jun 14, 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.

2 participants