Merge PR #6076: Proto Any init + evidence

This commit is contained in:
Aaron Craelius
2020-05-05 10:28:20 -04:00
committed by GitHub
parent 7e72e5b8a6
commit 386217209d
82 changed files with 2145 additions and 1304 deletions
+18
View File
@@ -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
+2 -1
View File
@@ -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