Revert "namespace ipfs_mock datastore"

This reverts commit 93c0adc696.
This commit is contained in:
Adrian Lanzafame 2019-05-07 19:13:19 +10:00
parent 764ad69eab
commit 2f6a839642
No known key found for this signature in database
GPG Key ID: 87E40C5D62EAE192
2 changed files with 5 additions and 5 deletions

View File

@ -155,9 +155,7 @@ func createComponents(
*test.IpfsMock, *test.IpfsMock,
) { ) {
ctx := context.Background() ctx := context.Background()
peername := fmt.Sprintf("peer_%d", i) mock := test.NewIpfsMock(t)
mock := test.NewIpfsMock(t, peername)
//apiAddr, _ := ma.NewMultiaddr(fmt.Sprintf("/ip4/127.0.0.1/tcp/%d", apiPort+i)) //apiAddr, _ := ma.NewMultiaddr(fmt.Sprintf("/ip4/127.0.0.1/tcp/%d", apiPort+i))
// Bind on port 0 // Bind on port 0
@ -167,6 +165,8 @@ func createComponents(
proxyAddr, _ := ma.NewMultiaddr("/ip4/127.0.0.1/tcp/0") proxyAddr, _ := ma.NewMultiaddr("/ip4/127.0.0.1/tcp/0")
nodeAddr, _ := ma.NewMultiaddr(fmt.Sprintf("/ip4/%s/tcp/%d", mock.Addr, mock.Port)) nodeAddr, _ := ma.NewMultiaddr(fmt.Sprintf("/ip4/%s/tcp/%d", mock.Addr, mock.Port))
peername := fmt.Sprintf("peer_%d", i)
clusterCfg, apiCfg, ipfsproxyCfg, ipfshttpCfg, badgerCfg, raftCfg, crdtCfg, maptrackerCfg, statelesstrackerCfg, psmonCfg, diskInfCfg, tracingCfg := testingConfigs() clusterCfg, apiCfg, ipfsproxyCfg, ipfshttpCfg, badgerCfg, raftCfg, crdtCfg, maptrackerCfg, statelesstrackerCfg, psmonCfg, diskInfCfg, tracingCfg := testingConfigs()
clusterCfg.ID = host.ID() clusterCfg.ID = host.ID()

View File

@ -98,9 +98,9 @@ type mockBlockPutResp struct {
} }
// NewIpfsMock returns a new mock. // NewIpfsMock returns a new mock.
func NewIpfsMock(t *testing.T, ns string) *IpfsMock { func NewIpfsMock(t *testing.T) *IpfsMock {
store := inmem.New() store := inmem.New()
st, err := dsstate.New(store, ns, dsstate.DefaultHandle()) st, err := dsstate.New(store, "", dsstate.DefaultHandle())
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }