Skip to content

Commit

Permalink
simplify, regen types. remove legacy docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Reecepbcups committed Oct 17, 2023
1 parent ba82eb7 commit 1af931f
Show file tree
Hide file tree
Showing 26 changed files with 962 additions and 99,279 deletions.
1 change: 1 addition & 0 deletions modules/async-icq/testing/demo-simapp/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ release/
.idea/
.vscode/
.DS_Store
github.com
57 changes: 57 additions & 0 deletions modules/async-icq/testing/demo-simapp/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/usr/bin/make -f
PACKAGES_NOSIMULATION=$(shell go list ./... | grep -v '/simulation')
PACKAGES_SIMTEST=$(shell go list ./... | grep '/simulation')
CHANGED_GO_FILES := $(shell git diff --name-only | grep .go$$ | grep -v pb.go)
ALL_GO_FILES := $(shell find . -regex ".*\.go$$" | grep -v pb.go)
VERSION := $(shell echo $(shell git describe --always) | sed 's/^v//')
COMMIT := $(shell git log -1 --format='%H')
LEDGER_ENABLED ?= true
BINDIR ?= $(GOPATH)/bin
BUILDDIR ?= $(CURDIR)/build
DOCKER := $(shell which docker)
DOCKER_BUF := $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace bufbuild/buf:1.9.0
PROJECT_NAME = $(shell git remote get-url origin | xargs basename -s .git)

export GO111MODULE = on

###############################################################################
### Proto ###
###############################################################################

protoVer=v0.7
protoImageName=tendermintdev/sdk-proto-gen:$(protoVer)
containerProtoGen=juno-proto-gen-$(protoVer)
containerProtoGenAny=juno-proto-gen-any-$(protoVer)
containerProtoGenSwagger=juno-proto-gen-swagger-$(protoVer)
containerProtoFmt=juno-proto-fmt-$(protoVer)

proto-all: proto-format proto-lint proto-gen

proto-gen:
@echo "Generating Protobuf files"
@if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoGen}$$"; then docker start -a $(containerProtoGen); else docker run --name $(containerProtoGen) -v $(CURDIR):/workspace --workdir /workspace $(protoImageName) \
sh ./scripts/protocgen.sh; fi

# This generates the SDK's custom wrapper for google.protobuf.Any. It should only be run manually when needed
proto-gen-any:
@echo "Generating Protobuf Any"
@if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoGenAny}$$"; then docker start -a $(containerProtoGenAny); else docker run --name $(containerProtoGenAny) -v $(CURDIR):/workspace --workdir /workspace $(protoImageName) \
sh ./scripts/protocgen-any.sh; fi

proto-swagger-gen:
@echo "Generating Protobuf Swagger"
@if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoGenSwagger}$$"; then docker start -a $(containerProtoGenSwagger); else docker run --name $(containerProtoGenSwagger) -v $(CURDIR):/workspace --workdir /workspace $(protoImageName) \
sh ./scripts/protoc-swagger-gen.sh; fi

proto-format:
@echo "Formatting Protobuf files"
@if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoFmt}$$"; then docker start -a $(containerProtoFmt); else docker run --name $(containerProtoFmt) -v $(CURDIR):/workspace --workdir /workspace tendermintdev/docker-build-proto \
find ./ -not -path "./third_party/*" -name "*.proto" -exec clang-format -i {} \; ; fi

proto-lint:
@$(DOCKER_BUF) lint --error-format=json

proto-check-breaking:
@$(DOCKER_BUF) breaking --against $(HTTPS_GIT)#branch=main

.PHONY: proto-all proto-gen proto-gen-any proto-swagger-gen proto-format proto-lint proto-check-breaking proto-update-deps docs
7 changes: 0 additions & 7 deletions modules/async-icq/testing/demo-simapp/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package app

import (
"io"
"net/http"
"os"
"path/filepath"

Expand Down Expand Up @@ -92,9 +91,7 @@ import (
dbm "github.com/tendermint/tm-db"

"github.com/tendermint/starport/starport/pkg/cosmoscmd"
"github.com/tendermint/starport/starport/pkg/openapiconsole"

"github.com/quasar-finance/interchain-query-demo/docs"
interquerymodule "github.com/quasar-finance/interchain-query-demo/x/interquery"
interquerymodulekeeper "github.com/quasar-finance/interchain-query-demo/x/interquery/keeper"
interquerymoduletypes "github.com/quasar-finance/interchain-query-demo/x/interquery/types"
Expand Down Expand Up @@ -674,10 +671,6 @@ func (app *App) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig
// Register legacy and grpc-gateway routes for all modules.
ModuleBasics.RegisterRESTRoutes(clientCtx, apiSvr.Router)
ModuleBasics.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter)

// register app's OpenAPI routes.
apiSvr.Router.Handle("/static/openapi.yml", http.FileServer(http.FS(docs.Docs)))
apiSvr.Router.HandleFunc("/", openapiconsole.Handler(Name, "/static/openapi.yml"))
}

// RegisterTxService implements the Application.RegisterTxService method.
Expand Down
8 changes: 8 additions & 0 deletions modules/async-icq/testing/demo-simapp/buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: v1
plugins:
- name: gocosmos
out: .
opt: plugins=interfacetype+grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types
- name: grpc-gateway
out: .
opt: logtostderr=true,allow_colon_final_segments=true
3 changes: 3 additions & 0 deletions modules/async-icq/testing/demo-simapp/buf.work.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
version: v1
directories:
- proto
6 changes: 0 additions & 6 deletions modules/async-icq/testing/demo-simapp/docs/docs.go

This file was deleted.

Loading

0 comments on commit 1af931f

Please sign in to comment.