Skip to content

Commit

Permalink
fix(nodebuilder): Use test node for tests instead of New (#1350)
Browse files Browse the repository at this point in the history
Fixes issue with this test not using in-memory keyring.
  • Loading branch information
renaynay authored Nov 11, 2022
1 parent 90bd741 commit a95b114
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions nodebuilder/node_bridge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,19 @@ func TestBridge_WithMockedCoreClient(t *testing.T) {
// TestBridge_HasStubDaser verifies that a bridge node implements a stub daser that returns an
// error and empty das.SamplingStats
func TestBridge_HasStubDaser(t *testing.T) {
repo := MockStore(t, DefaultConfig(node.Bridge))

ctx, cancel := context.WithCancel(context.Background())
t.Cleanup(cancel)

_, client := core.StartTestClient(ctx, t)
node, err := New(node.Bridge, p2p.Private, repo, coremodule.WithClient(client))
require.NoError(t, err)
require.NotNil(t, node)
err = node.Start(ctx)
nd := TestNode(t, node.Bridge, coremodule.WithClient(client))
require.NotNil(t, nd)
err := nd.Start(ctx)
require.NoError(t, err)

stats, err := node.DASer.SamplingStats(ctx)
stats, err := nd.DASer.SamplingStats(ctx)
assert.EqualError(t, err, "moddas: dasing is not available on bridge nodes")
assert.Equal(t, stats, das.SamplingStats{})

err = node.Stop(ctx)
err = nd.Stop(ctx)
require.NoError(t, err)
}

0 comments on commit a95b114

Please sign in to comment.