Merge PR #6076: Proto Any init + evidence
This commit is contained in:
Executable
+18
@@ -0,0 +1,18 @@
|
||||
#!/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
|
||||
|
||||
protoc -I. --gogotypes_out=./codec/types third_party/proto/google/protobuf/any.proto
|
||||
mv codec/types/third_party/proto/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
|
||||
@@ -6,6 +6,7 @@ proto_dirs=$(find . -path ./third_party -prune -o -name '*.proto' -print0 | xarg
|
||||
for dir in $proto_dirs; do
|
||||
protoc \
|
||||
-I. \
|
||||
--gocosmos_out=plugins=interfacetype,paths=source_relative:. \
|
||||
--gocosmos_out=plugins=interfacetype,paths=source_relative,\
|
||||
Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types:. \
|
||||
$(find "${dir}" -name '*.proto')
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user