Skip to content
This repository has been archived by the owner on Oct 5, 2023. It is now read-only.

Commit

Permalink
Register iptb plugin once
Browse files Browse the repository at this point in the history
  • Loading branch information
magik6k committed Feb 12, 2019
1 parent 6e5a8e0 commit d6c8cbd
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ import (
"github.com/ipfs/iptb/testbed/interfaces"
)

type NodeProvider struct{}

func (NodeProvider) MakeAPISwarm(ctx context.Context, fullIdentity bool, n int) ([]iface.CoreAPI, error) {
func init() {
_, err := testbed.RegisterPlugin(testbed.IptbPlugin{
From: "<builtin>",
NewNode: local.NewNode,
Expand All @@ -31,8 +29,13 @@ func (NodeProvider) MakeAPISwarm(ctx context.Context, fullIdentity bool, n int)
BuiltIn: true,
}, false)
if err != nil {
return nil, err
panic(err)
}
}

type NodeProvider struct{}

func (NodeProvider) MakeAPISwarm(ctx context.Context, fullIdentity bool, n int) ([]iface.CoreAPI, error) {

dir, err := ioutil.TempDir("", "httpapi-tb-")
if err != nil {
Expand Down

0 comments on commit d6c8cbd

Please sign in to comment.