From 7c31942386ef95bd2116b27d6e134657e8c93b21 Mon Sep 17 00:00:00 2001 From: Louis Singer <41042567+louisinger@users.noreply.github.com> Date: Sat, 17 Aug 2024 00:08:21 +0200 Subject: [PATCH] move `make proto` & `make proto-lint` commands to root folder (#265) * fix make proto * cleaning --- Makefile | 12 +++++++++++- api-spec/protobuf/gen/ark/v1/admin.pb.gw.go | 3 +-- api-spec/protobuf/gen/ark/v1/service.pb.gw.go | 3 +-- api-spec/protobuf/gen/ark/v1/wallet.pb.gw.go | 6 ++---- server/buf.Dockerfile => buf.Dockerfile | 0 server/Makefile | 15 +-------------- 6 files changed, 16 insertions(+), 23 deletions(-) rename server/buf.Dockerfile => buf.Dockerfile (100%) diff --git a/Makefile b/Makefile index 80f7612..6f7eaa2 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: build-server build-client build-all-server build-all-client +.PHONY: build-server build-client build-all-server build-all-client proto proto-lint build build-all build-server: @echo "Building arkd binary..." @@ -22,3 +22,13 @@ build-wasm: build: build-server build-client build-wasm build-all: build-all-server build-all-client build-wasm + +proto: proto-lint + @echo "Compiling stubs..." + @docker run --rm --volume "$(shell pwd):/workspace" --workdir /workspace buf generate buf.build/vulpemventures/ocean + @docker run --rm --volume "$(shell pwd):/workspace" --workdir /workspace buf generate + +proto-lint: + @echo "Linting protos..." + @docker build -q -t buf -f buf.Dockerfile . &> /dev/null + @docker run --rm --volume "$(shell pwd):/workspace" --workdir /workspace buf lint \ No newline at end of file diff --git a/api-spec/protobuf/gen/ark/v1/admin.pb.gw.go b/api-spec/protobuf/gen/ark/v1/admin.pb.gw.go index 521a687..6647354 100644 --- a/api-spec/protobuf/gen/ark/v1/admin.pb.gw.go +++ b/api-spec/protobuf/gen/ark/v1/admin.pb.gw.go @@ -131,7 +131,6 @@ func local_request_AdminService_GetRounds_0(ctx context.Context, marshaler runti // UnaryRPC :call AdminServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterAdminServiceHandlerFromEndpoint instead. -// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call. func RegisterAdminServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AdminServiceServer) error { mux.Handle("GET", pattern_AdminService_GetScheduledSweep_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -247,7 +246,7 @@ func RegisterAdminServiceHandler(ctx context.Context, mux *runtime.ServeMux, con // to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AdminServiceClient". // Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AdminServiceClient" // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "AdminServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. +// "AdminServiceClient" to call the correct interceptors. func RegisterAdminServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AdminServiceClient) error { mux.Handle("GET", pattern_AdminService_GetScheduledSweep_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { diff --git a/api-spec/protobuf/gen/ark/v1/service.pb.gw.go b/api-spec/protobuf/gen/ark/v1/service.pb.gw.go index 166012e..ca025fb 100644 --- a/api-spec/protobuf/gen/ark/v1/service.pb.gw.go +++ b/api-spec/protobuf/gen/ark/v1/service.pb.gw.go @@ -434,7 +434,6 @@ func local_request_ArkService_CompletePayment_0(ctx context.Context, marshaler r // UnaryRPC :call ArkServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterArkServiceHandlerFromEndpoint instead. -// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call. func RegisterArkServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ArkServiceServer) error { mux.Handle("POST", pattern_ArkService_RegisterPayment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -757,7 +756,7 @@ func RegisterArkServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn // to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ArkServiceClient". // Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ArkServiceClient" // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "ArkServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. +// "ArkServiceClient" to call the correct interceptors. func RegisterArkServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ArkServiceClient) error { mux.Handle("POST", pattern_ArkService_RegisterPayment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { diff --git a/api-spec/protobuf/gen/ark/v1/wallet.pb.gw.go b/api-spec/protobuf/gen/ark/v1/wallet.pb.gw.go index 2329357..56236c1 100644 --- a/api-spec/protobuf/gen/ark/v1/wallet.pb.gw.go +++ b/api-spec/protobuf/gen/ark/v1/wallet.pb.gw.go @@ -211,7 +211,6 @@ func local_request_WalletService_GetBalance_0(ctx context.Context, marshaler run // UnaryRPC :call WalletInitializerServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterWalletInitializerServiceHandlerFromEndpoint instead. -// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call. func RegisterWalletInitializerServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server WalletInitializerServiceServer) error { mux.Handle("GET", pattern_WalletInitializerService_GenSeed_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -346,7 +345,6 @@ func RegisterWalletInitializerServiceHandlerServer(ctx context.Context, mux *run // UnaryRPC :call WalletServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterWalletServiceHandlerFromEndpoint instead. -// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call. func RegisterWalletServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server WalletServiceServer) error { mux.Handle("POST", pattern_WalletService_Lock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -462,7 +460,7 @@ func RegisterWalletInitializerServiceHandler(ctx context.Context, mux *runtime.S // to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "WalletInitializerServiceClient". // Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "WalletInitializerServiceClient" // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "WalletInitializerServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. +// "WalletInitializerServiceClient" to call the correct interceptors. func RegisterWalletInitializerServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client WalletInitializerServiceClient) error { mux.Handle("GET", pattern_WalletInitializerService_GenSeed_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -637,7 +635,7 @@ func RegisterWalletServiceHandler(ctx context.Context, mux *runtime.ServeMux, co // to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "WalletServiceClient". // Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "WalletServiceClient" // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "WalletServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares. +// "WalletServiceClient" to call the correct interceptors. func RegisterWalletServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client WalletServiceClient) error { mux.Handle("POST", pattern_WalletService_Lock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { diff --git a/server/buf.Dockerfile b/buf.Dockerfile similarity index 100% rename from server/buf.Dockerfile rename to buf.Dockerfile diff --git a/server/Makefile b/server/Makefile index f1d494e..23b6b04 100755 --- a/server/Makefile +++ b/server/Makefile @@ -1,4 +1,4 @@ -.PHONY: build clean cov help intergrationtest lint run run-neutrino run-neutrino-signet test vet proto proto-lint +.PHONY: build clean cov help intergrationtest lint run run-neutrino run-neutrino-signet test vet ## build: build for all platforms build: @@ -91,19 +91,6 @@ vet: @echo "Running code analysis..." @go vet ./... -## proto: compile proto stubs -proto: proto-lint - @echo "Compiling stubs..." - @docker run --rm --volume "$(shell pwd):/workspace" --workdir /workspace buf generate buf.build/vulpemventures/ocean - @docker run --rm --volume "$(shell pwd):/workspace" --workdir /workspace buf generate - -## proto-lint: lint protos -proto-lint: - @echo "Linting protos..." - @docker build -q -t buf -f buf.Dockerfile . &> /dev/null - @docker run --rm --volume "$(shell pwd):/workspace" --workdir /workspace buf lint - - ## mig_file: creates pg migration file(eg. make FILE=init mig_file) mig_file: @migrate create -ext sql -dir ./internal/infrastructure/db/sqlite/migration/ $(FILE)