Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/whitelist #50

Merged
merged 11 commits into from
Jun 9, 2021
Merged

Bugfix/whitelist #50

merged 11 commits into from
Jun 9, 2021

Conversation

Wawa1996
Copy link
Collaborator

@Wawa1996 Wawa1996 commented Jun 8, 2021

The whitelist function is improved and test cases are added

client.addWhilteIP("127.0.0.1",8882);
//白名单有的节点
boolean ans = client.isAcceptable(new InetSocketAddress("127.0.0.1",8882));
assert ans;
Copy link
Contributor

Choose a reason for hiding this comment

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

please use junit Assert

assert ans;
//白名单无的节点
boolean ans1 = client.isAcceptable(new InetSocketAddress("127.0.0.1",8883));
assert !ans1;
Copy link
Contributor

Choose a reason for hiding this comment

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

please use junit Assert

@@ -57,10 +55,15 @@ public void startup() throws UnknownHostException {
}

@Test
public void ShouldFindTheSeedNode() {
if(discV5Service2.streamKnownPeers().findFirst().isPresent()){
assert discoveryPeer.equals(discV5Service2.streamKnownPeers().findFirst().get());
Copy link
Contributor

Choose a reason for hiding this comment

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

please use junit Assert

public void exitnetwork() throws InterruptedException {
discV5Service2.stop();
Thread.sleep(1000);
assert discV5Service1.streamKnownPeers().count() == 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

please use junit Assert

}
public void ShouldFindTheSeedNode() throws InterruptedException {
Thread.sleep(1000);
assert discV5Service2.streamKnownPeers().findFirst().isEmpty() || discoveryPeer.equals(discV5Service2.streamKnownPeers().findFirst().get());
Copy link
Contributor

Choose a reason for hiding this comment

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

please use junit Assert



NonHandler rpc = (NonHandler) node1.rpcHandler;
assert rpc.connection.remoteAddress().toString().equals(advertisedAddr.toString().substring(0, 24));
Copy link
Contributor

Choose a reason for hiding this comment

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

please use junit Assert

Copy link
Contributor

@LucasMLK LucasMLK left a comment

Choose a reason for hiding this comment

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

please use junit Assert

Copy link
Collaborator

@MyronX MyronX left a comment

Choose a reason for hiding this comment

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

nice work

Copy link
Collaborator

@punk8 punk8 left a comment

Choose a reason for hiding this comment

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

good job

@punk8 punk8 merged commit 0ffad71 into develop Jun 9, 2021
@punk8 punk8 deleted the bugfix/whitelist branch June 9, 2021 01:22
punk8 added a commit that referenced this pull request Feb 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants