Skip to content

Commit

Permalink
wip: fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
juligasa committed Jan 9, 2024
1 parent 3f77734 commit 1671e76
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
8 changes: 4 additions & 4 deletions backend/daemon/api/documents/v1alpha/documents.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ func (api *Server) GetDraft(ctx context.Context, in *documents.GetDraftRequest)
}

// ListDrafts implements the corresponding gRPC method.
func (api *Server) ListDrafts(ctx context.Context, in *documents.ListDraftsRequest) (*documents.ListDraftsResponse, error) {
func (api *Server) ListDrafts(ctx context.Context, _ *documents.ListDraftsRequest) (*documents.ListDraftsResponse, error) {
entities, err := api.blobs.ListEntities(ctx, "hm://d/*")
if err != nil {
return nil, err
Expand Down Expand Up @@ -498,7 +498,7 @@ func (api *Server) PushPublication(ctx context.Context, in *documents.PushPublic

gdb, err := hypersql.EntitiesLookupID(conn, entity.ID().String())
if err != nil {
return nil, status.Errorf(codes.Internal, "unable to find entity id [%s]: %v", entity.ID().String(), err)
return nil, status.Errorf(codes.NotFound, "unable to find entity id [%s]: %v", entity.ID().String(), err)
}
if gdb.ResourcesID == 0 {
return nil, status.Errorf(codes.NotFound, "document %s not found", entity.ID().String())
Expand All @@ -523,13 +523,13 @@ func (api *Server) PushPublication(ctx context.Context, in *documents.PushPublic

gc, err := api.gwClient.GatewayClient(ctx, api.testnet)
if err != nil {
return nil, fmt.Errorf("failed to get site client: %v", err)
return nil, status.Errorf(codes.Internal, "failed to get site client: %v", err)
}

if _, err := gc.PublishBlobs(ctx, &groups_proto.PublishBlobsRequest{
Blobs: colx.SliceMap(cids, cid.Cid.String),
}); err != nil {
return nil, fmt.Errorf("failed to push blobs to the gateway: %w", err)
return nil, status.Errorf(codes.FailedPrecondition, "failed to push blobs to the gateway: %v", err)
}
return &emptypb.Empty{}, nil
}
Expand Down
4 changes: 2 additions & 2 deletions backend/daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func Load(ctx context.Context, cfg config.Config, r *storage.Dir, extraOpts ...i

otel.SetTracerProvider(tp)

a.DB, err = initSQLite(ctx, &a.clean, a.Storage.SQLitePath())
a.DB, err = initSQLite(&a.clean, a.Storage.SQLitePath())
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -254,7 +254,7 @@ func (a *App) Wait() error {
return a.g.Wait()
}

func initSQLite(ctx context.Context, clean *cleanup.Stack, path string) (*sqlitex.Pool, error) {
func initSQLite(clean *cleanup.Stack, path string) (*sqlitex.Pool, error) {
poolSize := int(float64(runtime.NumCPU()) / 2)
if poolSize == 0 {
poolSize = 2
Expand Down
1 change: 0 additions & 1 deletion backend/daemon/daemon_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,6 @@ func TestTrustedPeers(t *testing.T) {
require.Equal(t, int64(1), sr.NumSyncOK)
require.Equal(t, int64(0), sr.NumSyncFailed)
require.ElementsMatch(t, []peer.ID{alice.Storage.Device().PeerID(), bob.Storage.Device().PeerID()}, sr.Peers)

}

{
Expand Down
2 changes: 1 addition & 1 deletion backend/ipfs/bootstrap_peers.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const (
TestGateway = "/dns4/mintter.xyz/tcp/55001/p2p/12D3KooWSTPg42qfgeHdjqxLM3mWSaXVUefkPNXrm1knfaB568dW"
)

// DefaultBootstrapAddresses are the addresses to use as a gate to the network
// DefaultBootstrapAddresses are the addresses to use as a gate to the network.
var DefaultBootstrapAddresses = []string{
"/dnsaddr/bootstrap.libp2p.io/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN",
"/dnsaddr/bootstrap.libp2p.io/p2p/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa",
Expand Down
4 changes: 2 additions & 2 deletions backend/mttnet/mttnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,11 @@ func (n *Node) GatewayClient(ctx context.Context, testnet bool) (GatewayClient,
}
ma, err := ipfs.ParseMultiaddrs(maStr)
if err != nil {
return nil, fmt.Errorf("Could not parse gateway address: %v", err)
return nil, fmt.Errorf("Could not parse gateway address: %w", err)
}
gwInfo, err := peer.AddrInfoFromP2pAddr(ma[0])
if err != nil {
return nil, fmt.Errorf("Could not decode gateway info: %v", err)
return nil, fmt.Errorf("Could not decode gateway info: %w", err)
}
if err := n.Connect(ctx, *gwInfo); err != nil {
return nil, err
Expand Down

0 comments on commit 1671e76

Please sign in to comment.