Skip to content

Commit

Permalink
refactor(nodebuilder/tests): Remove unnecessary TestAddPeerToBlackList
Browse files Browse the repository at this point in the history
  • Loading branch information
renaynay committed Jun 14, 2023
1 parent 83016b6 commit 51f7586
Showing 1 changed file with 0 additions and 35 deletions.
35 changes: 0 additions & 35 deletions nodebuilder/tests/p2p_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,41 +50,6 @@ func TestBridgeNodeAsBootstrapper(t *testing.T) {
}
}

/*
Test-Case: Add peer to blacklist
Steps:
1. Create a Full Node(BN)
2. Start a FN
3. Create a Light Node(LN)
5. Start a LN
6. Explicitly block FN id by LN
7. Check FN is allowed to dial with LN
8. Check LN is not allowed to dial with FN
*/
func TestAddPeerToBlackList(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), swamp.DefaultTestTimeout)
t.Cleanup(cancel)

sw := swamp.NewSwamp(t)

// create and start a FN
full := sw.NewFullNode()
err := full.Start(ctx)
require.NoError(t, err)

light := sw.NewLightNode()
err = light.Start(ctx)
require.NoError(t, err)

// LN blocks FN
fullAddr := host.InfoFromHost(full.Host)
require.NoError(t, light.ConnGater.BlockPeer(fullAddr.ID))

// assert that FN can dial LN but LN cannot dial FN
assert.True(t, full.ConnGater.InterceptPeerDial(host.InfoFromHost(light.Host).ID))
assert.False(t, light.ConnGater.InterceptPeerDial(fullAddr.ID))
}

/*
Test-Case: Connect Full And Light using Bridge node as a bootstrapper
Steps:
Expand Down

0 comments on commit 51f7586

Please sign in to comment.