diff --git a/Makefile b/Makefile index 80f7612fe..6f7eaa26e 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 521a68728..664735443 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 166012edb..ca025fbfb 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 2329357e7..56236c177 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 f1d494e4a..23b6b0451 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)