refactor: bump gogoproto (#19869)

This commit is contained in:
Ezequiel Raynaudo 2024-03-28 16:53:21 -03:00 committed by GitHub
parent d54e940d50
commit b9c8d60ea0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
76 changed files with 494 additions and 1464 deletions

View File

@ -59,6 +59,7 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i
### Improvements
* (types) [#19869](https://github.com/cosmos/cosmos-sdk/pull/19869) Removed `Any` type from `codec/types` and replaced it with an alias for `cosmos/gogoproto/types/any`.
* (server) [#19854](https://github.com/cosmos/cosmos-sdk/pull/19854) Add customizability to start command.
* Add `StartCmdOptions` in `server.AddCommands` instead of `servertypes.ModuleInitFlags`. To set custom flags set them in the `StartCmdOptions` struct on the `AddFlags` field.
* Add `StartCommandHandler` to `StartCmdOptions` to allow custom start command handlers. Users now have total control over how the app starts.

View File

@ -440,6 +440,9 @@ With the deprecation of the Amino JSON codec defined in [cosmos/gogoproto](https
For core SDK types equivalence is asserted by generative testing of [SignableTypes](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-beta.0/tests/integration/rapidgen/rapidgen.go#L102) in [TestAminoJSON_Equivalence](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-beta.0/tests/integration/tx/aminojson/aminojson_test.go#L94).
Due to the `Any` type moving to the `github.com/cosmos/gogoproto/types/any` repository, module developers must update the `buf.gen.gogo.yaml` configuration files by adjusting the corresponding `opt` option to `Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any` for correct mapping to the new `Any` type location.
**TODO: summarize proto annotation requirements.**
#### Stringer

View File

@ -168,7 +168,7 @@ func testQueryDataRacesSameHandler(t *testing.T, makeClientConn func(*baseapp.GR
qr := baseapp.NewGRPCQueryRouter()
interfaceRegistry := testdata.NewTestInterfaceRegistry()
qr.SetInterfaceRegistry(interfaceRegistry)
testdata.RegisterQueryServer(qr, testdata.QueryImpl{})
testdata_pulsar.RegisterQueryServer(qr, testdata_pulsar.QueryImpl{})
// The goal is to invoke the router concurrently and check for any data races.
// 0. Run with: go test -race

View File

@ -2,4 +2,4 @@ version: v1
plugins:
- name: gocosmos
out: ../..
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any

View File

@ -7,14 +7,14 @@ import (
context "context"
fmt "fmt"
p2p "github.com/cometbft/cometbft/proto/tendermint/p2p"
types1 "github.com/cometbft/cometbft/proto/tendermint/types"
types "github.com/cometbft/cometbft/proto/tendermint/types"
_ "github.com/cosmos/cosmos-proto"
types "github.com/cosmos/cosmos-sdk/codec/types"
query "github.com/cosmos/cosmos-sdk/types/query"
_ "github.com/cosmos/cosmos-sdk/types/tx/amino"
_ "github.com/cosmos/gogoproto/gogoproto"
grpc1 "github.com/cosmos/gogoproto/grpc"
proto "github.com/cosmos/gogoproto/proto"
any "github.com/cosmos/gogoproto/types/any"
_ "google.golang.org/genproto/googleapis/api/annotations"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
@ -261,10 +261,10 @@ func (m *GetLatestValidatorSetResponse) GetPagination() *query.PageResponse {
// Validator is the type for the validator-set.
type Validator struct {
Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
PubKey *types.Any `protobuf:"bytes,2,opt,name=pub_key,json=pubKey,proto3" json:"pub_key,omitempty"`
VotingPower int64 `protobuf:"varint,3,opt,name=voting_power,json=votingPower,proto3" json:"voting_power,omitempty"`
ProposerPriority int64 `protobuf:"varint,4,opt,name=proposer_priority,json=proposerPriority,proto3" json:"proposer_priority,omitempty"`
Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
PubKey *any.Any `protobuf:"bytes,2,opt,name=pub_key,json=pubKey,proto3" json:"pub_key,omitempty"`
VotingPower int64 `protobuf:"varint,3,opt,name=voting_power,json=votingPower,proto3" json:"voting_power,omitempty"`
ProposerPriority int64 `protobuf:"varint,4,opt,name=proposer_priority,json=proposerPriority,proto3" json:"proposer_priority,omitempty"`
}
func (m *Validator) Reset() { *m = Validator{} }
@ -307,7 +307,7 @@ func (m *Validator) GetAddress() string {
return ""
}
func (m *Validator) GetPubKey() *types.Any {
func (m *Validator) GetPubKey() *any.Any {
if m != nil {
return m.PubKey
}
@ -375,9 +375,9 @@ func (m *GetBlockByHeightRequest) GetHeight() int64 {
// GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight RPC method.
type GetBlockByHeightResponse struct {
BlockId *types1.BlockID `protobuf:"bytes,1,opt,name=block_id,json=blockId,proto3" json:"block_id,omitempty"`
BlockId *types.BlockID `protobuf:"bytes,1,opt,name=block_id,json=blockId,proto3" json:"block_id,omitempty"`
// Deprecated: please use `sdk_block` instead
Block *types1.Block `protobuf:"bytes,2,opt,name=block,proto3" json:"block,omitempty"`
Block *types.Block `protobuf:"bytes,2,opt,name=block,proto3" json:"block,omitempty"`
// Since: cosmos-sdk 0.47
SdkBlock *Block `protobuf:"bytes,3,opt,name=sdk_block,json=sdkBlock,proto3" json:"sdk_block,omitempty"`
}
@ -415,14 +415,14 @@ func (m *GetBlockByHeightResponse) XXX_DiscardUnknown() {
var xxx_messageInfo_GetBlockByHeightResponse proto.InternalMessageInfo
func (m *GetBlockByHeightResponse) GetBlockId() *types1.BlockID {
func (m *GetBlockByHeightResponse) GetBlockId() *types.BlockID {
if m != nil {
return m.BlockId
}
return nil
}
func (m *GetBlockByHeightResponse) GetBlock() *types1.Block {
func (m *GetBlockByHeightResponse) GetBlock() *types.Block {
if m != nil {
return m.Block
}
@ -475,9 +475,9 @@ var xxx_messageInfo_GetLatestBlockRequest proto.InternalMessageInfo
// GetLatestBlockResponse is the response type for the Query/GetLatestBlock RPC method.
type GetLatestBlockResponse struct {
BlockId *types1.BlockID `protobuf:"bytes,1,opt,name=block_id,json=blockId,proto3" json:"block_id,omitempty"`
BlockId *types.BlockID `protobuf:"bytes,1,opt,name=block_id,json=blockId,proto3" json:"block_id,omitempty"`
// Deprecated: please use `sdk_block` instead
Block *types1.Block `protobuf:"bytes,2,opt,name=block,proto3" json:"block,omitempty"`
Block *types.Block `protobuf:"bytes,2,opt,name=block,proto3" json:"block,omitempty"`
// Since: cosmos-sdk 0.47
SdkBlock *Block `protobuf:"bytes,3,opt,name=sdk_block,json=sdkBlock,proto3" json:"sdk_block,omitempty"`
}
@ -515,14 +515,14 @@ func (m *GetLatestBlockResponse) XXX_DiscardUnknown() {
var xxx_messageInfo_GetLatestBlockResponse proto.InternalMessageInfo
func (m *GetLatestBlockResponse) GetBlockId() *types1.BlockID {
func (m *GetLatestBlockResponse) GetBlockId() *types.BlockID {
if m != nil {
return m.BlockId
}
return nil
}
func (m *GetLatestBlockResponse) GetBlock() *types1.Block {
func (m *GetLatestBlockResponse) GetBlock() *types.Block {
if m != nil {
return m.Block
}
@ -3429,7 +3429,7 @@ func (m *Validator) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.PubKey == nil {
m.PubKey = &types.Any{}
m.PubKey = &any.Any{}
}
if err := m.PubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
@ -3622,7 +3622,7 @@ func (m *GetBlockByHeightResponse) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.BlockId == nil {
m.BlockId = &types1.BlockID{}
m.BlockId = &types.BlockID{}
}
if err := m.BlockId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
@ -3658,7 +3658,7 @@ func (m *GetBlockByHeightResponse) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.Block == nil {
m.Block = &types1.Block{}
m.Block = &types.Block{}
}
if err := m.Block.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
@ -3830,7 +3830,7 @@ func (m *GetLatestBlockResponse) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.BlockId == nil {
m.BlockId = &types1.BlockID{}
m.BlockId = &types.BlockID{}
}
if err := m.BlockId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
@ -3866,7 +3866,7 @@ func (m *GetLatestBlockResponse) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.Block == nil {
m.Block = &types1.Block{}
m.Block = &types.Block{}
}
if err := m.Block.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err

View File

@ -3,6 +3,7 @@ package codec_test
import (
"testing"
"github.com/cosmos/gogoproto/types/any/test"
"github.com/stretchr/testify/require"
"github.com/cosmos/cosmos-sdk/codec"
@ -10,30 +11,29 @@ import (
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/crypto/keys/ed25519"
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
"github.com/cosmos/cosmos-sdk/testutil/testdata"
"github.com/cosmos/cosmos-sdk/types/module/testutil"
)
func NewTestInterfaceRegistry() codectypes.InterfaceRegistry {
registry := codectypes.NewInterfaceRegistry()
registry.RegisterInterface("Animal", (*testdata.Animal)(nil))
registry.RegisterInterface("Animal", (*test.Animal)(nil))
registry.RegisterImplementations(
(*testdata.Animal)(nil),
&testdata.Dog{},
&testdata.Cat{},
(*test.Animal)(nil),
&test.Dog{},
&test.Cat{},
)
return registry
}
func TestMarshalAny(t *testing.T) {
catRegistry := codectypes.NewInterfaceRegistry()
catRegistry.RegisterImplementations((*testdata.Animal)(nil), &testdata.Cat{})
catRegistry.RegisterImplementations((*test.Animal)(nil), &test.Cat{})
registry := codectypes.NewInterfaceRegistry()
cdc := codec.NewProtoCodec(registry)
kitty := &testdata.Cat{Moniker: "Kitty"}
kitty := &test.Cat{Moniker: "Kitty"}
emptyBz, err := cdc.MarshalInterface(kitty)
require.ErrorContains(t, err, "does not have a registered interface")
@ -41,11 +41,11 @@ func TestMarshalAny(t *testing.T) {
require.NoError(t, err)
require.NotEmpty(t, catBz)
var animal testdata.Animal
var animal test.Animal
// deserializing cat bytes should error in an empty registry
err = cdc.UnmarshalInterface(catBz, &animal)
require.ErrorContains(t, err, "no registered implementations of type testdata.Animal")
require.ErrorContains(t, err, "no registered implementations of type test.Animal")
// deserializing an empty byte array will return nil, but no error
err = cdc.UnmarshalInterface(emptyBz, &animal)
@ -53,7 +53,7 @@ func TestMarshalAny(t *testing.T) {
require.NoError(t, err)
// wrong type registration should fail
registry.RegisterImplementations((*testdata.Animal)(nil), &testdata.Dog{})
registry.RegisterImplementations((*test.Animal)(nil), &test.Dog{})
err = cdc.UnmarshalInterface(catBz, &animal)
require.Error(t, err)

View File

@ -1,154 +1,39 @@
package types
import (
fmt "fmt"
"github.com/cosmos/gogoproto/proto"
protov2 "google.golang.org/protobuf/proto"
errorsmod "cosmossdk.io/errors"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
gogoproto "github.com/cosmos/gogoproto/types/any"
)
type Any struct {
// A URL/resource name that uniquely identifies the type of the serialized
// protocol buffer message. This string must contain at least
// one "/" character. The last segment of the URL's path must represent
// the fully qualified name of the type (as in
// `path/google.protobuf.Duration`). The name should be in a canonical form
// (e.g., leading "." is not accepted).
//
// In practice, teams usually precompile into the binary all types that they
// expect it to use in the context of Any. However, for URLs which use the
// scheme `http`, `https`, or no scheme, one can optionally set up a type
// server that maps type URLs to message definitions as follows:
//
// * If no scheme is provided, `https` is assumed.
// * An HTTP GET on the URL must yield a [google.protobuf.Type][]
// value in binary format, or produce an error.
// * Applications are allowed to cache lookup results based on the
// URL, or have them precompiled into a binary to avoid any
// lookup. Therefore, binary compatibility needs to be preserved
// on changes to types. (Use versioned type names to manage
// breaking changes.)
//
// Note: this functionality is not currently available in the official
// protobuf release, and it is not used for type URLs beginning with
// type.googleapis.com.
//
// Schemes other than `http`, `https` (or the empty scheme) might be
// used with implementation specific semantics.
// Any is an alias for gogoproto.Any. It represents a protocol buffer message
// that can contain any arbitrary data. This is used for encoding and decoding
// unknown or dynamic content in a type-safe manner.
type Any = gogoproto.Any
TypeUrl string `protobuf:"bytes,1,opt,name=type_url,json=typeUrl,proto3" json:"type_url,omitempty"`
// AminoPacker is an alias for gogoproto.AminoPacker. It provides functionality
// for packing and unpacking data using the Amino encoding.
type AminoPacker = gogoproto.AminoPacker
// Must be a valid serialized protocol buffer of the above specified type.
Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
// AminoUnpacker is an alias for gogoproto.AminoUnpacker. It is used for
// unpacking Amino-encoded data into Go types.
type AminoUnpacker = gogoproto.AminoUnpacker
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
// AminoJSONPacker is an alias for gogoproto.AminoJSONPacker. It allows for
// packing data into a JSON format using Amino encoding rules.
type AminoJSONPacker = gogoproto.AminoJSONPacker
cachedValue interface{}
// AminoJSONUnpacker is an alias for gogoproto.AminoJSONUnpacker. It provides
// the ability to unpack JSON data encoded with Amino encoding rules.
type AminoJSONUnpacker = gogoproto.AminoJSONUnpacker
compat *anyCompat
}
// ProtoJSONPacker is an alias for gogoproto.ProtoJSONPacker. This is used for
// packing protocol buffer messages into a JSON format.
type ProtoJSONPacker = gogoproto.ProtoJSONPacker
// NewAnyWithValue constructs a new Any packed with the value provided or
// returns an error if that value couldn't be packed. This also caches
// the packed value so that it can be retrieved from GetCachedValue without
// unmarshaling
func NewAnyWithValue(v proto.Message) (*Any, error) {
if v == nil {
return nil, errorsmod.Wrap(sdkerrors.ErrPackAny, "Expecting non nil value to create a new Any")
}
// NewAnyWithValue is an alias for gogoproto.NewAnyWithCacheWithValue. This function
// creates a new Any instance containing the provided value, with caching
// mechanisms to improve performance.
var NewAnyWithValue = gogoproto.NewAnyWithCacheWithValue
var (
bz []byte
err error
)
if msg, ok := v.(protov2.Message); ok {
protov2MarshalOpts := protov2.MarshalOptions{Deterministic: true}
bz, err = protov2MarshalOpts.Marshal(msg)
} else {
bz, err = proto.Marshal(v)
}
if err != nil {
return nil, err
}
return &Any{
TypeUrl: MsgTypeURL(v),
Value: bz,
cachedValue: v,
}, nil
}
// UnsafePackAny packs the value x in the Any and instead of returning the error
// in the case of a packing failure, keeps the cached value. This should only
// be used in situations where compatibility is needed with amino. Amino-only
// values can safely be packed using this method when they will only be
// marshaled with amino and not protobuf.
func UnsafePackAny(x interface{}) *Any {
if msg, ok := x.(proto.Message); ok {
any, err := NewAnyWithValue(msg)
if err == nil {
return any
}
}
return &Any{cachedValue: x}
}
// pack packs the value x in the Any or returns an error. This also caches
// the packed value so that it can be retrieved from GetCachedValue without
// unmarshaling
func (any *Any) pack(x proto.Message) error {
any.TypeUrl = MsgTypeURL(x)
var (
bz []byte
err error
)
if msg, ok := x.(protov2.Message); ok {
protov2MarshalOpts := protov2.MarshalOptions{Deterministic: true}
bz, err = protov2MarshalOpts.Marshal(msg)
} else {
bz, err = proto.Marshal(x)
}
if err != nil {
return err
}
any.Value = bz
any.cachedValue = x
return nil
}
// GetCachedValue returns the cached value from the Any if present
func (any *Any) GetCachedValue() interface{} {
return any.cachedValue
}
// GoString returns a string representing valid go code to reproduce the current state of
// the struct.
func (any *Any) GoString() string {
if any == nil {
return "nil"
}
extra := ""
if any.XXX_unrecognized != nil {
extra = fmt.Sprintf(",\n XXX_unrecognized: %#v,\n", any.XXX_unrecognized)
}
return fmt.Sprintf("&Any{TypeUrl: %#v,\n Value: %#v%s\n}",
any.TypeUrl, any.Value, extra)
}
// String implements the stringer interface
func (any *Any) String() string {
if any == nil {
return "nil"
}
return fmt.Sprintf("&Any{TypeUrl:%v,Value:%v,XXX_unrecognized:%v}",
any.TypeUrl, any.Value, any.XXX_unrecognized)
}
// UnsafePackAny is an alias for gogoproto.UnsafePackAnyWithCache. This function
// packs a given message into an Any type without performing safety checks.
var UnsafePackAny = gogoproto.UnsafePackAnyWithCache

View File

@ -1,535 +0,0 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: google/protobuf/any.proto
package types
import (
bytes "bytes"
fmt "fmt"
_ "github.com/cosmos/gogoproto/gogoproto"
proto "github.com/cosmos/gogoproto/proto"
io "io"
math "math"
math_bits "math/bits"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
func (m *Any) Reset() { *m = Any{} }
func (*Any) ProtoMessage() {}
func (*Any) Descriptor() ([]byte, []int) {
return fileDescriptor_b53526c13ae22eb4, []int{0}
}
func (*Any) XXX_WellKnownType() string { return "Any" }
func (m *Any) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *Any) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_Any.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *Any) XXX_Merge(src proto.Message) {
xxx_messageInfo_Any.Merge(m, src)
}
func (m *Any) XXX_Size() int {
return m.Size()
}
func (m *Any) XXX_DiscardUnknown() {
xxx_messageInfo_Any.DiscardUnknown(m)
}
var xxx_messageInfo_Any proto.InternalMessageInfo
func (m *Any) GetTypeUrl() string {
if m != nil {
return m.TypeUrl
}
return ""
}
func (m *Any) GetValue() []byte {
if m != nil {
return m.Value
}
return nil
}
func (*Any) XXX_MessageName() string {
return "google.protobuf.Any"
}
func init() {
}
func init() { proto.RegisterFile("google/protobuf/any.proto", fileDescriptor_b53526c13ae22eb4) }
var fileDescriptor_b53526c13ae22eb4 = []byte{
// 248 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4c, 0xcf, 0xcf, 0x4f,
0xcf, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x4f, 0xcc, 0xab, 0xd4,
0x03, 0x73, 0x84, 0xf8, 0x21, 0x52, 0x7a, 0x30, 0x29, 0x29, 0x91, 0xf4, 0xfc, 0xf4, 0x7c, 0x30,
0x4f, 0x1f, 0xc4, 0x82, 0x48, 0x28, 0x79, 0x70, 0x31, 0x3b, 0xe6, 0x55, 0x0a, 0x49, 0x72, 0x71,
0x94, 0x54, 0x16, 0xa4, 0xc6, 0x97, 0x16, 0xe5, 0x48, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x06, 0xb1,
0x83, 0xf8, 0xa1, 0x45, 0x39, 0x42, 0x22, 0x5c, 0xac, 0x65, 0x89, 0x39, 0xa5, 0xa9, 0x12, 0x4c,
0x0a, 0x8c, 0x1a, 0x3c, 0x41, 0x10, 0x8e, 0x95, 0xc0, 0x8c, 0x05, 0xf2, 0x0c, 0x1b, 0x16, 0xc8,
0x33, 0x7c, 0x58, 0x28, 0xcf, 0xd0, 0x70, 0x47, 0x81, 0xc1, 0xa9, 0x99, 0xf1, 0xc6, 0x43, 0x39,
0x86, 0x0f, 0x0f, 0xe5, 0x18, 0x7f, 0x3c, 0x94, 0x63, 0x6c, 0x78, 0x24, 0xc7, 0xb8, 0xe2, 0x91,
0x1c, 0xe3, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0xf8, 0xe2,
0x91, 0x1c, 0xc3, 0x07, 0x90, 0xf8, 0x63, 0x39, 0xc6, 0x03, 0x8f, 0xe5, 0x18, 0x4e, 0x3c, 0x96,
0x63, 0xe4, 0x12, 0x4e, 0xce, 0xcf, 0xd5, 0x43, 0x73, 0xab, 0x13, 0x87, 0x63, 0x5e, 0x65, 0x00,
0x88, 0x13, 0xc0, 0x18, 0xc5, 0x0a, 0x72, 0x48, 0xf1, 0x22, 0x26, 0x66, 0xf7, 0x00, 0xa7, 0x55,
0x4c, 0x72, 0xee, 0x10, 0xa5, 0x01, 0x50, 0xa5, 0x7a, 0xe1, 0xa9, 0x39, 0x39, 0xde, 0x79, 0xf9,
0xe5, 0x79, 0x21, 0x20, 0x65, 0x49, 0x6c, 0x60, 0x33, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff,
0x4d, 0x91, 0x00, 0xa0, 0x1a, 0x01, 0x00, 0x00,
}
func (this *Any) Compare(that interface{}) int {
if that == nil {
if this == nil {
return 0
}
return 1
}
that1, ok := that.(*Any)
if !ok {
that2, ok := that.(Any)
if ok {
that1 = &that2
} else {
return 1
}
}
if that1 == nil {
if this == nil {
return 0
}
return 1
} else if this == nil {
return -1
}
if this.TypeUrl != that1.TypeUrl {
if this.TypeUrl < that1.TypeUrl {
return -1
}
return 1
}
if c := bytes.Compare(this.Value, that1.Value); c != 0 {
return c
}
if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 {
return c
}
return 0
}
func (this *Any) Equal(that interface{}) bool {
if that == nil {
return this == nil
}
that1, ok := that.(*Any)
if !ok {
that2, ok := that.(Any)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
return this == nil
} else if this == nil {
return false
}
if this.TypeUrl != that1.TypeUrl {
return false
}
if !bytes.Equal(this.Value, that1.Value) {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (m *Any) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *Any) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *Any) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.XXX_unrecognized != nil {
i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
}
if len(m.Value) > 0 {
i -= len(m.Value)
copy(dAtA[i:], m.Value)
i = encodeVarintAny(dAtA, i, uint64(len(m.Value)))
i--
dAtA[i] = 0x12
}
if len(m.TypeUrl) > 0 {
i -= len(m.TypeUrl)
copy(dAtA[i:], m.TypeUrl)
i = encodeVarintAny(dAtA, i, uint64(len(m.TypeUrl)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func encodeVarintAny(dAtA []byte, offset int, v uint64) int {
offset -= sovAny(v)
base := offset
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return base
}
func NewPopulatedAny(r randyAny, easy bool) *Any {
this := &Any{}
this.TypeUrl = string(randStringAny(r))
v1 := r.Intn(100)
this.Value = make([]byte, v1)
for i := 0; i < v1; i++ {
this.Value[i] = byte(r.Intn(256))
}
if !easy && r.Intn(10) != 0 {
this.XXX_unrecognized = randUnrecognizedAny(r, 3)
}
return this
}
type randyAny interface {
Float32() float32
Float64() float64
Int63() int64
Int31() int32
Uint32() uint32
Intn(n int) int
}
func randUTF8RuneAny(r randyAny) rune {
ru := r.Intn(62)
if ru < 10 {
return rune(ru + 48)
} else if ru < 36 {
return rune(ru + 55)
}
return rune(ru + 61)
}
func randStringAny(r randyAny) string {
v2 := r.Intn(100)
tmps := make([]rune, v2)
for i := 0; i < v2; i++ {
tmps[i] = randUTF8RuneAny(r)
}
return string(tmps)
}
func randUnrecognizedAny(r randyAny, maxFieldNumber int) (dAtA []byte) {
l := r.Intn(5)
for i := 0; i < l; i++ {
wire := r.Intn(4)
if wire == 3 {
wire = 5
}
fieldNumber := maxFieldNumber + r.Intn(100)
dAtA = randFieldAny(dAtA, r, fieldNumber, wire)
}
return dAtA
}
func randFieldAny(dAtA []byte, r randyAny, fieldNumber int, wire int) []byte {
key := uint32(fieldNumber)<<3 | uint32(wire)
switch wire {
case 0:
dAtA = encodeVarintPopulateAny(dAtA, uint64(key))
v3 := r.Int63()
if r.Intn(2) == 0 {
v3 *= -1
}
dAtA = encodeVarintPopulateAny(dAtA, uint64(v3))
case 1:
dAtA = encodeVarintPopulateAny(dAtA, uint64(key))
dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
case 2:
dAtA = encodeVarintPopulateAny(dAtA, uint64(key))
ll := r.Intn(100)
dAtA = encodeVarintPopulateAny(dAtA, uint64(ll))
for j := 0; j < ll; j++ {
dAtA = append(dAtA, byte(r.Intn(256)))
}
default:
dAtA = encodeVarintPopulateAny(dAtA, uint64(key))
dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
}
return dAtA
}
func encodeVarintPopulateAny(dAtA []byte, v uint64) []byte {
for v >= 1<<7 {
dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80))
v >>= 7
}
dAtA = append(dAtA, uint8(v))
return dAtA
}
func (m *Any) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = len(m.TypeUrl)
if l > 0 {
n += 1 + l + sovAny(uint64(l))
}
l = len(m.Value)
if l > 0 {
n += 1 + l + sovAny(uint64(l))
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
return n
}
func sovAny(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
func sozAny(x uint64) (n int) {
return sovAny(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *Any) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowAny
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: Any: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: Any: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field TypeUrl", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowAny
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthAny
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthAny
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.TypeUrl = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType)
}
var byteLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowAny
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if byteLen < 0 {
return ErrInvalidLengthAny
}
postIndex := iNdEx + byteLen
if postIndex < 0 {
return ErrInvalidLengthAny
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...)
if m.Value == nil {
m.Value = []byte{}
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipAny(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthAny
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipAny(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
depth := 0
for iNdEx < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowAny
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
wireType := int(wire & 0x7)
switch wireType {
case 0:
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowAny
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if dAtA[iNdEx-1] < 0x80 {
break
}
}
case 1:
iNdEx += 8
case 2:
var length int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowAny
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if length < 0 {
return 0, ErrInvalidLengthAny
}
iNdEx += length
case 3:
depth++
case 4:
if depth == 0 {
return 0, ErrUnexpectedEndOfGroupAny
}
depth--
case 5:
iNdEx += 4
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
if iNdEx < 0 {
return 0, ErrInvalidLengthAny
}
if depth == 0 {
return iNdEx, nil
}
}
return 0, io.ErrUnexpectedEOF
}
var (
ErrInvalidLengthAny = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowAny = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupAny = fmt.Errorf("proto: unexpected end of group")
)

View File

@ -48,7 +48,7 @@ func TestAnyPackUnpack(t *testing.T) {
require.Equal(t, spot, animal)
// without cache
any.cachedValue = nil
any.ResetCachedValue()
err = registry.UnpackAny(any, &animal)
require.NoError(t, err)
require.Equal(t, spot, animal)

View File

@ -1,210 +0,0 @@
package types
import (
"fmt"
"reflect"
"runtime/debug"
"github.com/cosmos/gogoproto/jsonpb"
"github.com/cosmos/gogoproto/proto"
amino "github.com/tendermint/go-amino"
)
type anyCompat struct {
aminoBz []byte
jsonBz []byte
err error
}
var Debug = true
func anyCompatError(errType string, x interface{}) error {
if Debug {
debug.PrintStack()
}
return fmt.Errorf(
"%s marshaling error for %+v, this is likely because "+
"amino is being used directly (instead of codec.LegacyAmino which is preferred) "+
"or UnpackInterfacesMessage is not defined for some type which contains "+
"a protobuf Any either directly or via one of its members. To see a "+
"stacktrace of where the error is coming from, set the var Debug = true "+
"in codec/types/compat.go",
errType, x,
)
}
func (any Any) MarshalAmino() ([]byte, error) {
ac := any.compat
if ac == nil {
return nil, anyCompatError("amino binary marshal", any)
}
return ac.aminoBz, ac.err
}
func (any *Any) UnmarshalAmino(bz []byte) error {
any.compat = &anyCompat{
aminoBz: bz,
err: nil,
}
return nil
}
func (any *Any) MarshalJSON() ([]byte, error) {
ac := any.compat
if ac == nil {
return nil, anyCompatError("JSON marshal", any)
}
return ac.jsonBz, ac.err
}
func (any *Any) UnmarshalJSON(bz []byte) error {
any.compat = &anyCompat{
jsonBz: bz,
err: nil,
}
return nil
}
// AminoUnpacker is an AnyUnpacker provided for backwards compatibility with
// amino for the binary un-marshaling phase
type AminoUnpacker struct {
Cdc *amino.Codec
}
var _ AnyUnpacker = AminoUnpacker{}
func (a AminoUnpacker) UnpackAny(any *Any, iface interface{}) error {
ac := any.compat
if ac == nil {
return anyCompatError("amino binary unmarshal", reflect.TypeOf(iface))
}
err := a.Cdc.UnmarshalBinaryBare(ac.aminoBz, iface)
if err != nil {
return err
}
val := reflect.ValueOf(iface).Elem().Interface()
err = UnpackInterfaces(val, a)
if err != nil {
return err
}
if m, ok := val.(proto.Message); ok {
if err = any.pack(m); err != nil {
return err
}
} else {
any.cachedValue = val
}
// this is necessary for tests that use reflect.DeepEqual and compare
// proto vs amino marshaled values
any.compat = nil
return nil
}
// AminoPacker is provided for backwards compatibility with
// amino for the binary marshaling phase
type AminoPacker struct {
Cdc *amino.Codec
}
var _ AnyUnpacker = AminoPacker{}
func (a AminoPacker) UnpackAny(any *Any, _ interface{}) error {
err := UnpackInterfaces(any.cachedValue, a)
if err != nil {
return err
}
bz, err := a.Cdc.MarshalBinaryBare(any.cachedValue)
any.compat = &anyCompat{
aminoBz: bz,
err: err,
}
return err
}
// AminoJSONUnpacker is an AnyUnpacker provided for backwards compatibility with
// amino for the JSON marshaling phase
type AminoJSONUnpacker struct {
Cdc *amino.Codec
}
var _ AnyUnpacker = AminoJSONUnpacker{}
func (a AminoJSONUnpacker) UnpackAny(any *Any, iface interface{}) error {
ac := any.compat
if ac == nil {
return anyCompatError("JSON unmarshal", reflect.TypeOf(iface))
}
err := a.Cdc.UnmarshalJSON(ac.jsonBz, iface)
if err != nil {
return err
}
val := reflect.ValueOf(iface).Elem().Interface()
err = UnpackInterfaces(val, a)
if err != nil {
return err
}
if m, ok := val.(proto.Message); ok {
if err = any.pack(m); err != nil {
return err
}
} else {
any.cachedValue = val
}
// this is necessary for tests that use reflect.DeepEqual and compare
// proto vs amino marshaled values
any.compat = nil
return nil
}
// AminoJSONPacker is an AnyUnpacker provided for backwards compatibility with
// amino for the JSON un-marshaling phase
type AminoJSONPacker struct {
Cdc *amino.Codec
}
var _ AnyUnpacker = AminoJSONPacker{}
func (a AminoJSONPacker) UnpackAny(any *Any, _ interface{}) error {
err := UnpackInterfaces(any.cachedValue, a)
if err != nil {
return err
}
bz, err := a.Cdc.MarshalJSON(any.cachedValue)
any.compat = &anyCompat{
jsonBz: bz,
err: err,
}
return err
}
// ProtoJSONPacker is an AnyUnpacker provided for compatibility with jsonpb
type ProtoJSONPacker struct {
JSONPBMarshaler *jsonpb.Marshaler
}
var _ AnyUnpacker = ProtoJSONPacker{}
func (a ProtoJSONPacker) UnpackAny(any *Any, _ interface{}) error {
if any == nil {
return nil
}
if any.cachedValue != nil {
err := UnpackInterfaces(any.cachedValue, a)
if err != nil {
return err
}
}
bz, err := a.JSONPBMarshaler.MarshalToString(any)
any.compat = &anyCompat{
jsonBz: []byte(bz),
err: err,
}
return err
}

View File

@ -1,132 +0,0 @@
package types_test
import (
"testing"
"github.com/stretchr/testify/suite"
amino "github.com/tendermint/go-amino"
"github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/testutil/testdata"
)
type TypeWithInterface struct {
Animal testdata.Animal `json:"animal"`
X int64 `json:"x,omitempty"`
}
type Suite struct {
suite.Suite
cdc *amino.Codec
a TypeWithInterface
b testdata.HasAnimal
spot *testdata.Dog
}
func (s *Suite) SetupTest() {
s.cdc = amino.NewCodec()
s.cdc.RegisterInterface((*testdata.Animal)(nil), nil)
s.cdc.RegisterConcrete(&testdata.Dog{}, "testdata/Dog", nil)
s.spot = &testdata.Dog{Size_: "small", Name: "Spot"}
s.a = TypeWithInterface{Animal: s.spot}
any, err := types.NewAnyWithValue(s.spot)
s.Require().NoError(err)
s.b = testdata.HasAnimal{Animal: any}
}
func (s *Suite) TestAminoBinary() {
bz, err := s.cdc.MarshalBinaryBare(s.a)
s.Require().NoError(err)
// expect plain amino marshal to fail
_, err = s.cdc.MarshalBinaryBare(s.b)
s.Require().Error(err)
// expect unpack interfaces before amino marshal to succeed
err = types.UnpackInterfaces(s.b, types.AminoPacker{Cdc: s.cdc})
s.Require().NoError(err)
bz2, err := s.cdc.MarshalBinaryBare(s.b)
s.Require().NoError(err)
s.Require().Equal(bz, bz2)
var c testdata.HasAnimal
err = s.cdc.UnmarshalBinaryBare(bz, &c)
s.Require().NoError(err)
err = types.UnpackInterfaces(c, types.AminoUnpacker{Cdc: s.cdc})
s.Require().NoError(err)
s.Require().Equal(s.spot, c.Animal.GetCachedValue())
}
func (s *Suite) TestAminoJSON() {
bz, err := s.cdc.MarshalJSON(s.a)
s.Require().NoError(err)
// expect plain amino marshal to fail
_, err = s.cdc.MarshalJSON(s.b)
s.Require().Error(err)
// expect unpack interfaces before amino marshal to succeed
err = types.UnpackInterfaces(s.b, types.AminoJSONPacker{Cdc: s.cdc})
s.Require().NoError(err)
bz2, err := s.cdc.MarshalJSON(s.b)
s.Require().NoError(err)
s.Require().Equal(string(bz), string(bz2))
var c testdata.HasAnimal
err = s.cdc.UnmarshalJSON(bz, &c)
s.Require().NoError(err)
err = types.UnpackInterfaces(c, types.AminoJSONUnpacker{Cdc: s.cdc})
s.Require().NoError(err)
s.Require().Equal(s.spot, c.Animal.GetCachedValue())
}
func (s *Suite) TestNested() {
s.cdc.RegisterInterface((*testdata.HasAnimalI)(nil), nil)
s.cdc.RegisterInterface((*testdata.HasHasAnimalI)(nil), nil)
s.cdc.RegisterConcrete(&testdata.HasAnimal{}, "testdata/HasAnimal", nil)
s.cdc.RegisterConcrete(&testdata.HasHasAnimal{}, "testdata/HasHasAnimal", nil)
s.cdc.RegisterConcrete(&testdata.HasHasHasAnimal{}, "testdata/HasHasHasAnimal", nil)
any, err := types.NewAnyWithValue(&s.b)
s.Require().NoError(err)
hha := testdata.HasHasAnimal{HasAnimal: any}
any2, err := types.NewAnyWithValue(&hha)
s.Require().NoError(err)
hhha := testdata.HasHasHasAnimal{HasHasAnimal: any2}
// marshal
err = types.UnpackInterfaces(hhha, types.AminoPacker{Cdc: s.cdc})
s.Require().NoError(err)
bz, err := s.cdc.MarshalBinaryBare(hhha)
s.Require().NoError(err)
// unmarshal
var hhha2 testdata.HasHasHasAnimal
err = s.cdc.UnmarshalBinaryBare(bz, &hhha2)
s.Require().NoError(err)
err = types.UnpackInterfaces(hhha2, types.AminoUnpacker{Cdc: s.cdc})
s.Require().NoError(err)
s.Require().Equal(s.spot, hhha2.TheHasHasAnimal().TheHasAnimal().TheAnimal())
// json marshal
err = types.UnpackInterfaces(hhha, types.AminoJSONPacker{Cdc: s.cdc})
s.Require().NoError(err)
jsonBz, err := s.cdc.MarshalJSON(hhha)
s.Require().NoError(err)
// json unmarshal
var hhha3 testdata.HasHasHasAnimal
err = s.cdc.UnmarshalJSON(jsonBz, &hhha3)
s.Require().NoError(err)
err = types.UnpackInterfaces(hhha3, types.AminoJSONUnpacker{Cdc: s.cdc})
s.Require().NoError(err)
s.Require().Equal(s.spot, hhha3.TheHasHasAnimal().TheHasAnimal().TheAnimal())
}
func TestSuite(t *testing.T) {
suite.Run(t, &Suite{})
}

View File

@ -15,8 +15,6 @@ import (
"cosmossdk.io/x/tx/signing"
)
var protoMessageType = reflect.TypeOf((*proto.Message)(nil)).Elem()
// AnyUnpacker is an interface which allows safely unpacking types packed
// in Any's against a whitelist of registered types
type AnyUnpacker interface {
@ -30,6 +28,41 @@ type AnyUnpacker interface {
UnpackAny(any *Any, iface interface{}) error
}
// UnpackInterfacesMessage is meant to extend protobuf types (which implement
// proto.Message) to support a post-deserialization phase which unpacks
// types packed within Any's using the whitelist provided by AnyUnpacker
type UnpackInterfacesMessage interface {
// UnpackInterfaces is implemented in order to unpack values packed within
// Any's using the AnyUnpacker. It should generally be implemented as
// follows:
// func (s *MyStruct) UnpackInterfaces(unpacker AnyUnpacker) error {
// var x AnyInterface
// // where X is an Any field on MyStruct
// err := unpacker.UnpackAny(s.X, &x)
// if err != nil {
// return nil
// }
// // where Y is a field on MyStruct that implements UnpackInterfacesMessage itself
// err = s.Y.UnpackInterfaces(unpacker)
// if err != nil {
// return nil
// }
// return nil
// }
UnpackInterfaces(unpacker AnyUnpacker) error
}
// UnpackInterfaces is a convenience function that calls UnpackInterfaces
// on x if x implements UnpackInterfacesMessage
func UnpackInterfaces(x interface{}, unpacker AnyUnpacker) error {
if msg, ok := x.(UnpackInterfacesMessage); ok {
return msg.UnpackInterfaces(unpacker)
}
return nil
}
var protoMessageType = reflect.TypeOf((*proto.Message)(nil)).Elem()
// InterfaceRegistry provides a mechanism for registering interfaces and
// implementations that can be safely unpacked from Any
type InterfaceRegistry interface {
@ -62,30 +95,6 @@ type InterfaceRegistry interface {
mustEmbedInterfaceRegistry()
}
// UnpackInterfacesMessage is meant to extend protobuf types (which implement
// proto.Message) to support a post-deserialization phase which unpacks
// types packed within Any's using the whitelist provided by AnyUnpacker
type UnpackInterfacesMessage interface {
// UnpackInterfaces is implemented in order to unpack values packed within
// Any's using the AnyUnpacker. It should generally be implemented as
// follows:
// func (s *MyStruct) UnpackInterfaces(unpacker AnyUnpacker) error {
// var x AnyInterface
// // where X is an Any field on MyStruct
// err := unpacker.UnpackAny(s.X, &x)
// if err != nil {
// return nil
// }
// // where Y is a field on MyStruct that implements UnpackInterfacesMessage itself
// err = s.Y.UnpackInterfaces(unpacker)
// if err != nil {
// return nil
// }
// return nil
// }
UnpackInterfaces(unpacker AnyUnpacker) error
}
type interfaceRegistry struct {
signing.ProtoFileResolver
interfaceNames map[string]reflect.Type
@ -275,7 +284,7 @@ func (registry *interfaceRegistry) UnpackAny(any *Any, iface interface{}) error
rt := rv.Elem().Type()
cachedValue := any.cachedValue
cachedValue := any.GetCachedValue()
if cachedValue != nil {
if reflect.TypeOf(cachedValue).AssignableTo(rt) {
rv.Elem().Set(reflect.ValueOf(cachedValue))
@ -312,8 +321,12 @@ func (registry *interfaceRegistry) UnpackAny(any *Any, iface interface{}) error
rv.Elem().Set(reflect.ValueOf(msg))
any.cachedValue = msg
newAnyWithCache, err := NewAnyWithValue(msg)
if err != nil {
return err
}
*any = *newAnyWithCache
return nil
}
@ -340,15 +353,6 @@ func (registry *interfaceRegistry) SigningContext() *signing.Context {
func (registry *interfaceRegistry) mustEmbedInterfaceRegistry() {}
// UnpackInterfaces is a convenience function that calls UnpackInterfaces
// on x if x implements UnpackInterfacesMessage
func UnpackInterfaces(x interface{}, unpacker AnyUnpacker) error {
if msg, ok := x.(UnpackInterfacesMessage); ok {
return msg.UnpackInterfaces(unpacker)
}
return nil
}
type failingAddressCodec struct{}
func (f failingAddressCodec) StringToBytes(string) ([]byte, error) {

View File

@ -6,23 +6,45 @@ import (
"github.com/cosmos/gogoproto/jsonpb"
"github.com/cosmos/gogoproto/proto"
testdata "github.com/cosmos/gogoproto/types/any/test"
"github.com/stretchr/testify/require"
"github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/testutil/testdata"
test "github.com/cosmos/cosmos-sdk/testutil/testdata"
)
func TestAnyPackUnpack(t *testing.T) {
registry := testdata.NewTestInterfaceRegistry()
registry := test.NewTestInterfaceRegistry()
spot := &testdata.Dog{Name: "Spot"}
var animal testdata.Animal
// with cache
any, err := types.NewAnyWithValue(spot)
anyWithCache, err := types.NewAnyWithValue(spot)
require.NoError(t, err)
require.Equal(t, spot, any.GetCachedValue())
err = registry.UnpackAny(any, &animal)
require.Equal(t, spot, anyWithCache.GetCachedValue())
err = registry.UnpackAny(anyWithCache, &animal)
require.NoError(t, err)
require.Equal(t, spot, animal)
}
func TestAnyResetCache(t *testing.T) {
registry := test.NewTestInterfaceRegistry()
spot := &test.Dog{Name: "Spot"}
var animal test.Animal
// with cache
anyWithCache, err := types.NewAnyWithValue(spot)
require.NoError(t, err)
require.Equal(t, spot, anyWithCache.GetCachedValue())
// delete cache
anyWithCache.ResetCachedValue()
require.Nil(t, anyWithCache.GetCachedValue())
// restore cache
err = registry.UnpackAny(anyWithCache, &animal)
require.NoError(t, err)
require.Equal(t, spot, animal)
}
@ -80,7 +102,7 @@ func TestRegister(t *testing.T) {
// Duplicate registration with different concrete type on same typeURL.
require.PanicsWithError(
t,
"concrete type *testdata.Dog has already been registered under typeURL /testpb.Dog, cannot register *types_test.FakeDog under same typeURL. "+
"concrete type *test.Dog has already been registered under typeURL /test.Dog, cannot register *types_test.FakeDog under same typeURL. "+
"This usually means that there are conflicting modules registering different concrete types for a same interface implementation",
func() {
registry.RegisterImplementations((*testdata.Animal)(nil), &FakeDog{})
@ -89,20 +111,20 @@ func TestRegister(t *testing.T) {
}
func TestUnpackInterfaces(t *testing.T) {
registry := testdata.NewTestInterfaceRegistry()
registry := test.NewTestInterfaceRegistry()
spot := &testdata.Dog{Name: "Spot"}
spot := &test.Dog{Name: "Spot"}
any, err := types.NewAnyWithValue(spot)
require.NoError(t, err)
hasAny := testdata.HasAnimal{
hasAny := test.HasAnimal{
Animal: any,
X: 1,
}
bz, err := hasAny.Marshal()
require.NoError(t, err)
var hasAny2 testdata.HasAnimal
var hasAny2 test.HasAnimal
err = hasAny2.Unmarshal(bz)
require.NoError(t, err)
@ -113,28 +135,28 @@ func TestUnpackInterfaces(t *testing.T) {
}
func TestNested(t *testing.T) {
registry := testdata.NewTestInterfaceRegistry()
registry := test.NewTestInterfaceRegistry()
spot := &testdata.Dog{Name: "Spot"}
spot := &test.Dog{Name: "Spot"}
any, err := types.NewAnyWithValue(spot)
require.NoError(t, err)
ha := &testdata.HasAnimal{Animal: any}
ha := &test.HasAnimal{Animal: any}
any2, err := types.NewAnyWithValue(ha)
require.NoError(t, err)
hha := &testdata.HasHasAnimal{HasAnimal: any2}
hha := &test.HasHasAnimal{HasAnimal: any2}
any3, err := types.NewAnyWithValue(hha)
require.NoError(t, err)
hhha := testdata.HasHasHasAnimal{HasHasAnimal: any3}
hhha := test.HasHasHasAnimal{HasHasAnimal: any3}
// marshal
bz, err := hhha.Marshal()
require.NoError(t, err)
// unmarshal
var hhha2 testdata.HasHasHasAnimal
var hhha2 test.HasHasHasAnimal
err = hhha2.Unmarshal(bz)
require.NoError(t, err)
err = types.UnpackInterfaces(hhha2, registry)
@ -144,7 +166,7 @@ func TestNested(t *testing.T) {
}
func TestAny_ProtoJSON(t *testing.T) {
spot := &testdata.Dog{Name: "Spot"}
spot := &test.Dog{Name: "Spot"}
any, err := types.NewAnyWithValue(spot)
require.NoError(t, err)
@ -153,17 +175,17 @@ func TestAny_ProtoJSON(t *testing.T) {
require.NoError(t, err)
require.Equal(t, "{\"@type\":\"/testpb.Dog\",\"name\":\"Spot\"}", json)
registry := testdata.NewTestInterfaceRegistry()
registry := test.NewTestInterfaceRegistry()
jum := &jsonpb.Unmarshaler{}
var any2 types.Any
err = jum.Unmarshal(strings.NewReader(json), &any2)
require.NoError(t, err)
var animal testdata.Animal
var animal test.Animal
err = registry.UnpackAny(&any2, &animal)
require.NoError(t, err)
require.Equal(t, spot, animal)
ha := &testdata.HasAnimal{
ha := &test.HasAnimal{
Animal: any,
}
err = ha.UnpackInterfaces(types.ProtoJSONPacker{JSONPBMarshaler: jm})
@ -173,7 +195,7 @@ func TestAny_ProtoJSON(t *testing.T) {
require.Equal(t, "{\"animal\":{\"@type\":\"/testpb.Dog\",\"name\":\"Spot\"}}", json)
require.NoError(t, err)
var ha2 testdata.HasAnimal
var ha2 test.HasAnimal
err = jum.Unmarshal(strings.NewReader(json), &ha2)
require.NoError(t, err)
err = ha2.UnpackInterfaces(registry)

View File

@ -3,6 +3,7 @@ package codec_test
import (
"testing"
"github.com/cosmos/gogoproto/types/any/test"
"github.com/stretchr/testify/require"
"github.com/cosmos/cosmos-sdk/codec"
@ -11,7 +12,7 @@ import (
)
func TestMarshalYAML(t *testing.T) {
dog := &testdata.Dog{
dog := &test.Dog{
Size_: "small",
Name: "Spot",
}
@ -27,7 +28,7 @@ func TestMarshalYAML(t *testing.T) {
bz, err := codec.MarshalYAML(protoCdc, hasAnimal)
require.NoError(t, err)
require.Equal(t, `animal:
'@type': /testpb.Dog
'@type': /test.Dog
name: Spot
size: small
x: "0"
@ -37,12 +38,10 @@ x: "0"
aminoCdc := codec.NewAminoCodec(&codec.LegacyAmino{testdata.NewTestAmino()})
bz, err = codec.MarshalYAML(aminoCdc, hasAnimal)
require.NoError(t, err)
require.Equal(t, `type: testpb/HasAnimal
require.Equal(t, `type: test/HasAnimal
value:
animal:
type: testpb/Dog
value:
name: Spot
size: small
name: Spot
size: small
`, string(bz))
}

View File

@ -5,9 +5,9 @@ package keyring
import (
fmt "fmt"
types "github.com/cosmos/cosmos-sdk/codec/types"
hd "github.com/cosmos/cosmos-sdk/crypto/hd"
_ "github.com/cosmos/gogoproto/gogoproto"
any "github.com/cosmos/gogoproto/types/any"
proto "github.com/golang/protobuf/proto"
io "io"
math "math"
@ -30,7 +30,7 @@ type Record struct {
// name represents a name of Record
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// pub_key represents a public key in any format
PubKey *types.Any `protobuf:"bytes,2,opt,name=pub_key,json=pubKey,proto3" json:"pub_key,omitempty"`
PubKey *any.Any `protobuf:"bytes,2,opt,name=pub_key,json=pubKey,proto3" json:"pub_key,omitempty"`
// Record contains one of the following items
//
// Types that are valid to be assigned to Item:
@ -146,7 +146,7 @@ func (*Record) XXX_OneofWrappers() []interface{} {
// Item is a keyring item stored in a keyring backend.
// Local item
type Record_Local struct {
PrivKey *types.Any `protobuf:"bytes,1,opt,name=priv_key,json=privKey,proto3" json:"priv_key,omitempty"`
PrivKey *any.Any `protobuf:"bytes,1,opt,name=priv_key,json=privKey,proto3" json:"priv_key,omitempty"`
}
func (m *Record_Local) Reset() { *m = Record_Local{} }
@ -807,7 +807,7 @@ func (m *Record) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.PubKey == nil {
m.PubKey = &types.Any{}
m.PubKey = &any.Any{}
}
if err := m.PubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
@ -1033,7 +1033,7 @@ func (m *Record_Local) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.PrivKey == nil {
m.PrivKey = &types.Any{}
m.PrivKey = &any.Any{}
}
if err := m.PrivKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err

View File

@ -5,10 +5,10 @@ package multisig
import (
fmt "fmt"
types "github.com/cosmos/cosmos-sdk/codec/types"
_ "github.com/cosmos/cosmos-sdk/types/tx/amino"
_ "github.com/cosmos/gogoproto/gogoproto"
proto "github.com/cosmos/gogoproto/proto"
any "github.com/cosmos/gogoproto/types/any"
io "io"
math "math"
math_bits "math/bits"
@ -29,8 +29,8 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// which nests multiple public keys and a threshold,
// it uses legacy amino address rules.
type LegacyAminoPubKey struct {
Threshold uint32 `protobuf:"varint,1,opt,name=threshold,proto3" json:"threshold,omitempty"`
PubKeys []*types.Any `protobuf:"bytes,2,rep,name=public_keys,json=publicKeys,proto3" json:"public_keys,omitempty"`
Threshold uint32 `protobuf:"varint,1,opt,name=threshold,proto3" json:"threshold,omitempty"`
PubKeys []*any.Any `protobuf:"bytes,2,rep,name=public_keys,json=publicKeys,proto3" json:"public_keys,omitempty"`
}
func (m *LegacyAminoPubKey) Reset() { *m = LegacyAminoPubKey{} }
@ -250,7 +250,7 @@ func (m *LegacyAminoPubKey) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.PubKeys = append(m.PubKeys, &types.Any{})
m.PubKeys = append(m.PubKeys, &any.Any{})
if err := m.PubKeys[len(m.PubKeys)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}

View File

@ -2,7 +2,7 @@ version: v1
plugins:
- name: gocosmos
out: ..
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types,Mcosmos/orm/v1/orm.proto=cosmossdk.io/orm
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any,Mcosmos/orm/v1/orm.proto=cosmossdk.io/orm
- name: grpc-gateway
out: ..
opt: logtostderr=true,allow_colon_final_segments=true

View File

@ -14,8 +14,8 @@ deps:
- remote: buf.build
owner: googleapis
repository: googleapis
commit: 7e6f6e774e29406da95bd61cdcdbc8bc
digest: shake256:fe43dd2265ea0c07d76bd925eeba612667cf4c948d2ce53d6e367e1b4b3cb5fa69a51e6acb1a6a50d32f894f054a35e6c0406f6808a483f2752e10c866ffbf73
commit: 7a6bc1e3207144b38e9066861e1de0ff
digest: shake256:d646836485c34192401253703c4e7ce899c826fceec060bf4b2a62c4749bd9976dc960833e134a1f814725e1ffd60b1bb3cf0335a7e99ef0e8cec34b070ffb66
- remote: buf.build
owner: protocolbuffers
repository: wellknowntypes

View File

@ -7,11 +7,12 @@ import (
"path/filepath"
"slices"
"github.com/cockroachdb/pebble"
"github.com/spf13/cast"
corestore "cosmossdk.io/core/store"
"cosmossdk.io/store/v2"
storeerrors "cosmossdk.io/store/v2/errors"
"github.com/cockroachdb/pebble"
"github.com/spf13/cast"
)
var _ store.RawDB = (*PebbleDB)(nil)
@ -24,9 +25,7 @@ type PebbleDB struct {
}
func NewPebbleDB(name, dataDir string) (*PebbleDB, error) {
return NewPebbleDBWithOpts(name, dataDir, nil)
}
func NewPebbleDBWithOpts(name, dataDir string, opts store.DBOptions) (*PebbleDB, error) {

View File

@ -8,19 +8,15 @@ import (
"cosmossdk.io/store/v2"
)
var (
_ store.RawDB = (*RocksDB)(nil)
)
var _ store.RawDB = (*RocksDB)(nil)
// RocksDB implements RawDB using RocksDB as the underlying storage engine.
// It is used for only store v2 migration, since some clients use RocksDB as
// the IAVL v0/v1 backend.
type RocksDB struct {
}
type RocksDB struct{}
func NewRocksDB(name, dataDir string) (*RocksDB, error) {
panic("rocksdb must be built with -tags rocksdb")
}
func NewRocksDBWithOpts(dataDir string, opts store.DBOptions) (*RocksDB, error) {
@ -57,8 +53,7 @@ func (db *RocksDB) NewBatchWithSize(_ int) store.RawBatch {
var _ corestore.Iterator = (*rocksDBIterator)(nil)
type rocksDBIterator struct {
}
type rocksDBIterator struct{}
func (itr *rocksDBIterator) Domain() (start, end []byte) {
panic("rocksdb must be built with -tags rocksdb")
@ -92,8 +87,7 @@ func (itr *rocksDBIterator) assertIsValid() {
panic("rocksdb must be built with -tags rocksdb")
}
type rocksDBBatch struct {
}
type rocksDBBatch struct{}
func (b *rocksDBBatch) Set(key, value []byte) error {
panic("rocksdb must be built with -tags rocksdb")

View File

@ -19,9 +19,7 @@ import (
"cosmossdk.io/store/v2/storage/sqlite"
)
var (
storeKeys = []string{"store1", "store2", "store3"}
)
var storeKeys = []string{"store1", "store2", "store3"}
type MigrateStoreTestSuite struct {
suite.Suite

View File

@ -2,7 +2,7 @@ version: v1
plugins:
- name: gocosmos
out: ./gogo
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any
- name: grpc-gateway
out: ./gogo
opt: logtostderr=true,allow_colon_final_segments=true

View File

@ -3,4 +3,4 @@ plugins:
- name: gocosmos
out: ../..
opt:
- plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types
- plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any

View File

@ -43,14 +43,14 @@ func RegisterInterfaces(registry types.InterfaceRegistry) {
func NewTestAmino() *amino.Codec {
cdc := amino.NewCodec()
cdc.RegisterInterface((*Animal)(nil), nil)
cdc.RegisterConcrete(&Dog{}, "testpb/Dog", nil)
cdc.RegisterConcrete(&Cat{}, "testpb/Cat", nil)
cdc.RegisterConcrete(&Dog{}, "test/Dog", nil)
cdc.RegisterConcrete(&Cat{}, "test/Cat", nil)
cdc.RegisterInterface((*HasAnimalI)(nil), nil)
cdc.RegisterConcrete(&HasAnimal{}, "testpb/HasAnimal", nil)
cdc.RegisterConcrete(&HasAnimal{}, "test/HasAnimal", nil)
cdc.RegisterInterface((*HasHasAnimalI)(nil), nil)
cdc.RegisterConcrete(&HasHasAnimal{}, "testpb/HasHasAnimal", nil)
cdc.RegisterConcrete(&HasHasAnimal{}, "test/HasHasAnimal", nil)
return cdc
}

View File

@ -3,6 +3,7 @@ package testdata
import (
"context"
"fmt"
"github.com/cosmos/gogoproto/types/any/test"
"testing"
"github.com/cosmos/gogoproto/proto"
@ -22,7 +23,7 @@ type QueryImpl struct{}
var _ QueryServer = QueryImpl{}
func (e QueryImpl) TestAny(_ context.Context, request *TestAnyRequest) (*TestAnyResponse, error) {
animal, ok := request.AnyAnimal.GetCachedValue().(Animal)
animal, ok := request.AnyAnimal.GetCachedValue().(test.Animal)
if !ok {
return nil, fmt.Errorf("expected Animal")
}
@ -50,7 +51,7 @@ func (e QueryImpl) SayHello(_ context.Context, request *SayHelloRequest) (*SayHe
var _ types.UnpackInterfacesMessage = &TestAnyRequest{}
func (m *TestAnyRequest) UnpackInterfaces(unpacker types.AnyUnpacker) error {
var animal Animal
var animal test.Animal
return unpacker.UnpackAny(m.AnyAnimal, &animal)
}

View File

@ -6,9 +6,9 @@ package testdata
import (
context "context"
fmt "fmt"
types "github.com/cosmos/cosmos-sdk/codec/types"
grpc1 "github.com/cosmos/gogoproto/grpc"
proto "github.com/cosmos/gogoproto/proto"
any "github.com/cosmos/gogoproto/types/any"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
@ -205,7 +205,7 @@ func (m *SayHelloResponse) GetGreeting() string {
}
type TestAnyRequest struct {
AnyAnimal *types.Any `protobuf:"bytes,1,opt,name=any_animal,json=anyAnimal,proto3" json:"any_animal,omitempty"`
AnyAnimal *any.Any `protobuf:"bytes,1,opt,name=any_animal,json=anyAnimal,proto3" json:"any_animal,omitempty"`
}
func (m *TestAnyRequest) Reset() { *m = TestAnyRequest{} }
@ -241,7 +241,7 @@ func (m *TestAnyRequest) XXX_DiscardUnknown() {
var xxx_messageInfo_TestAnyRequest proto.InternalMessageInfo
func (m *TestAnyRequest) GetAnyAnimal() *types.Any {
func (m *TestAnyRequest) GetAnyAnimal() *any.Any {
if m != nil {
return m.AnyAnimal
}
@ -1154,7 +1154,7 @@ func (m *TestAnyRequest) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.AnyAnimal == nil {
m.AnyAnimal = &types.Any{}
m.AnyAnimal = &any.Any{}
}
if err := m.AnyAnimal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err

View File

@ -5,9 +5,9 @@ package testdata
import (
fmt "fmt"
types "github.com/cosmos/cosmos-sdk/codec/types"
_ "github.com/cosmos/gogoproto/gogoproto"
proto "github.com/cosmos/gogoproto/proto"
any "github.com/cosmos/gogoproto/types/any"
io "io"
math "math"
math_bits "math/bits"
@ -181,8 +181,8 @@ func (m *Bird) GetColor() int32 {
}
type HasAnimal struct {
Animal *types.Any `protobuf:"bytes,1,opt,name=animal,proto3" json:"animal,omitempty"`
X int64 `protobuf:"varint,2,opt,name=x,proto3" json:"x,omitempty"`
Animal *any.Any `protobuf:"bytes,1,opt,name=animal,proto3" json:"animal,omitempty"`
X int64 `protobuf:"varint,2,opt,name=x,proto3" json:"x,omitempty"`
}
func (m *HasAnimal) Reset() { *m = HasAnimal{} }
@ -218,7 +218,7 @@ func (m *HasAnimal) XXX_DiscardUnknown() {
var xxx_messageInfo_HasAnimal proto.InternalMessageInfo
func (m *HasAnimal) GetAnimal() *types.Any {
func (m *HasAnimal) GetAnimal() *any.Any {
if m != nil {
return m.Animal
}
@ -233,7 +233,7 @@ func (m *HasAnimal) GetX() int64 {
}
type HasHasAnimal struct {
HasAnimal *types.Any `protobuf:"bytes,1,opt,name=has_animal,json=hasAnimal,proto3" json:"has_animal,omitempty"`
HasAnimal *any.Any `protobuf:"bytes,1,opt,name=has_animal,json=hasAnimal,proto3" json:"has_animal,omitempty"`
}
func (m *HasHasAnimal) Reset() { *m = HasHasAnimal{} }
@ -269,7 +269,7 @@ func (m *HasHasAnimal) XXX_DiscardUnknown() {
var xxx_messageInfo_HasHasAnimal proto.InternalMessageInfo
func (m *HasHasAnimal) GetHasAnimal() *types.Any {
func (m *HasHasAnimal) GetHasAnimal() *any.Any {
if m != nil {
return m.HasAnimal
}
@ -277,7 +277,7 @@ func (m *HasHasAnimal) GetHasAnimal() *types.Any {
}
type HasHasHasAnimal struct {
HasHasAnimal *types.Any `protobuf:"bytes,1,opt,name=has_has_animal,json=hasHasAnimal,proto3" json:"has_has_animal,omitempty"`
HasHasAnimal *any.Any `protobuf:"bytes,1,opt,name=has_has_animal,json=hasHasAnimal,proto3" json:"has_has_animal,omitempty"`
}
func (m *HasHasHasAnimal) Reset() { *m = HasHasHasAnimal{} }
@ -313,7 +313,7 @@ func (m *HasHasHasAnimal) XXX_DiscardUnknown() {
var xxx_messageInfo_HasHasHasAnimal proto.InternalMessageInfo
func (m *HasHasHasAnimal) GetHasHasAnimal() *types.Any {
func (m *HasHasHasAnimal) GetHasHasAnimal() *any.Any {
if m != nil {
return m.HasHasAnimal
}
@ -1322,7 +1322,7 @@ func (m *HasAnimal) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.Animal == nil {
m.Animal = &types.Any{}
m.Animal = &any.Any{}
}
if err := m.Animal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
@ -1427,7 +1427,7 @@ func (m *HasHasAnimal) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.HasAnimal == nil {
m.HasAnimal = &types.Any{}
m.HasAnimal = &any.Any{}
}
if err := m.HasAnimal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
@ -1513,7 +1513,7 @@ func (m *HasHasHasAnimal) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.HasHasAnimal == nil {
m.HasHasAnimal = &types.Any{}
m.HasHasAnimal = &any.Any{}
}
if err := m.HasHasAnimal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err

View File

@ -6,10 +6,10 @@ package testdata
import (
encoding_binary "encoding/binary"
fmt "fmt"
types "github.com/cosmos/cosmos-sdk/codec/types"
tx "github.com/cosmos/cosmos-sdk/types/tx"
_ "github.com/cosmos/gogoproto/gogoproto"
proto "github.com/cosmos/gogoproto/proto"
any "github.com/cosmos/gogoproto/types/any"
io "io"
math "math"
math_bits "math/bits"
@ -135,7 +135,7 @@ type Customer2 struct {
Fewer float32 `protobuf:"fixed32,4,opt,name=fewer,proto3" json:"fewer,omitempty"`
Reserved int64 `protobuf:"varint,1047,opt,name=reserved,proto3" json:"reserved,omitempty"`
City Customer2_City `protobuf:"varint,6,opt,name=city,proto3,enum=testpb.Customer2_City" json:"city,omitempty"`
Miscellaneous *types.Any `protobuf:"bytes,10,opt,name=miscellaneous,proto3" json:"miscellaneous,omitempty"`
Miscellaneous *any.Any `protobuf:"bytes,10,opt,name=miscellaneous,proto3" json:"miscellaneous,omitempty"`
}
func (m *Customer2) Reset() { *m = Customer2{} }
@ -213,7 +213,7 @@ func (m *Customer2) GetCity() Customer2_City {
return Customer2_Laos
}
func (m *Customer2) GetMiscellaneous() *types.Any {
func (m *Customer2) GetMiscellaneous() *any.Any {
if m != nil {
return m.Miscellaneous
}
@ -853,7 +853,7 @@ type TestVersion1 struct {
// *TestVersion1_E
// *TestVersion1_F
Sum isTestVersion1_Sum `protobuf_oneof:"sum"`
G *types.Any `protobuf:"bytes,8,opt,name=g,proto3" json:"g,omitempty"`
G *any.Any `protobuf:"bytes,8,opt,name=g,proto3" json:"g,omitempty"`
H []*TestVersion1 `protobuf:"bytes,9,rep,name=h,proto3" json:"h,omitempty"`
// google.protobuf.Timestamp i = 10;
// google.protobuf.Timestamp j = 11; // [(gogoproto.stdtime) = true];
@ -965,7 +965,7 @@ func (m *TestVersion1) GetF() *TestVersion1 {
return nil
}
func (m *TestVersion1) GetG() *types.Any {
func (m *TestVersion1) GetG() *any.Any {
if m != nil {
return m.G
}
@ -998,7 +998,7 @@ type TestVersion2 struct {
// *TestVersion2_E
// *TestVersion2_F
Sum isTestVersion2_Sum `protobuf_oneof:"sum"`
G *types.Any `protobuf:"bytes,8,opt,name=g,proto3" json:"g,omitempty"`
G *any.Any `protobuf:"bytes,8,opt,name=g,proto3" json:"g,omitempty"`
H []*TestVersion1 `protobuf:"bytes,9,rep,name=h,proto3" json:"h,omitempty"`
// google.protobuf.Timestamp i = 10;
// google.protobuf.Timestamp j = 11; // [(gogoproto.stdtime) = true];
@ -1111,7 +1111,7 @@ func (m *TestVersion2) GetF() *TestVersion2 {
return nil
}
func (m *TestVersion2) GetG() *types.Any {
func (m *TestVersion2) GetG() *any.Any {
if m != nil {
return m.G
}
@ -1151,7 +1151,7 @@ type TestVersion3 struct {
// *TestVersion3_E
// *TestVersion3_F
Sum isTestVersion3_Sum `protobuf_oneof:"sum"`
G *types.Any `protobuf:"bytes,8,opt,name=g,proto3" json:"g,omitempty"`
G *any.Any `protobuf:"bytes,8,opt,name=g,proto3" json:"g,omitempty"`
H []*TestVersion1 `protobuf:"bytes,9,rep,name=h,proto3" json:"h,omitempty"`
// google.protobuf.Timestamp i = 10;
// google.protobuf.Timestamp j = 11; // [(gogoproto.stdtime) = true];
@ -1264,7 +1264,7 @@ func (m *TestVersion3) GetF() *TestVersion3 {
return nil
}
func (m *TestVersion3) GetG() *types.Any {
func (m *TestVersion3) GetG() *any.Any {
if m != nil {
return m.G
}
@ -1303,7 +1303,7 @@ type TestVersion3LoneOneOfValue struct {
//
// *TestVersion3LoneOneOfValue_E
Sum isTestVersion3LoneOneOfValue_Sum `protobuf_oneof:"sum"`
G *types.Any `protobuf:"bytes,8,opt,name=g,proto3" json:"g,omitempty"`
G *any.Any `protobuf:"bytes,8,opt,name=g,proto3" json:"g,omitempty"`
H []*TestVersion1 `protobuf:"bytes,9,rep,name=h,proto3" json:"h,omitempty"`
// google.protobuf.Timestamp i = 10;
// google.protobuf.Timestamp j = 11; // [(gogoproto.stdtime) = true];
@ -1405,7 +1405,7 @@ func (m *TestVersion3LoneOneOfValue) GetE() int32 {
return 0
}
func (m *TestVersion3LoneOneOfValue) GetG() *types.Any {
func (m *TestVersion3LoneOneOfValue) GetG() *any.Any {
if m != nil {
return m.G
}
@ -1443,7 +1443,7 @@ type TestVersion3LoneNesting struct {
//
// *TestVersion3LoneNesting_F
Sum isTestVersion3LoneNesting_Sum `protobuf_oneof:"sum"`
G *types.Any `protobuf:"bytes,8,opt,name=g,proto3" json:"g,omitempty"`
G *any.Any `protobuf:"bytes,8,opt,name=g,proto3" json:"g,omitempty"`
H []*TestVersion1 `protobuf:"bytes,9,rep,name=h,proto3" json:"h,omitempty"`
// google.protobuf.Timestamp i = 10;
// google.protobuf.Timestamp j = 11; // [(gogoproto.stdtime) = true];
@ -1547,7 +1547,7 @@ func (m *TestVersion3LoneNesting) GetF() *TestVersion3LoneNesting {
return nil
}
func (m *TestVersion3LoneNesting) GetG() *types.Any {
func (m *TestVersion3LoneNesting) GetG() *any.Any {
if m != nil {
return m.G
}
@ -1831,7 +1831,7 @@ type TestVersion4LoneNesting struct {
//
// *TestVersion4LoneNesting_F
Sum isTestVersion4LoneNesting_Sum `protobuf_oneof:"sum"`
G *types.Any `protobuf:"bytes,8,opt,name=g,proto3" json:"g,omitempty"`
G *any.Any `protobuf:"bytes,8,opt,name=g,proto3" json:"g,omitempty"`
H []*TestVersion1 `protobuf:"bytes,9,rep,name=h,proto3" json:"h,omitempty"`
// google.protobuf.Timestamp i = 10;
// google.protobuf.Timestamp j = 11; // [(gogoproto.stdtime) = true];
@ -1935,7 +1935,7 @@ func (m *TestVersion4LoneNesting) GetF() *TestVersion3LoneNesting {
return nil
}
func (m *TestVersion4LoneNesting) GetG() *types.Any {
func (m *TestVersion4LoneNesting) GetG() *any.Any {
if m != nil {
return m.G
}
@ -2217,7 +2217,7 @@ type TestVersionFD1 struct {
// *TestVersionFD1_E
// *TestVersionFD1_F
Sum isTestVersionFD1_Sum `protobuf_oneof:"sum"`
G *types.Any `protobuf:"bytes,8,opt,name=g,proto3" json:"g,omitempty"`
G *any.Any `protobuf:"bytes,8,opt,name=g,proto3" json:"g,omitempty"`
H []*TestVersion1 `protobuf:"bytes,9,rep,name=h,proto3" json:"h,omitempty"`
}
@ -2305,7 +2305,7 @@ func (m *TestVersionFD1) GetF() *TestVersion1 {
return nil
}
func (m *TestVersionFD1) GetG() *types.Any {
func (m *TestVersionFD1) GetG() *any.Any {
if m != nil {
return m.G
}
@ -2446,9 +2446,9 @@ func (*TestVersionFD1WithExtraAny) XXX_OneofWrappers() []interface{} {
}
type AnyWithExtra struct {
*types.Any `protobuf:"bytes,1,opt,name=a,proto3,embedded=a" json:"a,omitempty"`
B int64 `protobuf:"varint,3,opt,name=b,proto3" json:"b,omitempty"`
C int64 `protobuf:"varint,4,opt,name=c,proto3" json:"c,omitempty"`
*any.Any `protobuf:"bytes,1,opt,name=a,proto3,embedded=a" json:"a,omitempty"`
B int64 `protobuf:"varint,3,opt,name=b,proto3" json:"b,omitempty"`
C int64 `protobuf:"varint,4,opt,name=c,proto3" json:"c,omitempty"`
}
func (m *AnyWithExtra) Reset() { *m = AnyWithExtra{} }
@ -2575,13 +2575,13 @@ func (m *TestUpdatedTxRaw) GetNewField_1024() []byte {
}
type TestUpdatedTxBody struct {
Messages []*types.Any `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"`
Memo string `protobuf:"bytes,2,opt,name=memo,proto3" json:"memo,omitempty"`
TimeoutHeight int64 `protobuf:"varint,3,opt,name=timeout_height,json=timeoutHeight,proto3" json:"timeout_height,omitempty"`
SomeNewField uint64 `protobuf:"varint,5,opt,name=some_new_field,json=someNewField,proto3" json:"some_new_field,omitempty"`
SomeNewFieldNonCriticalField string `protobuf:"bytes,1050,opt,name=some_new_field_non_critical_field,json=someNewFieldNonCriticalField,proto3" json:"some_new_field_non_critical_field,omitempty"`
ExtensionOptions []*types.Any `protobuf:"bytes,1023,rep,name=extension_options,json=extensionOptions,proto3" json:"extension_options,omitempty"`
NonCriticalExtensionOptions []*types.Any `protobuf:"bytes,2047,rep,name=non_critical_extension_options,json=nonCriticalExtensionOptions,proto3" json:"non_critical_extension_options,omitempty"`
Messages []*any.Any `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"`
Memo string `protobuf:"bytes,2,opt,name=memo,proto3" json:"memo,omitempty"`
TimeoutHeight int64 `protobuf:"varint,3,opt,name=timeout_height,json=timeoutHeight,proto3" json:"timeout_height,omitempty"`
SomeNewField uint64 `protobuf:"varint,5,opt,name=some_new_field,json=someNewField,proto3" json:"some_new_field,omitempty"`
SomeNewFieldNonCriticalField string `protobuf:"bytes,1050,opt,name=some_new_field_non_critical_field,json=someNewFieldNonCriticalField,proto3" json:"some_new_field_non_critical_field,omitempty"`
ExtensionOptions []*any.Any `protobuf:"bytes,1023,rep,name=extension_options,json=extensionOptions,proto3" json:"extension_options,omitempty"`
NonCriticalExtensionOptions []*any.Any `protobuf:"bytes,2047,rep,name=non_critical_extension_options,json=nonCriticalExtensionOptions,proto3" json:"non_critical_extension_options,omitempty"`
}
func (m *TestUpdatedTxBody) Reset() { *m = TestUpdatedTxBody{} }
@ -2617,7 +2617,7 @@ func (m *TestUpdatedTxBody) XXX_DiscardUnknown() {
var xxx_messageInfo_TestUpdatedTxBody proto.InternalMessageInfo
func (m *TestUpdatedTxBody) GetMessages() []*types.Any {
func (m *TestUpdatedTxBody) GetMessages() []*any.Any {
if m != nil {
return m.Messages
}
@ -2652,14 +2652,14 @@ func (m *TestUpdatedTxBody) GetSomeNewFieldNonCriticalField() string {
return ""
}
func (m *TestUpdatedTxBody) GetExtensionOptions() []*types.Any {
func (m *TestUpdatedTxBody) GetExtensionOptions() []*any.Any {
if m != nil {
return m.ExtensionOptions
}
return nil
}
func (m *TestUpdatedTxBody) GetNonCriticalExtensionOptions() []*types.Any {
func (m *TestUpdatedTxBody) GetNonCriticalExtensionOptions() []*any.Any {
if m != nil {
return m.NonCriticalExtensionOptions
}
@ -6806,7 +6806,7 @@ func (m *Customer2) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.Miscellaneous == nil {
m.Miscellaneous = &types.Any{}
m.Miscellaneous = &any.Any{}
}
if err := m.Miscellaneous.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
@ -8519,7 +8519,7 @@ func (m *TestVersion1) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.G == nil {
m.G = &types.Any{}
m.G = &any.Any{}
}
if err := m.G.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
@ -8889,7 +8889,7 @@ func (m *TestVersion2) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.G == nil {
m.G = &types.Any{}
m.G = &any.Any{}
}
if err := m.G.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
@ -9278,7 +9278,7 @@ func (m *TestVersion3) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.G == nil {
m.G = &types.Any{}
m.G = &any.Any{}
}
if err := m.G.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
@ -9645,7 +9645,7 @@ func (m *TestVersion3LoneOneOfValue) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.G == nil {
m.G = &types.Any{}
m.G = &any.Any{}
}
if err := m.G.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
@ -10027,7 +10027,7 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.G == nil {
m.G = &types.Any{}
m.G = &any.Any{}
}
if err := m.G.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
@ -10996,7 +10996,7 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.G == nil {
m.G = &types.Any{}
m.G = &any.Any{}
}
if err := m.G.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
@ -11855,7 +11855,7 @@ func (m *TestVersionFD1) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.G == nil {
m.G = &types.Any{}
m.G = &any.Any{}
}
if err := m.G.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
@ -12205,7 +12205,7 @@ func (m *AnyWithExtra) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.Any == nil {
m.Any = &types.Any{}
m.Any = &any.Any{}
}
if err := m.Any.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
@ -12546,7 +12546,7 @@ func (m *TestUpdatedTxBody) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Messages = append(m.Messages, &types.Any{})
m.Messages = append(m.Messages, &any.Any{})
if err := m.Messages[len(m.Messages)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
@ -12650,7 +12650,7 @@ func (m *TestUpdatedTxBody) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.ExtensionOptions = append(m.ExtensionOptions, &types.Any{})
m.ExtensionOptions = append(m.ExtensionOptions, &any.Any{})
if err := m.ExtensionOptions[len(m.ExtensionOptions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
@ -12716,7 +12716,7 @@ func (m *TestUpdatedTxBody) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.NonCriticalExtensionOptions = append(m.NonCriticalExtensionOptions, &types.Any{})
m.NonCriticalExtensionOptions = append(m.NonCriticalExtensionOptions, &any.Any{})
if err := m.NonCriticalExtensionOptions[len(m.NonCriticalExtensionOptions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}

View File

@ -5,11 +5,11 @@ package types
import (
fmt "fmt"
types1 "github.com/cometbft/cometbft/abci/types"
types2 "github.com/cometbft/cometbft/proto/tendermint/types"
types "github.com/cosmos/cosmos-sdk/codec/types"
types "github.com/cometbft/cometbft/abci/types"
types1 "github.com/cometbft/cometbft/proto/tendermint/types"
_ "github.com/cosmos/gogoproto/gogoproto"
proto "github.com/cosmos/gogoproto/proto"
any "github.com/cosmos/gogoproto/types/any"
io "io"
math "math"
math_bits "math/bits"
@ -53,7 +53,7 @@ type TxResponse struct {
// Amount of gas consumed by transaction.
GasUsed int64 `protobuf:"varint,10,opt,name=gas_used,json=gasUsed,proto3" json:"gas_used,omitempty"`
// The request transaction bytes.
Tx *types.Any `protobuf:"bytes,11,opt,name=tx,proto3" json:"tx,omitempty"`
Tx *any.Any `protobuf:"bytes,11,opt,name=tx,proto3" json:"tx,omitempty"`
// Time of the previous block. For heights > 1, it's the weighted median of
// the timestamps of the valid votes in the block.LastCommit. For height == 1,
// it's genesis time.
@ -64,7 +64,7 @@ type TxResponse struct {
// additional metadata, emitted only by processing the messages.
//
// Since: cosmos-sdk 0.42.11, 0.44.5, 0.45
Events []types1.Event `protobuf:"bytes,13,rep,name=events,proto3" json:"events"`
Events []types.Event `protobuf:"bytes,13,rep,name=events,proto3" json:"events"`
}
func (m *TxResponse) Reset() { *m = TxResponse{} }
@ -332,11 +332,11 @@ type Result struct {
Log string `protobuf:"bytes,2,opt,name=log,proto3" json:"log,omitempty"`
// Events contains a slice of Event objects that were emitted during message
// or handler execution.
Events []types1.Event `protobuf:"bytes,3,rep,name=events,proto3" json:"events"`
Events []types.Event `protobuf:"bytes,3,rep,name=events,proto3" json:"events"`
// msg_responses contains the Msg handler responses type packed in Anys.
//
// Since: cosmos-sdk 0.46
MsgResponses []*types.Any `protobuf:"bytes,4,rep,name=msg_responses,json=msgResponses,proto3" json:"msg_responses,omitempty"`
MsgResponses []*any.Any `protobuf:"bytes,4,rep,name=msg_responses,json=msgResponses,proto3" json:"msg_responses,omitempty"`
}
func (m *Result) Reset() { *m = Result{} }
@ -480,7 +480,7 @@ type TxMsgData struct {
// msg_responses contains the Msg handler responses packed into Anys.
//
// Since: cosmos-sdk 0.46
MsgResponses []*types.Any `protobuf:"bytes,2,rep,name=msg_responses,json=msgResponses,proto3" json:"msg_responses,omitempty"`
MsgResponses []*any.Any `protobuf:"bytes,2,rep,name=msg_responses,json=msgResponses,proto3" json:"msg_responses,omitempty"`
}
func (m *TxMsgData) Reset() { *m = TxMsgData{} }
@ -523,7 +523,7 @@ func (m *TxMsgData) GetData() []*MsgData {
return nil
}
func (m *TxMsgData) GetMsgResponses() []*types.Any {
func (m *TxMsgData) GetMsgResponses() []*any.Any {
if m != nil {
return m.MsgResponses
}
@ -633,7 +633,7 @@ type SearchBlocksResult struct {
// Max count blocks per page
Limit int64 `protobuf:"varint,5,opt,name=limit,proto3" json:"limit,omitempty"`
// List of blocks in current page
Blocks []*types2.Block `protobuf:"bytes,6,rep,name=blocks,proto3" json:"blocks,omitempty"`
Blocks []*types1.Block `protobuf:"bytes,6,rep,name=blocks,proto3" json:"blocks,omitempty"`
}
func (m *SearchBlocksResult) Reset() { *m = SearchBlocksResult{} }
@ -703,7 +703,7 @@ func (m *SearchBlocksResult) GetLimit() int64 {
return 0
}
func (m *SearchBlocksResult) GetBlocks() []*types2.Block {
func (m *SearchBlocksResult) GetBlocks() []*types1.Block {
if m != nil {
return m.Blocks
}
@ -1751,7 +1751,7 @@ func (this *TxMsgData) String() string {
repeatedStringForData += "}"
repeatedStringForMsgResponses := "[]*Any{"
for _, f := range this.MsgResponses {
repeatedStringForMsgResponses += strings.Replace(fmt.Sprintf("%v", f), "Any", "types.Any", 1) + ","
repeatedStringForMsgResponses += strings.Replace(fmt.Sprintf("%v", f), "Any", "any.Any", 1) + ","
}
repeatedStringForMsgResponses += "}"
s := strings.Join([]string{`&TxMsgData{`,
@ -1787,7 +1787,7 @@ func (this *SearchBlocksResult) String() string {
}
repeatedStringForBlocks := "[]*Block{"
for _, f := range this.Blocks {
repeatedStringForBlocks += strings.Replace(fmt.Sprintf("%v", f), "Block", "types2.Block", 1) + ","
repeatedStringForBlocks += strings.Replace(fmt.Sprintf("%v", f), "Block", "types1.Block", 1) + ","
}
repeatedStringForBlocks += "}"
s := strings.Join([]string{`&SearchBlocksResult{`,
@ -2138,7 +2138,7 @@ func (m *TxResponse) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.Tx == nil {
m.Tx = &types.Any{}
m.Tx = &any.Any{}
}
if err := m.Tx.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
@ -2205,7 +2205,7 @@ func (m *TxResponse) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Events = append(m.Events, types1.Event{})
m.Events = append(m.Events, types.Event{})
if err := m.Events[len(m.Events)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
@ -2808,7 +2808,7 @@ func (m *Result) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Events = append(m.Events, types1.Event{})
m.Events = append(m.Events, types.Event{})
if err := m.Events[len(m.Events)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
@ -2842,7 +2842,7 @@ func (m *Result) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.MsgResponses = append(m.MsgResponses, &types.Any{})
m.MsgResponses = append(m.MsgResponses, &any.Any{})
if err := m.MsgResponses[len(m.MsgResponses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
@ -3195,7 +3195,7 @@ func (m *TxMsgData) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.MsgResponses = append(m.MsgResponses, &types.Any{})
m.MsgResponses = append(m.MsgResponses, &any.Any{})
if err := m.MsgResponses[len(m.MsgResponses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
@ -3553,7 +3553,7 @@ func (m *SearchBlocksResult) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Blocks = append(m.Blocks, &types2.Block{})
m.Blocks = append(m.Blocks, &types1.Block{})
if err := m.Blocks[len(m.Blocks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}

View File

@ -5,9 +5,9 @@ package signing
import (
fmt "fmt"
types "github.com/cosmos/cosmos-sdk/codec/types"
types1 "github.com/cosmos/cosmos-sdk/crypto/types"
types "github.com/cosmos/cosmos-sdk/crypto/types"
proto "github.com/cosmos/gogoproto/proto"
any "github.com/cosmos/gogoproto/types/any"
io "io"
math "math"
math_bits "math/bits"
@ -152,7 +152,7 @@ func (m *SignatureDescriptors) GetSignatures() []*SignatureDescriptor {
// clients.
type SignatureDescriptor struct {
// public_key is the public key of the signer
PublicKey *types.Any `protobuf:"bytes,1,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`
PublicKey *any.Any `protobuf:"bytes,1,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`
Data *SignatureDescriptor_Data `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
// sequence is the sequence of the account, which describes the
// number of committed transactions signed by a given address. It is used to prevent
@ -193,7 +193,7 @@ func (m *SignatureDescriptor) XXX_DiscardUnknown() {
var xxx_messageInfo_SignatureDescriptor proto.InternalMessageInfo
func (m *SignatureDescriptor) GetPublicKey() *types.Any {
func (m *SignatureDescriptor) GetPublicKey() *any.Any {
if m != nil {
return m.PublicKey
}
@ -361,7 +361,7 @@ func (m *SignatureDescriptor_Data_Single) GetSignature() []byte {
// Multi is the signature data for a multisig public key
type SignatureDescriptor_Data_Multi struct {
// bitarray specifies which keys within the multisig are signing
Bitarray *types1.CompactBitArray `protobuf:"bytes,1,opt,name=bitarray,proto3" json:"bitarray,omitempty"`
Bitarray *types.CompactBitArray `protobuf:"bytes,1,opt,name=bitarray,proto3" json:"bitarray,omitempty"`
// signatures is the signatures of the multi-signature
Signatures []*SignatureDescriptor_Data `protobuf:"bytes,2,rep,name=signatures,proto3" json:"signatures,omitempty"`
}
@ -399,7 +399,7 @@ func (m *SignatureDescriptor_Data_Multi) XXX_DiscardUnknown() {
var xxx_messageInfo_SignatureDescriptor_Data_Multi proto.InternalMessageInfo
func (m *SignatureDescriptor_Data_Multi) GetBitarray() *types1.CompactBitArray {
func (m *SignatureDescriptor_Data_Multi) GetBitarray() *types.CompactBitArray {
if m != nil {
return m.Bitarray
}
@ -979,7 +979,7 @@ func (m *SignatureDescriptor) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.PublicKey == nil {
m.PublicKey = &types.Any{}
m.PublicKey = &any.Any{}
}
if err := m.PublicKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
@ -1343,7 +1343,7 @@ func (m *SignatureDescriptor_Data_Multi) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.Bitarray == nil {
m.Bitarray = &types1.CompactBitArray{}
m.Bitarray = &types.CompactBitArray{}
}
if err := m.Bitarray.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err

View File

@ -6,14 +6,14 @@ package tx
import (
fmt "fmt"
_ "github.com/cosmos/cosmos-proto"
types "github.com/cosmos/cosmos-sdk/codec/types"
types1 "github.com/cosmos/cosmos-sdk/crypto/types"
types "github.com/cosmos/cosmos-sdk/crypto/types"
github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types"
types2 "github.com/cosmos/cosmos-sdk/types"
types1 "github.com/cosmos/cosmos-sdk/types"
_ "github.com/cosmos/cosmos-sdk/types/tx/amino"
signing "github.com/cosmos/cosmos-sdk/types/tx/signing"
_ "github.com/cosmos/gogoproto/gogoproto"
proto "github.com/cosmos/gogoproto/proto"
any "github.com/cosmos/gogoproto/types/any"
io "io"
math "math"
math_bits "math/bits"
@ -255,7 +255,7 @@ type SignDocDirectAux struct {
// representation in TxRaw.
BodyBytes []byte `protobuf:"bytes,1,opt,name=body_bytes,json=bodyBytes,proto3" json:"body_bytes,omitempty"`
// public_key is the public key of the signing account.
PublicKey *types.Any `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`
PublicKey *any.Any `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`
// chain_id is the identifier of the chain this transaction targets.
// It prevents signed transactions from being used on another chain by an
// attacker.
@ -308,7 +308,7 @@ func (m *SignDocDirectAux) GetBodyBytes() []byte {
return nil
}
func (m *SignDocDirectAux) GetPublicKey() *types.Any {
func (m *SignDocDirectAux) GetPublicKey() *any.Any {
if m != nil {
return m.PublicKey
}
@ -353,7 +353,7 @@ type TxBody struct {
// By convention, the first required signer (usually from the first message)
// is referred to as the primary signer and pays the fee for the whole
// transaction.
Messages []*types.Any `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"`
Messages []*any.Any `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"`
// memo is any arbitrary note/comment to be added to the transaction.
// WARNING: in clients, any publicly exposed text should not be called memo,
// but should be called `note` instead (see
@ -379,11 +379,11 @@ type TxBody struct {
// extension_options are arbitrary options that can be added by chains
// when the default options are not sufficient. If any of these are present
// and can't be handled, the transaction will be rejected
ExtensionOptions []*types.Any `protobuf:"bytes,1023,rep,name=extension_options,json=extensionOptions,proto3" json:"extension_options,omitempty"`
ExtensionOptions []*any.Any `protobuf:"bytes,1023,rep,name=extension_options,json=extensionOptions,proto3" json:"extension_options,omitempty"`
// extension_options are arbitrary options that can be added by chains
// when the default options are not sufficient. If any of these are present
// and can't be handled, they will be ignored
NonCriticalExtensionOptions []*types.Any `protobuf:"bytes,2047,rep,name=non_critical_extension_options,json=nonCriticalExtensionOptions,proto3" json:"non_critical_extension_options,omitempty"`
NonCriticalExtensionOptions []*any.Any `protobuf:"bytes,2047,rep,name=non_critical_extension_options,json=nonCriticalExtensionOptions,proto3" json:"non_critical_extension_options,omitempty"`
}
func (m *TxBody) Reset() { *m = TxBody{} }
@ -419,7 +419,7 @@ func (m *TxBody) XXX_DiscardUnknown() {
var xxx_messageInfo_TxBody proto.InternalMessageInfo
func (m *TxBody) GetMessages() []*types.Any {
func (m *TxBody) GetMessages() []*any.Any {
if m != nil {
return m.Messages
}
@ -447,14 +447,14 @@ func (m *TxBody) GetUnordered() bool {
return false
}
func (m *TxBody) GetExtensionOptions() []*types.Any {
func (m *TxBody) GetExtensionOptions() []*any.Any {
if m != nil {
return m.ExtensionOptions
}
return nil
}
func (m *TxBody) GetNonCriticalExtensionOptions() []*types.Any {
func (m *TxBody) GetNonCriticalExtensionOptions() []*any.Any {
if m != nil {
return m.NonCriticalExtensionOptions
}
@ -544,7 +544,7 @@ type SignerInfo struct {
// public_key is the public key of the signer. It is optional for accounts
// that already exist in state. If unset, the verifier can use the required \
// signer address for this position and lookup the public key.
PublicKey *types.Any `protobuf:"bytes,1,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`
PublicKey *any.Any `protobuf:"bytes,1,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`
// mode_info describes the signing mode of the signer and is a nested
// structure to support nested multisig pubkey's
ModeInfo *ModeInfo `protobuf:"bytes,2,opt,name=mode_info,json=modeInfo,proto3" json:"mode_info,omitempty"`
@ -587,7 +587,7 @@ func (m *SignerInfo) XXX_DiscardUnknown() {
var xxx_messageInfo_SignerInfo proto.InternalMessageInfo
func (m *SignerInfo) GetPublicKey() *types.Any {
func (m *SignerInfo) GetPublicKey() *any.Any {
if m != nil {
return m.PublicKey
}
@ -749,7 +749,7 @@ func (m *ModeInfo_Single) GetMode() signing.SignMode {
// Multi is the mode info for a multisig public key
type ModeInfo_Multi struct {
// bitarray specifies which keys within the multisig are signing
Bitarray *types1.CompactBitArray `protobuf:"bytes,1,opt,name=bitarray,proto3" json:"bitarray,omitempty"`
Bitarray *types.CompactBitArray `protobuf:"bytes,1,opt,name=bitarray,proto3" json:"bitarray,omitempty"`
// mode_infos is the corresponding modes of the signers of the multisig
// which could include nested multisig public keys
ModeInfos []*ModeInfo `protobuf:"bytes,2,rep,name=mode_infos,json=modeInfos,proto3" json:"mode_infos,omitempty"`
@ -788,7 +788,7 @@ func (m *ModeInfo_Multi) XXX_DiscardUnknown() {
var xxx_messageInfo_ModeInfo_Multi proto.InternalMessageInfo
func (m *ModeInfo_Multi) GetBitarray() *types1.CompactBitArray {
func (m *ModeInfo_Multi) GetBitarray() *types.CompactBitArray {
if m != nil {
return m.Bitarray
}
@ -2746,7 +2746,7 @@ func (m *SignDocDirectAux) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.PublicKey == nil {
m.PublicKey = &types.Any{}
m.PublicKey = &any.Any{}
}
if err := m.PublicKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
@ -2937,7 +2937,7 @@ func (m *TxBody) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Messages = append(m.Messages, &types.Any{})
m.Messages = append(m.Messages, &any.Any{})
if err := m.Messages[len(m.Messages)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
@ -3042,7 +3042,7 @@ func (m *TxBody) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.ExtensionOptions = append(m.ExtensionOptions, &types.Any{})
m.ExtensionOptions = append(m.ExtensionOptions, &any.Any{})
if err := m.ExtensionOptions[len(m.ExtensionOptions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
@ -3076,7 +3076,7 @@ func (m *TxBody) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.NonCriticalExtensionOptions = append(m.NonCriticalExtensionOptions, &types.Any{})
m.NonCriticalExtensionOptions = append(m.NonCriticalExtensionOptions, &any.Any{})
if err := m.NonCriticalExtensionOptions[len(m.NonCriticalExtensionOptions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
@ -3317,7 +3317,7 @@ func (m *SignerInfo) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.PublicKey == nil {
m.PublicKey = &types.Any{}
m.PublicKey = &any.Any{}
}
if err := m.PublicKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
@ -3647,7 +3647,7 @@ func (m *ModeInfo_Multi) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.Bitarray == nil {
m.Bitarray = &types1.CompactBitArray{}
m.Bitarray = &types.CompactBitArray{}
}
if err := m.Bitarray.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
@ -3766,7 +3766,7 @@ func (m *Fee) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Amount = append(m.Amount, types2.Coin{})
m.Amount = append(m.Amount, types1.Coin{})
if err := m.Amount[len(m.Amount)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
@ -3933,7 +3933,7 @@ func (m *Tip) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Amount = append(m.Amount, types2.Coin{})
m.Amount = append(m.Amount, types1.Coin{})
if err := m.Amount[len(m.Amount)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}

View File

@ -6,7 +6,6 @@ package types
import (
fmt "fmt"
_ "github.com/cosmos/cosmos-proto"
types1 "github.com/cosmos/cosmos-sdk/codec/types"
github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types"
types "github.com/cosmos/cosmos-sdk/types"
_ "github.com/cosmos/cosmos-sdk/types/msgservice"
@ -14,6 +13,7 @@ import (
_ "github.com/cosmos/gogoproto/gogoproto"
proto "github.com/cosmos/gogoproto/proto"
github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types"
any "github.com/cosmos/gogoproto/types/any"
_ "google.golang.org/protobuf/types/known/timestamppb"
io "io"
math "math"
@ -360,7 +360,7 @@ var xxx_messageInfo_MsgSend proto.InternalMessageInfo
// MsgExecuteMessagesResponse defines the response for lockup execute operations
type MsgExecuteMessagesResponse struct {
Responses []*types1.Any `protobuf:"bytes,1,rep,name=responses,proto3" json:"responses,omitempty"`
Responses []*any.Any `protobuf:"bytes,1,rep,name=responses,proto3" json:"responses,omitempty"`
}
func (m *MsgExecuteMessagesResponse) Reset() { *m = MsgExecuteMessagesResponse{} }
@ -396,7 +396,7 @@ func (m *MsgExecuteMessagesResponse) XXX_DiscardUnknown() {
var xxx_messageInfo_MsgExecuteMessagesResponse proto.InternalMessageInfo
func (m *MsgExecuteMessagesResponse) GetResponses() []*types1.Any {
func (m *MsgExecuteMessagesResponse) GetResponses() []*any.Any {
if m != nil {
return m.Responses
}
@ -2102,7 +2102,7 @@ func (m *MsgExecuteMessagesResponse) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Responses = append(m.Responses, &types1.Any{})
m.Responses = append(m.Responses, &any.Any{})
if err := m.Responses[len(m.Responses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}

View File

@ -2,7 +2,7 @@ version: v1
plugins:
- name: gocosmos
out: ..
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any
- name: grpc-gateway
out: ..
opt: logtostderr=true,allow_colon_final_segments=true

View File

@ -6,9 +6,9 @@ package v1
import (
context "context"
fmt "fmt"
types "github.com/cosmos/cosmos-sdk/codec/types"
grpc1 "github.com/cosmos/gogoproto/grpc"
proto "github.com/cosmos/gogoproto/proto"
any "github.com/cosmos/gogoproto/types/any"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
@ -33,7 +33,7 @@ type AccountQueryRequest struct {
// target defines the account to be queried.
Target string `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"`
// request defines the query message being sent to the account.
Request *types.Any `protobuf:"bytes,2,opt,name=request,proto3" json:"request,omitempty"`
Request *any.Any `protobuf:"bytes,2,opt,name=request,proto3" json:"request,omitempty"`
}
func (m *AccountQueryRequest) Reset() { *m = AccountQueryRequest{} }
@ -76,7 +76,7 @@ func (m *AccountQueryRequest) GetTarget() string {
return ""
}
func (m *AccountQueryRequest) GetRequest() *types.Any {
func (m *AccountQueryRequest) GetRequest() *any.Any {
if m != nil {
return m.Request
}
@ -86,7 +86,7 @@ func (m *AccountQueryRequest) GetRequest() *types.Any {
// AccountQueryResponse is the response type for the Query/AccountQuery RPC method.
type AccountQueryResponse struct {
// response defines the query response of the account.
Response *types.Any `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"`
Response *any.Any `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"`
}
func (m *AccountQueryResponse) Reset() { *m = AccountQueryResponse{} }
@ -122,7 +122,7 @@ func (m *AccountQueryResponse) XXX_DiscardUnknown() {
var xxx_messageInfo_AccountQueryResponse proto.InternalMessageInfo
func (m *AccountQueryResponse) GetResponse() *types.Any {
func (m *AccountQueryResponse) GetResponse() *any.Any {
if m != nil {
return m.Response
}
@ -1296,7 +1296,7 @@ func (m *AccountQueryRequest) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.Request == nil {
m.Request = &types.Any{}
m.Request = &any.Any{}
}
if err := m.Request.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
@ -1382,7 +1382,7 @@ func (m *AccountQueryResponse) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.Response == nil {
m.Response = &types.Any{}
m.Response = &any.Any{}
}
if err := m.Response.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err

View File

@ -6,14 +6,14 @@ package v1
import (
context "context"
fmt "fmt"
types "github.com/cosmos/cosmos-sdk/codec/types"
github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types"
types1 "github.com/cosmos/cosmos-sdk/types"
types "github.com/cosmos/cosmos-sdk/types"
_ "github.com/cosmos/cosmos-sdk/types/msgservice"
tx "github.com/cosmos/cosmos-sdk/types/tx"
_ "github.com/cosmos/gogoproto/gogoproto"
grpc1 "github.com/cosmos/gogoproto/grpc"
proto "github.com/cosmos/gogoproto/proto"
any "github.com/cosmos/gogoproto/types/any"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
@ -40,7 +40,7 @@ type MsgInit struct {
// account_type is the type of the account to be created.
AccountType string `protobuf:"bytes,2,opt,name=account_type,json=accountType,proto3" json:"account_type,omitempty"`
// message is the message to be sent to the account.
Message *types.Any `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"`
Message *any.Any `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"`
// funds contains the coins that the account wants to
// send alongside the request.
Funds github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,4,rep,name=funds,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"funds"`
@ -93,7 +93,7 @@ func (m *MsgInit) GetAccountType() string {
return ""
}
func (m *MsgInit) GetMessage() *types.Any {
func (m *MsgInit) GetMessage() *any.Any {
if m != nil {
return m.Message
}
@ -112,7 +112,7 @@ type MsgInitResponse struct {
// account_address is the address of the newly created account.
AccountAddress string `protobuf:"bytes,1,opt,name=account_address,json=accountAddress,proto3" json:"account_address,omitempty"`
// response is the response returned by the account implementation.
Response *types.Any `protobuf:"bytes,2,opt,name=response,proto3" json:"response,omitempty"`
Response *any.Any `protobuf:"bytes,2,opt,name=response,proto3" json:"response,omitempty"`
}
func (m *MsgInitResponse) Reset() { *m = MsgInitResponse{} }
@ -155,7 +155,7 @@ func (m *MsgInitResponse) GetAccountAddress() string {
return ""
}
func (m *MsgInitResponse) GetResponse() *types.Any {
func (m *MsgInitResponse) GetResponse() *any.Any {
if m != nil {
return m.Response
}
@ -169,7 +169,7 @@ type MsgExecute struct {
// target is the address of the account to be executed.
Target string `protobuf:"bytes,2,opt,name=target,proto3" json:"target,omitempty"`
// message is the message to be sent to the account.
Message *types.Any `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"`
Message *any.Any `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"`
// funds contains the coins that the account wants to
// send alongside the request.
Funds github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,4,rep,name=funds,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"funds"`
@ -222,7 +222,7 @@ func (m *MsgExecute) GetTarget() string {
return ""
}
func (m *MsgExecute) GetMessage() *types.Any {
func (m *MsgExecute) GetMessage() *any.Any {
if m != nil {
return m.Message
}
@ -239,7 +239,7 @@ func (m *MsgExecute) GetFunds() github_com_cosmos_cosmos_sdk_types.Coins {
// MsgExecuteResponse defines the Execute response type for the Msg/Execute RPC method.
type MsgExecuteResponse struct {
// response is the response returned by the account implementation.
Response *types.Any `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"`
Response *any.Any `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"`
}
func (m *MsgExecuteResponse) Reset() { *m = MsgExecuteResponse{} }
@ -275,7 +275,7 @@ func (m *MsgExecuteResponse) XXX_DiscardUnknown() {
var xxx_messageInfo_MsgExecuteResponse proto.InternalMessageInfo
func (m *MsgExecuteResponse) GetResponse() *types.Any {
func (m *MsgExecuteResponse) GetResponse() *any.Any {
if m != nil {
return m.Response
}
@ -340,8 +340,8 @@ func (m *MsgExecuteBundle) GetTxs() []*tx.TxRaw {
// BundledTxResponse defines the response of a bundled tx.
type BundledTxResponse struct {
ExecResponses *types.Any `protobuf:"bytes,1,opt,name=exec_responses,json=execResponses,proto3" json:"exec_responses,omitempty"`
Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
ExecResponses *any.Any `protobuf:"bytes,1,opt,name=exec_responses,json=execResponses,proto3" json:"exec_responses,omitempty"`
Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
}
func (m *BundledTxResponse) Reset() { *m = BundledTxResponse{} }
@ -377,7 +377,7 @@ func (m *BundledTxResponse) XXX_DiscardUnknown() {
var xxx_messageInfo_BundledTxResponse proto.InternalMessageInfo
func (m *BundledTxResponse) GetExecResponses() *types.Any {
func (m *BundledTxResponse) GetExecResponses() *any.Any {
if m != nil {
return m.ExecResponses
}
@ -1253,7 +1253,7 @@ func (m *MsgInit) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.Message == nil {
m.Message = &types.Any{}
m.Message = &any.Any{}
}
if err := m.Message.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
@ -1288,7 +1288,7 @@ func (m *MsgInit) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Funds = append(m.Funds, types1.Coin{})
m.Funds = append(m.Funds, types.Coin{})
if err := m.Funds[len(m.Funds)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
@ -1405,7 +1405,7 @@ func (m *MsgInitResponse) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.Response == nil {
m.Response = &types.Any{}
m.Response = &any.Any{}
}
if err := m.Response.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
@ -1555,7 +1555,7 @@ func (m *MsgExecute) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.Message == nil {
m.Message = &types.Any{}
m.Message = &any.Any{}
}
if err := m.Message.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
@ -1590,7 +1590,7 @@ func (m *MsgExecute) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Funds = append(m.Funds, types1.Coin{})
m.Funds = append(m.Funds, types.Coin{})
if err := m.Funds[len(m.Funds)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
@ -1675,7 +1675,7 @@ func (m *MsgExecuteResponse) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.Response == nil {
m.Response = &types.Any{}
m.Response = &any.Any{}
}
if err := m.Response.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
@ -1877,7 +1877,7 @@ func (m *BundledTxResponse) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.ExecResponses == nil {
m.ExecResponses = &types.Any{}
m.ExecResponses = &any.Any{}
}
if err := m.ExecResponses.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err

View File

@ -2,7 +2,7 @@ version: v1
plugins:
- name: gocosmos
out: ..
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any
- name: grpc-gateway
out: ..
opt: logtostderr=true,allow_colon_final_segments=true

View File

@ -27,6 +27,7 @@ func GetSignBytesAdapter(
ctx context.Context,
handlerMap *txsigning.HandlerMap,
mode signing.SignMode,
signerData SignerData,
tx sdk.Tx,
) ([]byte, error) {

View File

@ -6,10 +6,10 @@ package types
import (
fmt "fmt"
_ "github.com/cosmos/cosmos-proto"
types "github.com/cosmos/cosmos-sdk/codec/types"
_ "github.com/cosmos/cosmos-sdk/types/tx/amino"
_ "github.com/cosmos/gogoproto/gogoproto"
proto "github.com/cosmos/gogoproto/proto"
any "github.com/cosmos/gogoproto/types/any"
io "io"
math "math"
math_bits "math/bits"
@ -30,10 +30,10 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// for basic account functionality. Any custom account type should extend this
// type for additional functionality (e.g. vesting).
type BaseAccount struct {
Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
PubKey *types.Any `protobuf:"bytes,2,opt,name=pub_key,json=pubKey,proto3" json:"public_key,omitempty"`
AccountNumber uint64 `protobuf:"varint,3,opt,name=account_number,json=accountNumber,proto3" json:"account_number,omitempty"`
Sequence uint64 `protobuf:"varint,4,opt,name=sequence,proto3" json:"sequence,omitempty"`
Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
PubKey *any.Any `protobuf:"bytes,2,opt,name=pub_key,json=pubKey,proto3" json:"public_key,omitempty"`
AccountNumber uint64 `protobuf:"varint,3,opt,name=account_number,json=accountNumber,proto3" json:"account_number,omitempty"`
Sequence uint64 `protobuf:"varint,4,opt,name=sequence,proto3" json:"sequence,omitempty"`
}
func (m *BaseAccount) Reset() { *m = BaseAccount{} }
@ -726,7 +726,7 @@ func (m *BaseAccount) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.PubKey == nil {
m.PubKey = &types.Any{}
m.PubKey = &any.Any{}
}
if err := m.PubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err

View File

@ -5,10 +5,10 @@ package types
import (
fmt "fmt"
types "github.com/cosmos/cosmos-sdk/codec/types"
_ "github.com/cosmos/cosmos-sdk/types/tx/amino"
_ "github.com/cosmos/gogoproto/gogoproto"
proto "github.com/cosmos/gogoproto/proto"
any "github.com/cosmos/gogoproto/types/any"
io "io"
math "math"
math_bits "math/bits"
@ -30,7 +30,7 @@ type GenesisState struct {
// params defines all the parameters of the module.
Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
// accounts are the accounts present at genesis.
Accounts []*types.Any `protobuf:"bytes,2,rep,name=accounts,proto3" json:"accounts,omitempty"`
Accounts []*any.Any `protobuf:"bytes,2,rep,name=accounts,proto3" json:"accounts,omitempty"`
}
func (m *GenesisState) Reset() { *m = GenesisState{} }
@ -73,7 +73,7 @@ func (m *GenesisState) GetParams() Params {
return Params{}
}
func (m *GenesisState) GetAccounts() []*types.Any {
func (m *GenesisState) GetAccounts() []*any.Any {
if m != nil {
return m.Accounts
}
@ -279,7 +279,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Accounts = append(m.Accounts, &types.Any{})
m.Accounts = append(m.Accounts, &any.Any{})
if err := m.Accounts[len(m.Accounts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}

View File

@ -7,11 +7,11 @@ import (
context "context"
fmt "fmt"
_ "github.com/cosmos/cosmos-proto"
types "github.com/cosmos/cosmos-sdk/codec/types"
query "github.com/cosmos/cosmos-sdk/types/query"
_ "github.com/cosmos/gogoproto/gogoproto"
grpc1 "github.com/cosmos/gogoproto/grpc"
proto "github.com/cosmos/gogoproto/proto"
any "github.com/cosmos/gogoproto/types/any"
_ "google.golang.org/genproto/googleapis/api/annotations"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
@ -85,7 +85,7 @@ func (m *QueryAccountsRequest) GetPagination() *query.PageRequest {
// Since: cosmos-sdk 0.43
type QueryAccountsResponse struct {
// accounts are the existing accounts
Accounts []*types.Any `protobuf:"bytes,1,rep,name=accounts,proto3" json:"accounts,omitempty"`
Accounts []*any.Any `protobuf:"bytes,1,rep,name=accounts,proto3" json:"accounts,omitempty"`
// pagination defines the pagination in the response.
Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
}
@ -123,7 +123,7 @@ func (m *QueryAccountsResponse) XXX_DiscardUnknown() {
var xxx_messageInfo_QueryAccountsResponse proto.InternalMessageInfo
func (m *QueryAccountsResponse) GetAccounts() []*types.Any {
func (m *QueryAccountsResponse) GetAccounts() []*any.Any {
if m != nil {
return m.Accounts
}
@ -179,7 +179,7 @@ var xxx_messageInfo_QueryAccountRequest proto.InternalMessageInfo
// QueryAccountResponse is the response type for the Query/Account RPC method.
type QueryAccountResponse struct {
// account defines the account of the corresponding address.
Account *types.Any `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"`
Account *any.Any `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"`
}
func (m *QueryAccountResponse) Reset() { *m = QueryAccountResponse{} }
@ -215,7 +215,7 @@ func (m *QueryAccountResponse) XXX_DiscardUnknown() {
var xxx_messageInfo_QueryAccountResponse proto.InternalMessageInfo
func (m *QueryAccountResponse) GetAccount() *types.Any {
func (m *QueryAccountResponse) GetAccount() *any.Any {
if m != nil {
return m.Account
}
@ -348,7 +348,7 @@ var xxx_messageInfo_QueryModuleAccountsRequest proto.InternalMessageInfo
//
// Since: cosmos-sdk 0.46
type QueryModuleAccountsResponse struct {
Accounts []*types.Any `protobuf:"bytes,1,rep,name=accounts,proto3" json:"accounts,omitempty"`
Accounts []*any.Any `protobuf:"bytes,1,rep,name=accounts,proto3" json:"accounts,omitempty"`
}
func (m *QueryModuleAccountsResponse) Reset() { *m = QueryModuleAccountsResponse{} }
@ -384,7 +384,7 @@ func (m *QueryModuleAccountsResponse) XXX_DiscardUnknown() {
var xxx_messageInfo_QueryModuleAccountsResponse proto.InternalMessageInfo
func (m *QueryModuleAccountsResponse) GetAccounts() []*types.Any {
func (m *QueryModuleAccountsResponse) GetAccounts() []*any.Any {
if m != nil {
return m.Accounts
}
@ -438,7 +438,7 @@ func (m *QueryModuleAccountByNameRequest) GetName() string {
// QueryModuleAccountByNameResponse is the response type for the Query/ModuleAccountByName RPC method.
type QueryModuleAccountByNameResponse struct {
Account *types.Any `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"`
Account *any.Any `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"`
}
func (m *QueryModuleAccountByNameResponse) Reset() { *m = QueryModuleAccountByNameResponse{} }
@ -474,7 +474,7 @@ func (m *QueryModuleAccountByNameResponse) XXX_DiscardUnknown() {
var xxx_messageInfo_QueryModuleAccountByNameResponse proto.InternalMessageInfo
func (m *QueryModuleAccountByNameResponse) GetAccount() *types.Any {
func (m *QueryModuleAccountByNameResponse) GetAccount() *any.Any {
if m != nil {
return m.Account
}
@ -2563,7 +2563,7 @@ func (m *QueryAccountsResponse) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Accounts = append(m.Accounts, &types.Any{})
m.Accounts = append(m.Accounts, &any.Any{})
if err := m.Accounts[len(m.Accounts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
@ -2766,7 +2766,7 @@ func (m *QueryAccountResponse) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.Account == nil {
m.Account = &types.Any{}
m.Account = &any.Any{}
}
if err := m.Account.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
@ -3034,7 +3034,7 @@ func (m *QueryModuleAccountsResponse) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Accounts = append(m.Accounts, &types.Any{})
m.Accounts = append(m.Accounts, &any.Any{})
if err := m.Accounts[len(m.Accounts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
@ -3201,7 +3201,7 @@ func (m *QueryModuleAccountByNameResponse) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.Account == nil {
m.Account = &types.Any{}
m.Account = &any.Any{}
}
if err := m.Account.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err

View File

@ -6,11 +6,11 @@ package authz
import (
fmt "fmt"
_ "github.com/cosmos/cosmos-proto"
types "github.com/cosmos/cosmos-sdk/codec/types"
_ "github.com/cosmos/cosmos-sdk/types/tx/amino"
_ "github.com/cosmos/gogoproto/gogoproto"
proto "github.com/cosmos/gogoproto/proto"
github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types"
any "github.com/cosmos/gogoproto/types/any"
_ "google.golang.org/protobuf/types/known/timestamppb"
io "io"
math "math"
@ -73,7 +73,7 @@ var xxx_messageInfo_GenericAuthorization proto.InternalMessageInfo
// Grant gives permissions to execute
// the provide method with expiration time.
type Grant struct {
Authorization *types.Any `protobuf:"bytes,1,opt,name=authorization,proto3" json:"authorization,omitempty"`
Authorization *any.Any `protobuf:"bytes,1,opt,name=authorization,proto3" json:"authorization,omitempty"`
// time when the grant will expire and will be pruned. If null, then the grant
// doesn't have a time expiration (other conditions in `authorization`
// may apply to invalidate the grant)
@ -118,7 +118,7 @@ var xxx_messageInfo_Grant proto.InternalMessageInfo
type GrantAuthorization struct {
Granter string `protobuf:"bytes,1,opt,name=granter,proto3" json:"granter,omitempty"`
Grantee string `protobuf:"bytes,2,opt,name=grantee,proto3" json:"grantee,omitempty"`
Authorization *types.Any `protobuf:"bytes,3,opt,name=authorization,proto3" json:"authorization,omitempty"`
Authorization *any.Any `protobuf:"bytes,3,opt,name=authorization,proto3" json:"authorization,omitempty"`
Expiration *time.Time `protobuf:"bytes,4,opt,name=expiration,proto3,stdtime" json:"expiration,omitempty"`
}
@ -629,7 +629,7 @@ func (m *Grant) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.Authorization == nil {
m.Authorization = &types.Any{}
m.Authorization = &any.Any{}
}
if err := m.Authorization.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
@ -815,7 +815,7 @@ func (m *GrantAuthorization) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.Authorization == nil {
m.Authorization = &types.Any{}
m.Authorization = &any.Any{}
}
if err := m.Authorization.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err

View File

@ -2,7 +2,7 @@ version: v1
plugins:
- name: gocosmos
out: ..
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any
- name: grpc-gateway
out: ..
opt: logtostderr=true,allow_colon_final_segments=true

View File

@ -7,12 +7,12 @@ import (
context "context"
fmt "fmt"
_ "github.com/cosmos/cosmos-proto"
types "github.com/cosmos/cosmos-sdk/codec/types"
_ "github.com/cosmos/cosmos-sdk/types/msgservice"
_ "github.com/cosmos/cosmos-sdk/types/tx/amino"
_ "github.com/cosmos/gogoproto/gogoproto"
grpc1 "github.com/cosmos/gogoproto/grpc"
proto "github.com/cosmos/gogoproto/proto"
any "github.com/cosmos/gogoproto/types/any"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
@ -118,7 +118,7 @@ type MsgExec struct {
// Execute Msg.
// The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg))
// triple and validate it.
Msgs []*types.Any `protobuf:"bytes,2,rep,name=msgs,proto3" json:"msgs,omitempty"`
Msgs []*any.Any `protobuf:"bytes,2,rep,name=msgs,proto3" json:"msgs,omitempty"`
}
func (m *MsgExec) Reset() { *m = MsgExec{} }
@ -1300,7 +1300,7 @@ func (m *MsgExec) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Msgs = append(m.Msgs, &types.Any{})
m.Msgs = append(m.Msgs, &any.Any{})
if err := m.Msgs[len(m.Msgs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}

View File

@ -2,7 +2,7 @@ version: v1
plugins:
- name: gocosmos
out: ..
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any
- name: grpc-gateway
out: ..
opt: logtostderr=true,allow_colon_final_segments=true

View File

@ -2,7 +2,7 @@ version: v1
plugins:
- name: gocosmos
out: ..
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any
- name: grpc-gateway
out: ..
opt: logtostderr=true,allow_colon_final_segments=true

View File

@ -2,7 +2,7 @@ version: v1
plugins:
- name: gocosmos
out: ..
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any
- name: grpc-gateway
out: ..
opt: logtostderr=true,allow_colon_final_segments=true

View File

@ -2,7 +2,7 @@ version: v1
plugins:
- name: gocosmos
out: ..
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any
- name: grpc-gateway
out: ..
opt: logtostderr=true,allow_colon_final_segments=true

View File

@ -2,7 +2,7 @@ version: v1
plugins:
- name: gocosmos
out: ..
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any
- name: grpc-gateway
out: ..
opt: logtostderr=true,allow_colon_final_segments=true

View File

@ -2,7 +2,7 @@ version: v1
plugins:
- name: gocosmos
out: ..
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any
- name: grpc-gateway
out: ..
opt: logtostderr=true,allow_colon_final_segments=true

View File

@ -2,7 +2,7 @@ version: v1
plugins:
- name: gocosmos
out: ..
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any
- name: grpc-gateway
out: ..
opt: logtostderr=true,allow_colon_final_segments=true

View File

@ -5,8 +5,8 @@ package types
import (
fmt "fmt"
types "github.com/cosmos/cosmos-sdk/codec/types"
proto "github.com/cosmos/gogoproto/proto"
any "github.com/cosmos/gogoproto/types/any"
io "io"
math "math"
math_bits "math/bits"
@ -26,7 +26,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// GenesisState defines the evidence module's genesis state.
type GenesisState struct {
// evidence defines all the evidence at genesis.
Evidence []*types.Any `protobuf:"bytes,1,rep,name=evidence,proto3" json:"evidence,omitempty"`
Evidence []*any.Any `protobuf:"bytes,1,rep,name=evidence,proto3" json:"evidence,omitempty"`
}
func (m *GenesisState) Reset() { *m = GenesisState{} }
@ -62,7 +62,7 @@ func (m *GenesisState) XXX_DiscardUnknown() {
var xxx_messageInfo_GenesisState proto.InternalMessageInfo
func (m *GenesisState) GetEvidence() []*types.Any {
func (m *GenesisState) GetEvidence() []*any.Any {
if m != nil {
return m.Evidence
}
@ -220,7 +220,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Evidence = append(m.Evidence, &types.Any{})
m.Evidence = append(m.Evidence, &any.Any{})
if err := m.Evidence[len(m.Evidence)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}

View File

@ -6,10 +6,10 @@ package types
import (
context "context"
fmt "fmt"
types "github.com/cosmos/cosmos-sdk/codec/types"
query "github.com/cosmos/cosmos-sdk/types/query"
grpc1 "github.com/cosmos/gogoproto/grpc"
proto "github.com/cosmos/gogoproto/proto"
any "github.com/cosmos/gogoproto/types/any"
_ "google.golang.org/genproto/googleapis/api/annotations"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
@ -92,7 +92,7 @@ func (m *QueryEvidenceRequest) GetHash() string {
// QueryEvidenceResponse is the response type for the Query/Evidence RPC method.
type QueryEvidenceResponse struct {
// evidence returns the requested evidence.
Evidence *types.Any `protobuf:"bytes,1,opt,name=evidence,proto3" json:"evidence,omitempty"`
Evidence *any.Any `protobuf:"bytes,1,opt,name=evidence,proto3" json:"evidence,omitempty"`
}
func (m *QueryEvidenceResponse) Reset() { *m = QueryEvidenceResponse{} }
@ -128,7 +128,7 @@ func (m *QueryEvidenceResponse) XXX_DiscardUnknown() {
var xxx_messageInfo_QueryEvidenceResponse proto.InternalMessageInfo
func (m *QueryEvidenceResponse) GetEvidence() *types.Any {
func (m *QueryEvidenceResponse) GetEvidence() *any.Any {
if m != nil {
return m.Evidence
}
@ -186,7 +186,7 @@ func (m *QueryAllEvidenceRequest) GetPagination() *query.PageRequest {
// method.
type QueryAllEvidenceResponse struct {
// evidence returns all evidences.
Evidence []*types.Any `protobuf:"bytes,1,rep,name=evidence,proto3" json:"evidence,omitempty"`
Evidence []*any.Any `protobuf:"bytes,1,rep,name=evidence,proto3" json:"evidence,omitempty"`
// pagination defines the pagination in the response.
Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
}
@ -224,7 +224,7 @@ func (m *QueryAllEvidenceResponse) XXX_DiscardUnknown() {
var xxx_messageInfo_QueryAllEvidenceResponse proto.InternalMessageInfo
func (m *QueryAllEvidenceResponse) GetEvidence() []*types.Any {
func (m *QueryAllEvidenceResponse) GetEvidence() []*any.Any {
if m != nil {
return m.Evidence
}
@ -810,7 +810,7 @@ func (m *QueryEvidenceResponse) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.Evidence == nil {
m.Evidence = &types.Any{}
m.Evidence = &any.Any{}
}
if err := m.Evidence.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
@ -981,7 +981,7 @@ func (m *QueryAllEvidenceResponse) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Evidence = append(m.Evidence, &types.Any{})
m.Evidence = append(m.Evidence, &any.Any{})
if err := m.Evidence[len(m.Evidence)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}

View File

@ -8,12 +8,12 @@ import (
context "context"
fmt "fmt"
_ "github.com/cosmos/cosmos-proto"
types "github.com/cosmos/cosmos-sdk/codec/types"
_ "github.com/cosmos/cosmos-sdk/types/msgservice"
_ "github.com/cosmos/cosmos-sdk/types/tx/amino"
_ "github.com/cosmos/gogoproto/gogoproto"
grpc1 "github.com/cosmos/gogoproto/grpc"
proto "github.com/cosmos/gogoproto/proto"
any "github.com/cosmos/gogoproto/types/any"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
@ -39,7 +39,7 @@ type MsgSubmitEvidence struct {
// submitter is the signer account address of evidence.
Submitter string `protobuf:"bytes,1,opt,name=submitter,proto3" json:"submitter,omitempty"`
// evidence defines the evidence of misbehavior.
Evidence *types.Any `protobuf:"bytes,2,opt,name=evidence,proto3" json:"evidence,omitempty"`
Evidence *any.Any `protobuf:"bytes,2,opt,name=evidence,proto3" json:"evidence,omitempty"`
}
func (m *MsgSubmitEvidence) Reset() { *m = MsgSubmitEvidence{} }
@ -475,7 +475,7 @@ func (m *MsgSubmitEvidence) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.Evidence == nil {
m.Evidence = &types.Any{}
m.Evidence = &any.Any{}
}
if err := m.Evidence.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err

View File

@ -6,13 +6,13 @@ package feegrant
import (
fmt "fmt"
_ "github.com/cosmos/cosmos-proto"
types1 "github.com/cosmos/cosmos-sdk/codec/types"
github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types"
types "github.com/cosmos/cosmos-sdk/types"
_ "github.com/cosmos/cosmos-sdk/types/tx/amino"
_ "github.com/cosmos/gogoproto/gogoproto"
proto "github.com/cosmos/gogoproto/proto"
github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types"
any "github.com/cosmos/gogoproto/types/any"
_ "google.golang.org/protobuf/types/known/durationpb"
_ "google.golang.org/protobuf/types/known/timestamppb"
io "io"
@ -181,7 +181,7 @@ func (m *PeriodicAllowance) GetPeriodReset() time.Time {
// AllowedMsgAllowance creates allowance only for specified message types.
type AllowedMsgAllowance struct {
// allowance can be any of basic and periodic fee allowance.
Allowance *types1.Any `protobuf:"bytes,1,opt,name=allowance,proto3" json:"allowance,omitempty"`
Allowance *any.Any `protobuf:"bytes,1,opt,name=allowance,proto3" json:"allowance,omitempty"`
// allowed_messages are the messages for which the grantee has the access.
AllowedMessages []string `protobuf:"bytes,2,rep,name=allowed_messages,json=allowedMessages,proto3" json:"allowed_messages,omitempty"`
}
@ -226,7 +226,7 @@ type Grant struct {
// grantee is the address of the user being granted an allowance of another user's funds.
Grantee string `protobuf:"bytes,2,opt,name=grantee,proto3" json:"grantee,omitempty"`
// allowance can be any of basic, periodic, allowed fee allowance.
Allowance *types1.Any `protobuf:"bytes,3,opt,name=allowance,proto3" json:"allowance,omitempty"`
Allowance *any.Any `protobuf:"bytes,3,opt,name=allowance,proto3" json:"allowance,omitempty"`
}
func (m *Grant) Reset() { *m = Grant{} }
@ -276,7 +276,7 @@ func (m *Grant) GetGrantee() string {
return ""
}
func (m *Grant) GetAllowance() *types1.Any {
func (m *Grant) GetAllowance() *any.Any {
if m != nil {
return m.Allowance
}
@ -1056,7 +1056,7 @@ func (m *AllowedMsgAllowance) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.Allowance == nil {
m.Allowance = &types1.Any{}
m.Allowance = &any.Any{}
}
if err := m.Allowance.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
@ -1238,7 +1238,7 @@ func (m *Grant) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.Allowance == nil {
m.Allowance = &types1.Any{}
m.Allowance = &any.Any{}
}
if err := m.Allowance.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err

View File

@ -2,7 +2,7 @@ version: v1
plugins:
- name: gocosmos
out: ..
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any
- name: grpc-gateway
out: ..
opt: logtostderr=true,allow_colon_final_segments=true

View File

@ -7,11 +7,11 @@ import (
context "context"
fmt "fmt"
_ "github.com/cosmos/cosmos-proto"
types "github.com/cosmos/cosmos-sdk/codec/types"
_ "github.com/cosmos/cosmos-sdk/types/msgservice"
_ "github.com/cosmos/cosmos-sdk/types/tx/amino"
grpc1 "github.com/cosmos/gogoproto/grpc"
proto "github.com/cosmos/gogoproto/proto"
any "github.com/cosmos/gogoproto/types/any"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
@ -39,7 +39,7 @@ type MsgGrantAllowance struct {
// grantee is the address of the user being granted an allowance of another user's funds.
Grantee string `protobuf:"bytes,2,opt,name=grantee,proto3" json:"grantee,omitempty"`
// allowance can be any of basic, periodic, allowed fee allowance.
Allowance *types.Any `protobuf:"bytes,3,opt,name=allowance,proto3" json:"allowance,omitempty"`
Allowance *any.Any `protobuf:"bytes,3,opt,name=allowance,proto3" json:"allowance,omitempty"`
}
func (m *MsgGrantAllowance) Reset() { *m = MsgGrantAllowance{} }
@ -89,7 +89,7 @@ func (m *MsgGrantAllowance) GetGrantee() string {
return ""
}
func (m *MsgGrantAllowance) GetAllowance() *types.Any {
func (m *MsgGrantAllowance) GetAllowance() *any.Any {
if m != nil {
return m.Allowance
}
@ -925,7 +925,7 @@ func (m *MsgGrantAllowance) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.Allowance == nil {
m.Allowance = &types.Any{}
m.Allowance = &any.Any{}
}
if err := m.Allowance.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err

View File

@ -2,7 +2,7 @@ version: v1
plugins:
- name: gocosmos
out: ..
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any
- name: grpc-gateway
out: ..
opt: logtostderr=true,allow_colon_final_segments=true

View File

@ -2,7 +2,7 @@ version: v1
plugins:
- name: gocosmos
out: ..
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any
- name: grpc-gateway
out: ..
opt: logtostderr=true,allow_colon_final_segments=true

View File

@ -6,12 +6,12 @@ package v1
import (
fmt "fmt"
_ "github.com/cosmos/cosmos-proto"
types1 "github.com/cosmos/cosmos-sdk/codec/types"
types "github.com/cosmos/cosmos-sdk/types"
_ "github.com/cosmos/cosmos-sdk/types/tx/amino"
_ "github.com/cosmos/gogoproto/gogoproto"
proto "github.com/cosmos/gogoproto/proto"
github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types"
any "github.com/cosmos/gogoproto/types/any"
_ "google.golang.org/protobuf/types/known/durationpb"
_ "google.golang.org/protobuf/types/known/timestamppb"
io "io"
@ -307,7 +307,7 @@ type Proposal struct {
// id defines the unique id of the proposal.
Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
// messages are the arbitrary messages to be executed if the proposal passes.
Messages []*types1.Any `protobuf:"bytes,2,rep,name=messages,proto3" json:"messages,omitempty"`
Messages []*any.Any `protobuf:"bytes,2,rep,name=messages,proto3" json:"messages,omitempty"`
// status defines the proposal status.
Status ProposalStatus `protobuf:"varint,3,opt,name=status,proto3,enum=cosmos.gov.v1.ProposalStatus" json:"status,omitempty"`
// final_tally_result is the final tally result of the proposal. When
@ -395,7 +395,7 @@ func (m *Proposal) GetId() uint64 {
return 0
}
func (m *Proposal) GetMessages() []*types1.Any {
func (m *Proposal) GetMessages() []*any.Any {
if m != nil {
return m.Messages
}
@ -3025,7 +3025,7 @@ func (m *Proposal) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Messages = append(m.Messages, &types1.Any{})
m.Messages = append(m.Messages, &any.Any{})
if err := m.Messages[len(m.Messages)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}

View File

@ -7,15 +7,15 @@ import (
context "context"
fmt "fmt"
_ "github.com/cosmos/cosmos-proto"
types "github.com/cosmos/cosmos-sdk/codec/types"
github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types"
types1 "github.com/cosmos/cosmos-sdk/types"
types "github.com/cosmos/cosmos-sdk/types"
_ "github.com/cosmos/cosmos-sdk/types/msgservice"
_ "github.com/cosmos/cosmos-sdk/types/tx/amino"
_ "github.com/cosmos/gogoproto/gogoproto"
grpc1 "github.com/cosmos/gogoproto/grpc"
proto "github.com/cosmos/gogoproto/proto"
github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types"
any "github.com/cosmos/gogoproto/types/any"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
@ -42,7 +42,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// proposal Content.
type MsgSubmitProposal struct {
// messages are the arbitrary messages to be executed if proposal passes.
Messages []*types.Any `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"`
Messages []*any.Any `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"`
// initial_deposit is the deposit value that must be paid at proposal submission.
InitialDeposit github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,2,rep,name=initial_deposit,json=initialDeposit,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"initial_deposit"`
// proposer is the account address of the proposer.
@ -104,7 +104,7 @@ func (m *MsgSubmitProposal) XXX_DiscardUnknown() {
var xxx_messageInfo_MsgSubmitProposal proto.InternalMessageInfo
func (m *MsgSubmitProposal) GetMessages() []*types.Any {
func (m *MsgSubmitProposal) GetMessages() []*any.Any {
if m != nil {
return m.Messages
}
@ -211,7 +211,7 @@ func (m *MsgSubmitProposalResponse) GetProposalId() uint64 {
// This ensures backwards compatibility with v1beta1.MsgSubmitProposal.
type MsgExecLegacyContent struct {
// content is the proposal's content.
Content *types.Any `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"`
Content *any.Any `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"`
// authority must be the gov module address.
Authority string `protobuf:"bytes,2,opt,name=authority,proto3" json:"authority,omitempty"`
}
@ -249,7 +249,7 @@ func (m *MsgExecLegacyContent) XXX_DiscardUnknown() {
var xxx_messageInfo_MsgExecLegacyContent proto.InternalMessageInfo
func (m *MsgExecLegacyContent) GetContent() *types.Any {
func (m *MsgExecLegacyContent) GetContent() *any.Any {
if m != nil {
return m.Content
}
@ -527,7 +527,7 @@ type MsgDeposit struct {
// depositor defines the deposit addresses from the proposals.
Depositor string `protobuf:"bytes,2,opt,name=depositor,proto3" json:"depositor,omitempty"`
// amount to be deposited by depositor.
Amount []types1.Coin `protobuf:"bytes,3,rep,name=amount,proto3" json:"amount"`
Amount []types.Coin `protobuf:"bytes,3,rep,name=amount,proto3" json:"amount"`
}
func (m *MsgDeposit) Reset() { *m = MsgDeposit{} }
@ -577,7 +577,7 @@ func (m *MsgDeposit) GetDepositor() string {
return ""
}
func (m *MsgDeposit) GetAmount() []types1.Coin {
func (m *MsgDeposit) GetAmount() []types.Coin {
if m != nil {
return m.Amount
}
@ -1099,7 +1099,7 @@ type MsgSudoExec struct {
// authority is the address that controls the module (defaults to x/gov unless overwritten).
Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"`
// msg is the arbitrary message to be executed.
Msg *types.Any `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"`
Msg *any.Any `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"`
}
func (m *MsgSudoExec) Reset() { *m = MsgSudoExec{} }
@ -1142,7 +1142,7 @@ func (m *MsgSudoExec) GetAuthority() string {
return ""
}
func (m *MsgSudoExec) GetMsg() *types.Any {
func (m *MsgSudoExec) GetMsg() *any.Any {
if m != nil {
return m.Msg
}
@ -2976,7 +2976,7 @@ func (m *MsgSubmitProposal) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Messages = append(m.Messages, &types.Any{})
m.Messages = append(m.Messages, &any.Any{})
if err := m.Messages[len(m.Messages)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
@ -3010,7 +3010,7 @@ func (m *MsgSubmitProposal) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.InitialDeposit = append(m.InitialDeposit, types1.Coin{})
m.InitialDeposit = append(m.InitialDeposit, types.Coin{})
if err := m.InitialDeposit[len(m.InitialDeposit)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
@ -3331,7 +3331,7 @@ func (m *MsgExecLegacyContent) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.Content == nil {
m.Content = &types.Any{}
m.Content = &any.Any{}
}
if err := m.Content.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
@ -3968,7 +3968,7 @@ func (m *MsgDeposit) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Amount = append(m.Amount, types1.Coin{})
m.Amount = append(m.Amount, types.Coin{})
if err := m.Amount[len(m.Amount)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
@ -4489,7 +4489,7 @@ func (m *MsgSubmitMultipleChoiceProposal) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.InitialDeposit = append(m.InitialDeposit, types1.Coin{})
m.InitialDeposit = append(m.InitialDeposit, types.Coin{})
if err := m.InitialDeposit[len(m.InitialDeposit)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
@ -5039,7 +5039,7 @@ func (m *MsgSudoExec) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.Msg == nil {
m.Msg = &types.Any{}
m.Msg = &any.Any{}
}
if err := m.Msg.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err

View File

@ -7,13 +7,13 @@ import (
cosmossdk_io_math "cosmossdk.io/math"
fmt "fmt"
_ "github.com/cosmos/cosmos-proto"
types1 "github.com/cosmos/cosmos-sdk/codec/types"
github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types"
types "github.com/cosmos/cosmos-sdk/types"
_ "github.com/cosmos/cosmos-sdk/types/tx/amino"
_ "github.com/cosmos/gogoproto/gogoproto"
proto "github.com/cosmos/gogoproto/proto"
github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types"
any "github.com/cosmos/gogoproto/types/any"
_ "google.golang.org/protobuf/types/known/durationpb"
_ "google.golang.org/protobuf/types/known/timestamppb"
io "io"
@ -257,7 +257,7 @@ type Proposal struct {
// proposal_id defines the unique id of the proposal.
ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"`
// content is the proposal's content.
Content *types1.Any `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"`
Content *any.Any `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"`
// status defines the proposal status.
Status ProposalStatus `protobuf:"varint,3,opt,name=status,proto3,enum=cosmos.gov.v1beta1.ProposalStatus" json:"status,omitempty"`
// final_tally_result is the final tally result of the proposal. When
@ -1843,7 +1843,7 @@ func (m *Proposal) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.Content == nil {
m.Content = &types1.Any{}
m.Content = &any.Any{}
}
if err := m.Content.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err

View File

@ -7,14 +7,14 @@ import (
context "context"
fmt "fmt"
_ "github.com/cosmos/cosmos-proto"
types "github.com/cosmos/cosmos-sdk/codec/types"
github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types"
types1 "github.com/cosmos/cosmos-sdk/types"
types "github.com/cosmos/cosmos-sdk/types"
_ "github.com/cosmos/cosmos-sdk/types/msgservice"
_ "github.com/cosmos/cosmos-sdk/types/tx/amino"
_ "github.com/cosmos/gogoproto/gogoproto"
grpc1 "github.com/cosmos/gogoproto/grpc"
proto "github.com/cosmos/gogoproto/proto"
any "github.com/cosmos/gogoproto/types/any"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
@ -38,7 +38,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// proposal Content.
type MsgSubmitProposal struct {
// content is the proposal's content.
Content *types.Any `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"`
Content *any.Any `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"`
// initial_deposit is the deposit value that must be paid at proposal submission.
InitialDeposit github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,2,rep,name=initial_deposit,json=initialDeposit,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"initial_deposit"`
// proposer is the account address of the proposer.
@ -1125,7 +1125,7 @@ func (m *MsgSubmitProposal) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.Content == nil {
m.Content = &types.Any{}
m.Content = &any.Any{}
}
if err := m.Content.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
@ -1160,7 +1160,7 @@ func (m *MsgSubmitProposal) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.InitialDeposit = append(m.InitialDeposit, types1.Coin{})
m.InitialDeposit = append(m.InitialDeposit, types.Coin{})
if err := m.InitialDeposit[len(m.InitialDeposit)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
@ -1751,7 +1751,7 @@ func (m *MsgDeposit) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Amount = append(m.Amount, types1.Coin{})
m.Amount = append(m.Amount, types.Coin{})
if err := m.Amount[len(m.Amount)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}

View File

@ -2,7 +2,7 @@ version: v1
plugins:
- name: gocosmos
out: ..
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any
- name: grpc-gateway
out: ..
opt: logtostderr=true,allow_colon_final_segments=true

View File

@ -7,12 +7,12 @@ import (
context "context"
fmt "fmt"
_ "github.com/cosmos/cosmos-proto"
types "github.com/cosmos/cosmos-sdk/codec/types"
_ "github.com/cosmos/cosmos-sdk/types/msgservice"
_ "github.com/cosmos/cosmos-sdk/types/tx/amino"
_ "github.com/cosmos/gogoproto/gogoproto"
grpc1 "github.com/cosmos/gogoproto/grpc"
proto "github.com/cosmos/gogoproto/proto"
any "github.com/cosmos/gogoproto/types/any"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
@ -487,7 +487,7 @@ type MsgCreateGroupPolicy struct {
// metadata is any arbitrary metadata attached to the group policy.
Metadata string `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"`
// decision_policy specifies the group policy's decision policy.
DecisionPolicy *types.Any `protobuf:"bytes,4,opt,name=decision_policy,json=decisionPolicy,proto3" json:"decision_policy,omitempty"`
DecisionPolicy *any.Any `protobuf:"bytes,4,opt,name=decision_policy,json=decisionPolicy,proto3" json:"decision_policy,omitempty"`
}
func (m *MsgCreateGroupPolicy) Reset() { *m = MsgCreateGroupPolicy{} }
@ -684,7 +684,7 @@ type MsgCreateGroupWithPolicy struct {
// and group policy admin.
GroupPolicyAsAdmin bool `protobuf:"varint,5,opt,name=group_policy_as_admin,json=groupPolicyAsAdmin,proto3" json:"group_policy_as_admin,omitempty"`
// decision_policy specifies the group policy's decision policy.
DecisionPolicy *types.Any `protobuf:"bytes,6,opt,name=decision_policy,json=decisionPolicy,proto3" json:"decision_policy,omitempty"`
DecisionPolicy *any.Any `protobuf:"bytes,6,opt,name=decision_policy,json=decisionPolicy,proto3" json:"decision_policy,omitempty"`
}
func (m *MsgCreateGroupWithPolicy) Reset() { *m = MsgCreateGroupWithPolicy{} }
@ -782,7 +782,7 @@ type MsgUpdateGroupPolicyDecisionPolicy struct {
// group_policy_address is the account address of group policy.
GroupPolicyAddress string `protobuf:"bytes,2,opt,name=group_policy_address,json=groupPolicyAddress,proto3" json:"group_policy_address,omitempty"`
// decision_policy is the updated group policy's decision policy.
DecisionPolicy *types.Any `protobuf:"bytes,3,opt,name=decision_policy,json=decisionPolicy,proto3" json:"decision_policy,omitempty"`
DecisionPolicy *any.Any `protobuf:"bytes,3,opt,name=decision_policy,json=decisionPolicy,proto3" json:"decision_policy,omitempty"`
}
func (m *MsgUpdateGroupPolicyDecisionPolicy) Reset() { *m = MsgUpdateGroupPolicyDecisionPolicy{} }
@ -970,7 +970,7 @@ type MsgSubmitProposal struct {
// metadata is any arbitrary metadata attached to the proposal.
Metadata string `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"`
// messages is a list of `sdk.Msg`s that will be executed if the proposal passes.
Messages []*types.Any `protobuf:"bytes,4,rep,name=messages,proto3" json:"messages,omitempty"`
Messages []*any.Any `protobuf:"bytes,4,rep,name=messages,proto3" json:"messages,omitempty"`
// exec defines the mode of execution of the proposal,
// whether it should be executed immediately on creation or not.
// If so, proposers signatures are considered as Yes votes.
@ -4613,7 +4613,7 @@ func (m *MsgCreateGroupPolicy) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.DecisionPolicy == nil {
m.DecisionPolicy = &types.Any{}
m.DecisionPolicy = &any.Any{}
}
if err := m.DecisionPolicy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
@ -5127,7 +5127,7 @@ func (m *MsgCreateGroupWithPolicy) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.DecisionPolicy == nil {
m.DecisionPolicy = &types.Any{}
m.DecisionPolicy = &any.Any{}
}
if err := m.DecisionPolicy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
@ -5378,7 +5378,7 @@ func (m *MsgUpdateGroupPolicyDecisionPolicy) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.DecisionPolicy == nil {
m.DecisionPolicy = &types.Any{}
m.DecisionPolicy = &any.Any{}
}
if err := m.DecisionPolicy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
@ -5805,7 +5805,7 @@ func (m *MsgSubmitProposal) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Messages = append(m.Messages, &types.Any{})
m.Messages = append(m.Messages, &any.Any{})
if err := m.Messages[len(m.Messages)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}

View File

@ -6,11 +6,11 @@ package group
import (
fmt "fmt"
_ "github.com/cosmos/cosmos-proto"
types "github.com/cosmos/cosmos-sdk/codec/types"
_ "github.com/cosmos/cosmos-sdk/types/tx/amino"
_ "github.com/cosmos/gogoproto/gogoproto"
proto "github.com/cosmos/gogoproto/proto"
github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types"
any "github.com/cosmos/gogoproto/types/any"
_ "google.golang.org/protobuf/types/known/durationpb"
_ "google.golang.org/protobuf/types/known/timestamppb"
io "io"
@ -650,7 +650,7 @@ type GroupPolicyInfo struct {
// would create a different result on a running proposal.
Version uint64 `protobuf:"varint,5,opt,name=version,proto3" json:"version,omitempty"`
// decision_policy specifies the group policy's decision policy.
DecisionPolicy *types.Any `protobuf:"bytes,6,opt,name=decision_policy,json=decisionPolicy,proto3" json:"decision_policy,omitempty"`
DecisionPolicy *any.Any `protobuf:"bytes,6,opt,name=decision_policy,json=decisionPolicy,proto3" json:"decision_policy,omitempty"`
// created_at is a timestamp specifying when a group policy was created.
CreatedAt time.Time `protobuf:"bytes,7,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at"`
}
@ -729,7 +729,7 @@ type Proposal struct {
// executor_result is the final result of the proposal execution. Initial value is NotRun.
ExecutorResult ProposalExecutorResult `protobuf:"varint,11,opt,name=executor_result,json=executorResult,proto3,enum=cosmos.group.v1.ProposalExecutorResult" json:"executor_result,omitempty"`
// messages is a list of `sdk.Msg`s that will be executed if the proposal passes.
Messages []*types.Any `protobuf:"bytes,12,rep,name=messages,proto3" json:"messages,omitempty"`
Messages []*any.Any `protobuf:"bytes,12,rep,name=messages,proto3" json:"messages,omitempty"`
// title is the title of the proposal
//
// Since: cosmos-sdk 0.47
@ -3163,7 +3163,7 @@ func (m *GroupPolicyInfo) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.DecisionPolicy == nil {
m.DecisionPolicy = &types.Any{}
m.DecisionPolicy = &any.Any{}
}
if err := m.DecisionPolicy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
@ -3571,7 +3571,7 @@ func (m *Proposal) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Messages = append(m.Messages, &types.Any{})
m.Messages = append(m.Messages, &any.Any{})
if err := m.Messages[len(m.Messages)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}

View File

@ -2,7 +2,7 @@ version: v1
plugins:
- name: gocosmos
out: ..
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any
- name: grpc-gateway
out: ..
opt: logtostderr=true,allow_colon_final_segments=true

View File

@ -5,8 +5,8 @@ package nft
import (
fmt "fmt"
types "github.com/cosmos/cosmos-sdk/codec/types"
proto "github.com/cosmos/gogoproto/proto"
any "github.com/cosmos/gogoproto/types/any"
io "io"
math "math"
math_bits "math/bits"
@ -38,7 +38,7 @@ type Class struct {
// uri_hash is a hash of the document pointed by uri. Optional
UriHash string `protobuf:"bytes,6,opt,name=uri_hash,json=uriHash,proto3" json:"uri_hash,omitempty"`
// data is the app specific metadata of the NFT class. Optional
Data *types.Any `protobuf:"bytes,7,opt,name=data,proto3" json:"data,omitempty"`
Data *any.Any `protobuf:"bytes,7,opt,name=data,proto3" json:"data,omitempty"`
}
func (m *Class) Reset() { *m = Class{} }
@ -116,7 +116,7 @@ func (m *Class) GetUriHash() string {
return ""
}
func (m *Class) GetData() *types.Any {
func (m *Class) GetData() *any.Any {
if m != nil {
return m.Data
}
@ -134,7 +134,7 @@ type NFT struct {
// uri_hash is a hash of the document pointed by uri
UriHash string `protobuf:"bytes,4,opt,name=uri_hash,json=uriHash,proto3" json:"uri_hash,omitempty"`
// data is an app specific data of the NFT. Optional
Data *types.Any `protobuf:"bytes,10,opt,name=data,proto3" json:"data,omitempty"`
Data *any.Any `protobuf:"bytes,10,opt,name=data,proto3" json:"data,omitempty"`
}
func (m *NFT) Reset() { *m = NFT{} }
@ -198,7 +198,7 @@ func (m *NFT) GetUriHash() string {
return ""
}
func (m *NFT) GetData() *types.Any {
func (m *NFT) GetData() *any.Any {
if m != nil {
return m.Data
}
@ -710,7 +710,7 @@ func (m *Class) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.Data == nil {
m.Data = &types.Any{}
m.Data = &any.Any{}
}
if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
@ -924,7 +924,7 @@ func (m *NFT) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.Data == nil {
m.Data = &types.Any{}
m.Data = &any.Any{}
}
if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err

View File

@ -2,7 +2,7 @@ version: v1
plugins:
- name: gocosmos
out: ..
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any
- name: grpc-gateway
out: ..
opt: logtostderr=true,allow_colon_final_segments=true

View File

@ -2,7 +2,7 @@ version: v1
plugins:
- name: gocosmos
out: ..
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any
- name: grpc-gateway
out: ..
opt: logtostderr=true,allow_colon_final_segments=true

View File

@ -2,7 +2,7 @@ version: v1
plugins:
- name: gocosmos
out: ..
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any
- name: grpc-gateway
out: ..
opt: logtostderr=true,allow_colon_final_segments=true

View File

@ -2,7 +2,7 @@ version: v1
plugins:
- name: gocosmos
out: ..
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any
- name: grpc-gateway
out: ..
opt: logtostderr=true,allow_colon_final_segments=true

View File

@ -2,7 +2,7 @@ version: v1
plugins:
- name: gocosmos
out: ..
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any
- name: grpc-gateway
out: ..
opt: logtostderr=true,allow_colon_final_segments=true

View File

@ -8,17 +8,17 @@ import (
compress_gzip "compress/gzip"
cosmossdk_io_math "cosmossdk.io/math"
fmt "fmt"
types3 "github.com/cometbft/cometbft/abci/types"
types2 "github.com/cometbft/cometbft/abci/types"
types "github.com/cometbft/cometbft/proto/tendermint/types"
_ "github.com/cosmos/cosmos-proto"
types1 "github.com/cosmos/cosmos-sdk/codec/types"
types2 "github.com/cosmos/cosmos-sdk/types"
types1 "github.com/cosmos/cosmos-sdk/types"
_ "github.com/cosmos/cosmos-sdk/types/tx/amino"
_ "github.com/cosmos/gogoproto/gogoproto"
github_com_cosmos_gogoproto_proto "github.com/cosmos/gogoproto/proto"
proto "github.com/cosmos/gogoproto/proto"
github_com_cosmos_gogoproto_protoc_gen_gogo_descriptor "github.com/cosmos/gogoproto/protoc-gen-gogo/descriptor"
github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types"
any "github.com/cosmos/gogoproto/types/any"
_ "google.golang.org/protobuf/types/known/durationpb"
_ "google.golang.org/protobuf/types/known/timestamppb"
io "io"
@ -416,7 +416,7 @@ type Validator struct {
// operator_address defines the address of the validator's operator; bech encoded in JSON.
OperatorAddress string `protobuf:"bytes,1,opt,name=operator_address,json=operatorAddress,proto3" json:"operator_address,omitempty"`
// consensus_pubkey is the consensus public key of the validator, as a Protobuf Any.
ConsensusPubkey *types1.Any `protobuf:"bytes,2,opt,name=consensus_pubkey,json=consensusPubkey,proto3" json:"consensus_pubkey,omitempty"`
ConsensusPubkey *any.Any `protobuf:"bytes,2,opt,name=consensus_pubkey,json=consensusPubkey,proto3" json:"consensus_pubkey,omitempty"`
// jailed defined whether the validator has been jailed from bonded status or not.
Jailed bool `protobuf:"varint,3,opt,name=jailed,proto3" json:"jailed,omitempty"`
// status is the validator status (bonded/unbonding/unbonded).
@ -1000,7 +1000,7 @@ type Params struct {
MinCommissionRate cosmossdk_io_math.LegacyDec `protobuf:"bytes,6,opt,name=min_commission_rate,json=minCommissionRate,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"min_commission_rate" yaml:"min_commission_rate"`
// key_rotation_fee is fee to be spent when rotating validator's key
// (either consensus pubkey or operator key)
KeyRotationFee types2.Coin `protobuf:"bytes,7,opt,name=key_rotation_fee,json=keyRotationFee,proto3" json:"key_rotation_fee"`
KeyRotationFee types1.Coin `protobuf:"bytes,7,opt,name=key_rotation_fee,json=keyRotationFee,proto3" json:"key_rotation_fee"`
}
func (m *Params) Reset() { *m = Params{} }
@ -1071,18 +1071,18 @@ func (m *Params) GetBondDenom() string {
return ""
}
func (m *Params) GetKeyRotationFee() types2.Coin {
func (m *Params) GetKeyRotationFee() types1.Coin {
if m != nil {
return m.KeyRotationFee
}
return types2.Coin{}
return types1.Coin{}
}
// DelegationResponse is equivalent to Delegation except that it contains a
// balance in addition to shares which is more suitable for client responses.
type DelegationResponse struct {
Delegation Delegation `protobuf:"bytes,1,opt,name=delegation,proto3" json:"delegation"`
Balance types2.Coin `protobuf:"bytes,2,opt,name=balance,proto3" json:"balance"`
Balance types1.Coin `protobuf:"bytes,2,opt,name=balance,proto3" json:"balance"`
}
func (m *DelegationResponse) Reset() { *m = DelegationResponse{} }
@ -1125,11 +1125,11 @@ func (m *DelegationResponse) GetDelegation() Delegation {
return Delegation{}
}
func (m *DelegationResponse) GetBalance() types2.Coin {
func (m *DelegationResponse) GetBalance() types1.Coin {
if m != nil {
return m.Balance
}
return types2.Coin{}
return types1.Coin{}
}
// RedelegationEntryResponse is equivalent to a RedelegationEntry except that it
@ -1280,7 +1280,7 @@ var xxx_messageInfo_Pool proto.InternalMessageInfo
//
// Deprecated: Do not use.
type ValidatorUpdates struct {
Updates []types3.ValidatorUpdate `protobuf:"bytes,1,rep,name=updates,proto3" json:"updates"`
Updates []types2.ValidatorUpdate `protobuf:"bytes,1,rep,name=updates,proto3" json:"updates"`
}
func (m *ValidatorUpdates) Reset() { *m = ValidatorUpdates{} }
@ -1316,7 +1316,7 @@ func (m *ValidatorUpdates) XXX_DiscardUnknown() {
var xxx_messageInfo_ValidatorUpdates proto.InternalMessageInfo
func (m *ValidatorUpdates) GetUpdates() []types3.ValidatorUpdate {
func (m *ValidatorUpdates) GetUpdates() []types2.ValidatorUpdate {
if m != nil {
return m.Updates
}
@ -1328,13 +1328,13 @@ type ConsPubKeyRotationHistory struct {
// operator_address defines the address of the validator's operator; bech encoded in JSON.
OperatorAddress []byte `protobuf:"bytes,1,opt,name=operator_address,json=operatorAddress,proto3" json:"operator_address,omitempty"`
// old_cons_pubkey is the old consensus public key of the validator, as a Protobuf Any.
OldConsPubkey *types1.Any `protobuf:"bytes,2,opt,name=old_cons_pubkey,json=oldConsPubkey,proto3" json:"old_cons_pubkey,omitempty"`
OldConsPubkey *any.Any `protobuf:"bytes,2,opt,name=old_cons_pubkey,json=oldConsPubkey,proto3" json:"old_cons_pubkey,omitempty"`
// new_cons_pubkey is the new consensus public key of the validator, as a Protobuf Any.
NewConsPubkey *types1.Any `protobuf:"bytes,3,opt,name=new_cons_pubkey,json=newConsPubkey,proto3" json:"new_cons_pubkey,omitempty"`
NewConsPubkey *any.Any `protobuf:"bytes,3,opt,name=new_cons_pubkey,json=newConsPubkey,proto3" json:"new_cons_pubkey,omitempty"`
// height defines the block height at which the rotation event occurred.
Height uint64 `protobuf:"varint,4,opt,name=height,proto3" json:"height,omitempty"`
// fee holds the amount of fee deduced for the rotation.
Fee types2.Coin `protobuf:"bytes,5,opt,name=fee,proto3" json:"fee"`
Fee types1.Coin `protobuf:"bytes,5,opt,name=fee,proto3" json:"fee"`
}
func (m *ConsPubKeyRotationHistory) Reset() { *m = ConsPubKeyRotationHistory{} }
@ -5173,7 +5173,7 @@ func (m *Validator) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.ConsensusPubkey == nil {
m.ConsensusPubkey = &types1.Any{}
m.ConsensusPubkey = &any.Any{}
}
if err := m.ConsensusPubkey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
@ -7721,7 +7721,7 @@ func (m *ValidatorUpdates) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Updates = append(m.Updates, types3.ValidatorUpdate{})
m.Updates = append(m.Updates, types2.ValidatorUpdate{})
if err := m.Updates[len(m.Updates)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
@ -7840,7 +7840,7 @@ func (m *ConsPubKeyRotationHistory) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.OldConsPubkey == nil {
m.OldConsPubkey = &types1.Any{}
m.OldConsPubkey = &any.Any{}
}
if err := m.OldConsPubkey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
@ -7876,7 +7876,7 @@ func (m *ConsPubKeyRotationHistory) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.NewConsPubkey == nil {
m.NewConsPubkey = &types1.Any{}
m.NewConsPubkey = &any.Any{}
}
if err := m.NewConsPubkey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err

View File

@ -8,14 +8,14 @@ import (
cosmossdk_io_math "cosmossdk.io/math"
fmt "fmt"
_ "github.com/cosmos/cosmos-proto"
types "github.com/cosmos/cosmos-sdk/codec/types"
types1 "github.com/cosmos/cosmos-sdk/types"
types "github.com/cosmos/cosmos-sdk/types"
_ "github.com/cosmos/cosmos-sdk/types/msgservice"
_ "github.com/cosmos/cosmos-sdk/types/tx/amino"
_ "github.com/cosmos/gogoproto/gogoproto"
grpc1 "github.com/cosmos/gogoproto/grpc"
proto "github.com/cosmos/gogoproto/proto"
github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types"
any "github.com/cosmos/gogoproto/types/any"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
@ -46,10 +46,10 @@ type MsgCreateValidator struct {
// Deprecated: Use of Delegator Address in MsgCreateValidator is deprecated.
// The validator address bytes and delegator address bytes refer to the same account while creating validator (defer
// only in bech32 notation).
DelegatorAddress string `protobuf:"bytes,4,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` // Deprecated: Do not use.
ValidatorAddress string `protobuf:"bytes,5,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"`
Pubkey *types.Any `protobuf:"bytes,6,opt,name=pubkey,proto3" json:"pubkey,omitempty"`
Value types1.Coin `protobuf:"bytes,7,opt,name=value,proto3" json:"value"`
DelegatorAddress string `protobuf:"bytes,4,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` // Deprecated: Do not use.
ValidatorAddress string `protobuf:"bytes,5,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"`
Pubkey *any.Any `protobuf:"bytes,6,opt,name=pubkey,proto3" json:"pubkey,omitempty"`
Value types.Coin `protobuf:"bytes,7,opt,name=value,proto3" json:"value"`
}
func (m *MsgCreateValidator) Reset() { *m = MsgCreateValidator{} }
@ -207,9 +207,9 @@ var xxx_messageInfo_MsgEditValidatorResponse proto.InternalMessageInfo
// MsgDelegate defines a SDK message for performing a delegation of coins
// from a delegator to a validator.
type MsgDelegate struct {
DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"`
ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"`
Amount types1.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount"`
DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"`
ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"`
Amount types.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount"`
}
func (m *MsgDelegate) Reset() { *m = MsgDelegate{} }
@ -285,10 +285,10 @@ var xxx_messageInfo_MsgDelegateResponse proto.InternalMessageInfo
// MsgBeginRedelegate defines a SDK message for performing a redelegation
// of coins from a delegator and source validator to a destination validator.
type MsgBeginRedelegate struct {
DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"`
ValidatorSrcAddress string `protobuf:"bytes,2,opt,name=validator_src_address,json=validatorSrcAddress,proto3" json:"validator_src_address,omitempty"`
ValidatorDstAddress string `protobuf:"bytes,3,opt,name=validator_dst_address,json=validatorDstAddress,proto3" json:"validator_dst_address,omitempty"`
Amount types1.Coin `protobuf:"bytes,4,opt,name=amount,proto3" json:"amount"`
DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"`
ValidatorSrcAddress string `protobuf:"bytes,2,opt,name=validator_src_address,json=validatorSrcAddress,proto3" json:"validator_src_address,omitempty"`
ValidatorDstAddress string `protobuf:"bytes,3,opt,name=validator_dst_address,json=validatorDstAddress,proto3" json:"validator_dst_address,omitempty"`
Amount types.Coin `protobuf:"bytes,4,opt,name=amount,proto3" json:"amount"`
}
func (m *MsgBeginRedelegate) Reset() { *m = MsgBeginRedelegate{} }
@ -372,9 +372,9 @@ func (m *MsgBeginRedelegateResponse) GetCompletionTime() time.Time {
// MsgUndelegate defines a SDK message for performing an undelegation from a
// delegate and a validator.
type MsgUndelegate struct {
DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"`
ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"`
Amount types1.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount"`
DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"`
ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"`
Amount types.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount"`
}
func (m *MsgUndelegate) Reset() { *m = MsgUndelegate{} }
@ -416,7 +416,7 @@ type MsgUndelegateResponse struct {
// amount returns the amount of undelegated coins
//
// Since: cosmos-sdk 0.50
Amount types1.Coin `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount"`
Amount types.Coin `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount"`
}
func (m *MsgUndelegateResponse) Reset() { *m = MsgUndelegateResponse{} }
@ -459,11 +459,11 @@ func (m *MsgUndelegateResponse) GetCompletionTime() time.Time {
return time.Time{}
}
func (m *MsgUndelegateResponse) GetAmount() types1.Coin {
func (m *MsgUndelegateResponse) GetAmount() types.Coin {
if m != nil {
return m.Amount
}
return types1.Coin{}
return types.Coin{}
}
// MsgCancelUnbondingDelegation defines the SDK message for performing a cancel unbonding delegation for delegator
@ -473,7 +473,7 @@ type MsgCancelUnbondingDelegation struct {
DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"`
ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"`
// amount is always less than or equal to unbonding delegation entry balance
Amount types1.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount"`
Amount types.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount"`
// creation_height is the height which the unbonding took place.
CreationHeight int64 `protobuf:"varint,4,opt,name=creation_height,json=creationHeight,proto3" json:"creation_height,omitempty"`
}
@ -653,8 +653,8 @@ var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo
//
// Since: cosmos-sdk 0.51
type MsgRotateConsPubKey struct {
ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"`
NewPubkey *types.Any `protobuf:"bytes,2,opt,name=new_pubkey,json=newPubkey,proto3" json:"new_pubkey,omitempty"`
ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"`
NewPubkey *any.Any `protobuf:"bytes,2,opt,name=new_pubkey,json=newPubkey,proto3" json:"new_pubkey,omitempty"`
}
func (m *MsgRotateConsPubKey) Reset() { *m = MsgRotateConsPubKey{} }
@ -2330,7 +2330,7 @@ func (m *MsgCreateValidator) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.Pubkey == nil {
m.Pubkey = &types.Any{}
m.Pubkey = &any.Any{}
}
if err := m.Pubkey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
@ -3871,7 +3871,7 @@ func (m *MsgRotateConsPubKey) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.NewPubkey == nil {
m.NewPubkey = &types.Any{}
m.NewPubkey = &any.Any{}
}
if err := m.NewPubkey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err

View File

@ -2,7 +2,7 @@ version: v1
plugins:
- name: gocosmos
out: ..
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any
- name: grpc-gateway
out: ..
opt: logtostderr=true,allow_colon_final_segments=true

View File

@ -6,11 +6,11 @@ package types
import (
fmt "fmt"
_ "github.com/cosmos/cosmos-proto"
types "github.com/cosmos/cosmos-sdk/codec/types"
_ "github.com/cosmos/cosmos-sdk/types/tx/amino"
_ "github.com/cosmos/gogoproto/gogoproto"
proto "github.com/cosmos/gogoproto/proto"
github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types"
any "github.com/cosmos/gogoproto/types/any"
_ "google.golang.org/protobuf/types/known/timestamppb"
io "io"
math "math"
@ -52,7 +52,7 @@ type Plan struct {
// Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been
// moved to the IBC module in the sub module 02-client.
// If this field is not empty, an error will be thrown.
UpgradedClientState *types.Any `protobuf:"bytes,5,opt,name=upgraded_client_state,json=upgradedClientState,proto3" json:"upgraded_client_state,omitempty"` // Deprecated: Do not use.
UpgradedClientState *any.Any `protobuf:"bytes,5,opt,name=upgraded_client_state,json=upgradedClientState,proto3" json:"upgraded_client_state,omitempty"` // Deprecated: Do not use.
}
func (m *Plan) Reset() { *m = Plan{} }
@ -844,7 +844,7 @@ func (m *Plan) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.UpgradedClientState == nil {
m.UpgradedClientState = &types.Any{}
m.UpgradedClientState = &any.Any{}
}
if err := m.UpgradedClientState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err