diff --git a/api/types.go b/api/types.go index 943847e3..ca8a4397 100644 --- a/api/types.go +++ b/api/types.go @@ -198,7 +198,7 @@ const ( // IPFSPinStatus represents the status of a pin in IPFS (direct, recursive etc.) type IPFSPinStatus int -// IPFSPinStatusFromString parses a strixng and returns the matching +// IPFSPinStatusFromString parses a string and returns the matching // IPFSPinStatus. func IPFSPinStatusFromString(t string) IPFSPinStatus { // Since indirect statuses are of the form "indirect through " diff --git a/config_test.go b/config_test.go index 5ad68392..da19cd2b 100644 --- a/config_test.go +++ b/config_test.go @@ -34,7 +34,6 @@ var testingClusterCfg = []byte(`{ }, "state_sync_interval": "1m0s", "pin_recover_interval": "1m0s", - "peer_infos_caching_interval": "500ms", "replication_factor": -1, "monitor_ping_interval": "250ms", "peer_watch_interval": "1s", diff --git a/ipfscluster_test.go b/ipfscluster_test.go index 936e58d2..cf52b41d 100644 --- a/ipfscluster_test.go +++ b/ipfscluster_test.go @@ -973,13 +973,13 @@ func TestClustersStatusAllWithErrors(t *testing.T) { t.Error("erroring status should be ClusterError:", pinfo.Status) } - // if pinfo.PeerName != "peer_1" { - // t.Error("peername should have been set in the erroring peer too from the cache") - // } + if pinfo.PeerName != "peer_1" { + t.Error("peername should have been set in the erroring peer too from the cache") + } - // if pinfo.IPFS != test.PeerID1 { - // t.Error("IPFS ID should have been set in the erroring peer too from the cache") - // } + if pinfo.IPFS != test.PeerID1 { + t.Error("IPFS ID should have been set in the erroring peer too from the cache") + } case "crdt": // CRDT will not have contacted the offline peer because // its metric expired and therefore is not in the diff --git a/pintracker/optracker/operationtracker.go b/pintracker/optracker/operationtracker.go index d62b1c96..b33bb44f 100644 --- a/pintracker/optracker/operationtracker.go +++ b/pintracker/optracker/operationtracker.go @@ -145,6 +145,7 @@ func (opt *OperationTracker) unsafePinInfo(ctx context.Context, op *Operation) a return api.PinInfo{ Cid: cid.Undef, Peer: opt.pid, + Name: "", PinInfoShort: api.PinInfoShort{ PeerName: opt.peerName, IPFS: "", @@ -159,6 +160,7 @@ func (opt *OperationTracker) unsafePinInfo(ctx context.Context, op *Operation) a return api.PinInfo{ Cid: op.Cid(), Peer: opt.pid, + Name: op.Pin().Name, PinInfoShort: api.PinInfoShort{ PeerName: opt.peerName, IPFS: "", diff --git a/test/rpc_api_mock.go b/test/rpc_api_mock.go index fa3e9339..47f46006 100644 --- a/test/rpc_api_mock.go +++ b/test/rpc_api_mock.go @@ -52,11 +52,7 @@ func NewMockRPCClientWithHost(t testing.TB, h host.Host) *rpc.Client { if err != nil { t.Fatal(err) } - var pid peer.ID - if h != nil { - pid = h.ID() - } - err = s.RegisterName("PeerMonitor", &mockPeerMonitor{pid: pid}) + err = s.RegisterName("PeerMonitor", &mockPeerMonitor{}) if err != nil { t.Fatal(err) } @@ -68,9 +64,7 @@ type mockCluster struct{} type mockPinTracker struct{} type mockIPFSConnector struct{} type mockConsensus struct{} -type mockPeerMonitor struct { - pid peer.ID -} +type mockPeerMonitor struct{} func (mock *mockCluster) Pin(ctx context.Context, in *api.Pin, out *api.Pin) error { if in.Cid.Equals(ErrorCid) {