refactor: migrate to cosmos/gogoproto (#13070)
This commit is contained in:
+1
-1
@@ -7,7 +7,7 @@ $mockgen_cmd -source db/types.go -package mock -destination testutil/mock/db/typ
|
||||
$mockgen_cmd -source=types/module/module.go -package mock -destination testutil/mock/types_module_module.go
|
||||
$mockgen_cmd -source=types/invariant.go -package mock -destination testutil/mock/types_invariant.go
|
||||
$mockgen_cmd -source=types/router.go -package mock -destination testutil/mock/types_router.go
|
||||
$mockgen_cmd -package mock -destination testutil/mock/grpc_server.go github.com/gogo/protobuf/grpc Server
|
||||
$mockgen_cmd -package mock -destination testutil/mock/grpc_server.go github.com/cosmos/gogoproto/grpc Server
|
||||
$mockgen_cmd -package mock -destination testutil/mock/tendermint_tendermint_libs_log_DB.go github.com/tendermint/tendermint/libs/log Logger
|
||||
$mockgen_cmd -source=orm/model/ormtable/hooks.go -package ormmocks -destination orm/testing/ormmocks/hooks.go
|
||||
$mockgen_cmd -source=x/nft/expected_keepers.go -package testutil -destination x/nft/testutil/expected_keepers_mocks.go
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# This script generates a custom wrapper for google.protobuf.Any in
|
||||
# codec/types/any.pb.go with a custom generated struct that lives in
|
||||
# codec/types/any.go
|
||||
|
||||
set -eo pipefail
|
||||
|
||||
go install github.com/gogo/protobuf/protoc-gen-gogotypes
|
||||
|
||||
buf protoc -I "third_party/proto" --gogotypes_out=./codec/types third_party/proto/google/protobuf/any.proto
|
||||
mv codec/types/google/protobuf/any.pb.go codec/types
|
||||
rm -rf codec/types/third_party
|
||||
|
||||
# This removes the call to RegisterType in the custom generated Any wrapper
|
||||
# so that only the Any type provided by gogo protobuf is registered in the
|
||||
# global gogo protobuf type registry, which we aren't actually using
|
||||
sed '/proto\.RegisterType/d' codec/types/any.pb.go > tmp && mv tmp codec/types/any.pb.go
|
||||
+4
-17
@@ -1,21 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
#== Requirements ==
|
||||
#
|
||||
## make sure your `go env GOPATH` is in the `$PATH`
|
||||
## Install:
|
||||
## + latest buf (v1.0.0-rc11 or later)
|
||||
## + protobuf v3
|
||||
#
|
||||
## All protoc dependencies must be installed not in the module scope
|
||||
## currently we must use grpc-gateway v1
|
||||
# cd ~
|
||||
# go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
|
||||
# go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
|
||||
# go install github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway@v1.16.0
|
||||
# go install github.com/cosmos/cosmos-proto/cmd/protoc-gen-go-pulsar@latest
|
||||
# go get github.com/regen-network/cosmos-proto@latest # doesn't work in install mode
|
||||
# go get github.com/regen-network/cosmos-proto/protoc-gen-gocosmos@v0.3.1
|
||||
# How to run manually:
|
||||
# docker build --pull --rm -f "contrib/devtools/Dockerfile" -t cosmossdk-proto:latest "contrib/devtools"
|
||||
# docker run --rm -v $(pwd):/workspace --workdir /workspace cosmossdk-proto sh ./scripts/protocgen.sh
|
||||
|
||||
set -eo pipefail
|
||||
|
||||
@@ -42,6 +29,6 @@ cd ..
|
||||
cp -r github.com/cosmos/cosmos-sdk/* ./
|
||||
rm -rf github.com
|
||||
|
||||
go mod tidy -compat=1.18
|
||||
go mod tidy
|
||||
|
||||
./scripts/protocgen-pulsar.sh
|
||||
|
||||
Reference in New Issue
Block a user