@cryptotaxi247 / kubo / commits / abc30e384

Register iptb plugin once

This commit was moved from ipfs/go-ipfs-http-client@d6c8cbd5e643d2131477120a76159074d1a07cd3

Łukasz Magiera committed Feb 12, 2019 at 12:48 UTC abc30e384fafe157490df0dae80a22ddeb6255a2
1 file changed +7 -4
client/httpapi/api_test.go
+7 -4
@@ -19,9 +19,7 @@ import (
19 "github.com/ipfs/iptb/testbed/interfaces"
20 )
21
22 -type NodeProvider struct{}
23 -
24 -func (NodeProvider) MakeAPISwarm(ctx context.Context, fullIdentity bool, n int) ([]iface.CoreAPI, error) {
22 +func init() {
23 _, err := testbed.RegisterPlugin(testbed.IptbPlugin{
24 From: "<builtin>",
25 NewNode: local.NewNode,
@@ -31,8 +29,13 @@ func (NodeProvider) MakeAPISwarm(ctx context.Context, fullIdentity bool, n int)
29 BuiltIn: true,
30 }, false)
31 if err != nil {
34 - return nil, err
32 + panic(err)
33 }
34 +}
35 +
36 +type NodeProvider struct{}
37 +
38 +func (NodeProvider) MakeAPISwarm(ctx context.Context, fullIdentity bool, n int) ([]iface.CoreAPI, error) {
39
40 dir, err := ioutil.TempDir("", "httpapi-tb-")
41 if err != nil {