From 48392e2a785ce2520331c456aff6a01a5ab54043 Mon Sep 17 00:00:00 2001 From: skyargos Date: Sat, 20 Jul 2024 16:26:44 +0800 Subject: [PATCH] fix manual vesting warning --- devtools/protocgen.sh | 13 +++++ .../auth/v1alpha1/vesting.proto | 2 +- x/auth/types/vesting.pb.go | 48 +++++++++---------- 3 files changed, 38 insertions(+), 25 deletions(-) rename proto/{shentu => cosmos}/auth/v1alpha1/vesting.proto (96%) diff --git a/devtools/protocgen.sh b/devtools/protocgen.sh index ec7e05fc0..d0b4f5c44 100755 --- a/devtools/protocgen.sh +++ b/devtools/protocgen.sh @@ -20,6 +20,19 @@ for dir in $proto_dirs; do done done +proto_dirs=$(find ./cosmos -path -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq) +for dir in $proto_dirs; do + for file in $(find "${dir}" -maxdepth 1 -name '*.proto'); do + # this regex checks if a proto file has its go_package set to cosmossdk.io/api/... + # gogo proto files SHOULD ONLY be generated if this is false + # we don't want gogo proto to run for proto files which are natively built for google.golang.org/protobuf + if grep -q "option go_package" "$file" && grep -H -o -c 'option go_package.*cosmossdk.io/api' "$file" | grep -q ':0$'; then + buf generate --template buf.gen.gogo.yaml $file + fi + done +done + + cd .. # move proto files to the right places diff --git a/proto/shentu/auth/v1alpha1/vesting.proto b/proto/cosmos/auth/v1alpha1/vesting.proto similarity index 96% rename from proto/shentu/auth/v1alpha1/vesting.proto rename to proto/cosmos/auth/v1alpha1/vesting.proto index 0022a4046..d5f9c3dca 100644 --- a/proto/shentu/auth/v1alpha1/vesting.proto +++ b/proto/cosmos/auth/v1alpha1/vesting.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -package shentu.auth.v1alpha1; +package cosmos.auth.v1alpha1; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; diff --git a/x/auth/types/vesting.pb.go b/x/auth/types/vesting.pb.go index 61520189b..482396d5a 100644 --- a/x/auth/types/vesting.pb.go +++ b/x/auth/types/vesting.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: shentu/auth/v1alpha1/vesting.proto +// source: cosmos/auth/v1alpha1/vesting.proto package types @@ -36,7 +36,7 @@ type ManualVestingAccount struct { func (m *ManualVestingAccount) Reset() { *m = ManualVestingAccount{} } func (*ManualVestingAccount) ProtoMessage() {} func (*ManualVestingAccount) Descriptor() ([]byte, []int) { - return fileDescriptor_997712a1cb236c94, []int{0} + return fileDescriptor_e917dfb43368e8d9, []int{0} } func (m *ManualVestingAccount) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -70,35 +70,35 @@ func init() { } func init() { - proto.RegisterFile("shentu/auth/v1alpha1/vesting.proto", fileDescriptor_997712a1cb236c94) + proto.RegisterFile("cosmos/auth/v1alpha1/vesting.proto", fileDescriptor_e917dfb43368e8d9) } -var fileDescriptor_997712a1cb236c94 = []byte{ - // 374 bytes of a gzipped FileDescriptorProto +var fileDescriptor_e917dfb43368e8d9 = []byte{ + // 373 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x92, 0xb1, 0x6e, 0xea, 0x30, 0x14, 0x86, 0x63, 0xb8, 0xba, 0xe2, 0x86, 0x2b, 0x55, 0x0a, 0x19, 0x28, 0x43, 0x82, 0xa2, 0x0e, 0x51, 0xa5, 0xc6, 0x0a, 0xdd, 0xd8, 0x9a, 0x0e, 0x55, 0x87, 0x2e, 0x0c, 0x1d, 0xba, 0x20, 0x27, 0xb8, 0x49, 0x44, 0xb0, 0x11, 0xb6, 0x51, 0x79, 0x80, 0x4a, 0x1d, 0x3b, 0x76, 0x64, 0xee, 0x3b, 0x74, 0x67, 0x64, 0xec, 0x94, 0x56, 0xf0, 0x06, 0x3c, 0x41, 0x95, 0xd8, 0x41, 0xa0, 0x4e, 0x49, - 0xce, 0xf9, 0xce, 0x77, 0xfe, 0xc8, 0xd6, 0x1d, 0x96, 0x60, 0x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x4a, 0x89, 0x2a, 0xc0, 0x27, 0x79, 0x1b, + 0xca, 0x60, 0xe1, 0xdf, 0xf2, 0x44, 0x2e, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x9c, 0x9d, 0x2f, + 0xc7, 0x29, 0x02, 0x00, 0x00, } func (m *ManualVestingAccount) Marshal() (dAtA []byte, err error) {