From 2b3703426b685e7f0ac8f004dec66c471fcceaf3 Mon Sep 17 00:00:00 2001 From: xb Date: Tue, 6 Jun 2023 13:53:49 +0800 Subject: [PATCH] add ibc nft_transfer --- bank/bank.pb.go | 35 +- bank/query.pb.go | 50 +- bank/tx.pb.go | 10 +- client.go | 5 + client/rpc_client.go | 3 +- common/crypto/keys/ed25519/keys.pb.go | 10 +- common/crypto/keys/multisig/keys.pb.go | 5 +- common/crypto/keys/secp256k1/keys.pb.go | 10 +- common/crypto/types/multisig.pb.go | 10 +- feegrant/feegrant.pb.go | 20 +- feegrant/query.pb.go | 20 +- feegrant/tx.pb.go | 67 +- gov/gov.pb.go | 40 +- gov/query.pb.go | 80 +- gov/tx.pb.go | 30 +- ibc/nft_transfer/codec.go | 23 + ibc/nft_transfer/export.go | 17 + ibc/nft_transfer/keys.go | 62 + ibc/nft_transfer/query.pb.go | 2847 +++++++++++++++++ ibc/nft_transfer/trace.go | 183 ++ ibc/nft_transfer/transfer.go | 149 + ibc/nft_transfer/transfer.pb.go | 592 ++++ ibc/nft_transfer/tx.pb.go | 1339 ++++++++ ibc/nft_transfer/types.go | 36 + ibc/transfer/query.pb.go | 40 +- ibc/transfer/tx.pb.go | 15 +- .../modules/core/02-client/types/client.pb.go | 1926 +++++++++++ ibc/v5/modules/core/24-host/errors.go | 15 + ibc/v5/modules/core/24-host/validate.go | 118 + proto/cosmos/feegrant/v1beta1/tx.proto | 1 - proto/cosmos/upgrade/v1beta1/upgrade.proto | 86 + .../applications/nft_transfer/v1/query.proto | 137 + .../nft_transfer/v1/transfer.proto | 27 + .../ibc/applications/nft_transfer/v1/tx.proto | 74 + proto/ibc/core/client/v1/client.proto | 103 + staking/query.pb.go | 140 +- staking/staking.pb.go | 100 +- staking/tx.pb.go | 50 +- store/commit_info.pb.go | 15 +- store/listening.pb.go | 5 +- store/snapshot.pb.go | 15 +- store/types/snapshots/snapshot.pb.go | 10 +- types/abci.pb.go | 50 +- types/auth/auth.pb.go | 15 +- types/auth/query.pb.go | 20 +- types/coin.pb.go | 20 +- types/kv/kv.pb.go | 10 +- types/query/pagination.pb.go | 26 +- types/rpc/json_rpc_client.go | 2 +- types/tx/signing/signing.pb.go | 26 +- types/tx/tx.pb.go | 51 +- types/upgrade/upgrade.pb.go | 1324 ++++++++ 52 files changed, 9841 insertions(+), 223 deletions(-) create mode 100644 ibc/nft_transfer/codec.go create mode 100644 ibc/nft_transfer/export.go create mode 100644 ibc/nft_transfer/keys.go create mode 100644 ibc/nft_transfer/query.pb.go create mode 100644 ibc/nft_transfer/trace.go create mode 100644 ibc/nft_transfer/transfer.go create mode 100644 ibc/nft_transfer/transfer.pb.go create mode 100644 ibc/nft_transfer/tx.pb.go create mode 100644 ibc/nft_transfer/types.go create mode 100644 ibc/v5/modules/core/02-client/types/client.pb.go create mode 100644 ibc/v5/modules/core/24-host/errors.go create mode 100644 ibc/v5/modules/core/24-host/validate.go create mode 100644 proto/cosmos/upgrade/v1beta1/upgrade.proto create mode 100644 proto/ibc/applications/nft_transfer/v1/query.proto create mode 100644 proto/ibc/applications/nft_transfer/v1/transfer.proto create mode 100644 proto/ibc/applications/nft_transfer/v1/tx.proto create mode 100644 proto/ibc/core/client/v1/client.proto create mode 100644 types/upgrade/upgrade.pb.go diff --git a/bank/bank.pb.go b/bank/bank.pb.go index f2daa8e..88897c9 100644 --- a/bank/bank.pb.go +++ b/bank/bank.pb.go @@ -1054,7 +1054,10 @@ func (m *Params) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthBank + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthBank } if (iNdEx + skippy) > l { @@ -1156,7 +1159,10 @@ func (m *SendEnabled) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthBank + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthBank } if (iNdEx + skippy) > l { @@ -1272,7 +1278,10 @@ func (m *Input) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthBank + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthBank } if (iNdEx + skippy) > l { @@ -1388,7 +1397,10 @@ func (m *Output) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthBank + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthBank } if (iNdEx + skippy) > l { @@ -1472,7 +1484,10 @@ func (m *Supply) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthBank + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthBank } if (iNdEx + skippy) > l { @@ -1605,7 +1620,10 @@ func (m *DenomUnit) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthBank + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthBank } if (iNdEx + skippy) > l { @@ -1785,7 +1803,10 @@ func (m *Metadata) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthBank + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthBank } if (iNdEx + skippy) > l { diff --git a/bank/query.pb.go b/bank/query.pb.go index 76f9d67..a0a203d 100644 --- a/bank/query.pb.go +++ b/bank/query.pb.go @@ -1363,7 +1363,10 @@ func (m *QueryBalanceRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -1449,7 +1452,10 @@ func (m *QueryBalanceResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -1567,7 +1573,10 @@ func (m *QueryAllBalancesRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -1687,7 +1696,10 @@ func (m *QueryAllBalancesResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -1737,7 +1749,10 @@ func (m *QueryTotalSupplyRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -1821,7 +1836,10 @@ func (m *QueryTotalSupplyResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -1903,7 +1921,10 @@ func (m *QuerySupplyOfRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -1986,7 +2007,10 @@ func (m *QuerySupplyOfResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -2036,7 +2060,10 @@ func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -2119,7 +2146,10 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { diff --git a/bank/tx.pb.go b/bank/tx.pb.go index a911d3b..aed35e4 100644 --- a/bank/tx.pb.go +++ b/bank/tx.pb.go @@ -449,7 +449,10 @@ func (m *MsgSend) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthTx } if (iNdEx + skippy) > l { @@ -567,7 +570,10 @@ func (m *MsgMultiSend) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthTx } if (iNdEx + skippy) > l { diff --git a/client.go b/client.go index 3ff08a0..9a0c977 100644 --- a/client.go +++ b/client.go @@ -11,6 +11,7 @@ import ( cryptotypes "github.com/irisnet/core-sdk-go/common/codec/types" commoncryptocodec "github.com/irisnet/core-sdk-go/common/crypto/codec" "github.com/irisnet/core-sdk-go/gov" + "github.com/irisnet/core-sdk-go/ibc/nft_transfer" "github.com/irisnet/core-sdk-go/ibc/transfer" "github.com/irisnet/core-sdk-go/staking" "github.com/irisnet/core-sdk-go/types" @@ -26,6 +27,7 @@ type Client struct { Key keys.Client Staking staking.Client Gov gov.Client + NFTTransfer nft_transfer.Client Transfer transfer.Client FeeGrant feegrant.Client } @@ -38,6 +40,7 @@ func NewClient(cfg types.ClientConfig) Client { bankClient := bank.NewClient(baseClient, encodingConfig.Marshaler) keysClient := keys.NewKeysClient(cfg, baseClient) transferClient := transfer.NewClient(baseClient, encodingConfig.Marshaler) + nftTransferClient := nft_transfer.NewClient(baseClient, encodingConfig.Marshaler) stakingClient := staking.NewClient(baseClient, encodingConfig.Marshaler) govClient := gov.NewClient(baseClient, encodingConfig.Marshaler) feeGrantClient := feegrant.NewClient(baseClient, encodingConfig.Marshaler) @@ -51,6 +54,7 @@ func NewClient(cfg types.ClientConfig) Client { Key: keysClient, Staking: stakingClient, Gov: govClient, + NFTTransfer: nftTransferClient, Transfer: transferClient, FeeGrant: feeGrantClient, } @@ -59,6 +63,7 @@ func NewClient(cfg types.ClientConfig) Client { stakingClient, govClient, transferClient, + nftTransferClient, feeGrantClient, ) return client diff --git a/client/rpc_client.go b/client/rpc_client.go index ca9dfab..60b7439 100644 --- a/client/rpc_client.go +++ b/client/rpc_client.go @@ -3,6 +3,7 @@ package client import ( "context" "fmt" + "github.com/tendermint/tendermint/crypto/tmhash" "github.com/tendermint/tendermint/libs/log" rpc "github.com/tendermint/tendermint/rpc/client" @@ -27,7 +28,7 @@ func NewRPCClient(cfg sdktypes.ClientConfig, txDecoder sdk.TxDecoder, logger log.Logger, ) sdk.TmClient { - client, err := sdkrpc.NewJSONRpcClient( + client, err := sdkrpc.NewJSONRPCClient( cfg.RPCAddr, cfg.WSAddr, "/websocket", diff --git a/common/crypto/keys/ed25519/keys.pb.go b/common/crypto/keys/ed25519/keys.pb.go index 8a263ce..59b0ac2 100644 --- a/common/crypto/keys/ed25519/keys.pb.go +++ b/common/crypto/keys/ed25519/keys.pb.go @@ -312,7 +312,10 @@ func (m *PubKey) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthKeys + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthKeys } if (iNdEx + skippy) > l { @@ -396,7 +399,10 @@ func (m *PrivKey) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthKeys + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthKeys } if (iNdEx + skippy) > l { diff --git a/common/crypto/keys/multisig/keys.pb.go b/common/crypto/keys/multisig/keys.pb.go index cc3021e..ab8c689 100644 --- a/common/crypto/keys/multisig/keys.pb.go +++ b/common/crypto/keys/multisig/keys.pb.go @@ -259,7 +259,10 @@ func (m *LegacyAminoPubKey) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthKeys + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthKeys } if (iNdEx + skippy) > l { diff --git a/common/crypto/keys/secp256k1/keys.pb.go b/common/crypto/keys/secp256k1/keys.pb.go index 72727e0..cfaa71e 100644 --- a/common/crypto/keys/secp256k1/keys.pb.go +++ b/common/crypto/keys/secp256k1/keys.pb.go @@ -314,7 +314,10 @@ func (m *PubKey) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthKeys + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthKeys } if (iNdEx + skippy) > l { @@ -398,7 +401,10 @@ func (m *PrivKey) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthKeys + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthKeys } if (iNdEx + skippy) > l { diff --git a/common/crypto/types/multisig.pb.go b/common/crypto/types/multisig.pb.go index 6e506bb..b0cf04a 100644 --- a/common/crypto/types/multisig.pb.go +++ b/common/crypto/types/multisig.pb.go @@ -346,7 +346,10 @@ func (m *MultiSignature) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthMultisig + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthMultisig } if (iNdEx + skippy) > l { @@ -450,7 +453,10 @@ func (m *CompactBitArray) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthMultisig + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthMultisig } if (iNdEx + skippy) > l { diff --git a/feegrant/feegrant.pb.go b/feegrant/feegrant.pb.go index b61e789..cc611a9 100644 --- a/feegrant/feegrant.pb.go +++ b/feegrant/feegrant.pb.go @@ -758,7 +758,10 @@ func (m *BasicAllowance) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthFeegrant + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthFeegrant } if (iNdEx + skippy) > l { @@ -975,7 +978,10 @@ func (m *PeriodicAllowance) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthFeegrant + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthFeegrant } if (iNdEx + skippy) > l { @@ -1093,7 +1099,10 @@ func (m *AllowedMsgAllowance) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthFeegrant + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthFeegrant } if (iNdEx + skippy) > l { @@ -1243,7 +1252,10 @@ func (m *Grant) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthFeegrant + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthFeegrant } if (iNdEx + skippy) > l { diff --git a/feegrant/query.pb.go b/feegrant/query.pb.go index 6a1d2f1..622cbb0 100644 --- a/feegrant/query.pb.go +++ b/feegrant/query.pb.go @@ -747,7 +747,10 @@ func (m *QueryAllowanceRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -833,7 +836,10 @@ func (m *QueryAllowanceResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -951,7 +957,10 @@ func (m *QueryAllowancesRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -1071,7 +1080,10 @@ func (m *QueryAllowancesResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { diff --git a/feegrant/tx.pb.go b/feegrant/tx.pb.go index 8591c56..3da54ea 100644 --- a/feegrant/tx.pb.go +++ b/feegrant/tx.pb.go @@ -6,7 +6,6 @@ package feegrant import ( context "context" fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" types "github.com/irisnet/core-sdk-go/common/codec/types" @@ -234,29 +233,29 @@ func init() { func init() { proto.RegisterFile("cosmos/feegrant/v1beta1/tx.proto", fileDescriptor_dd44ad7946dad783) } var fileDescriptor_dd44ad7946dad783 = []byte{ - // 347 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x92, 0xcf, 0x4e, 0x32, 0x31, - 0x14, 0xc5, 0xe9, 0x47, 0xf2, 0x19, 0x6a, 0xd4, 0x30, 0x21, 0x71, 0x18, 0xcd, 0x84, 0xcc, 0x46, - 0xa2, 0xa1, 0x0d, 0xf0, 0x04, 0x90, 0xf8, 0x6f, 0xc1, 0x66, 0x96, 0x6e, 0xcc, 0xcc, 0x78, 0xa9, - 0x04, 0xe8, 0x25, 0xd3, 0x82, 0xf2, 0x12, 0xc6, 0x87, 0xf1, 0x21, 0x8c, 0x2b, 0x96, 0x2e, 0x0d, - 0x6c, 0x7d, 0x08, 0xc3, 0x0c, 0x05, 0x03, 0xd1, 0x68, 0xdc, 0xf5, 0xe6, 0xfe, 0xee, 0x39, 0xa7, - 0xbd, 0xa5, 0xa5, 0x08, 0x55, 0x1f, 0x15, 0x6f, 0x03, 0x88, 0x38, 0x90, 0x9a, 0x8f, 0xaa, 0x21, - 0xe8, 0xa0, 0xca, 0xf5, 0x3d, 0x1b, 0xc4, 0xa8, 0xd1, 0xda, 0x4f, 0x09, 0x66, 0x08, 0xb6, 0x20, - 0x9c, 0x82, 0x40, 0x81, 0x09, 0xc3, 0xe7, 0xa7, 0x14, 0x77, 0x8a, 0x02, 0x51, 0xf4, 0x80, 0x27, - 0x55, 0x38, 0x6c, 0xf3, 0x40, 0x8e, 0x4d, 0x2b, 0x55, 0xba, 0x4e, 0x67, 0x16, 0xb2, 0x49, 0xe1, - 0x3d, 0x10, 0x9a, 0x6f, 0x29, 0x71, 0x3e, 0x37, 0x68, 0xf4, 0x7a, 0x78, 0x17, 0xc8, 0x08, 0x2c, - 0x9b, 0x6e, 0x25, 0x96, 0x10, 0xdb, 0xa4, 0x44, 0xca, 0x39, 0xdf, 0x94, 0xab, 0x0e, 0xd8, 0xff, - 0x3e, 0x77, 0xc0, 0x3a, 0xa5, 0xb9, 0xc0, 0x08, 0xd8, 0xd9, 0x12, 0x29, 0x6f, 0xd7, 0x0a, 0x2c, - 0xcd, 0xc4, 0x4c, 0x26, 0xd6, 0x90, 0xe3, 0x66, 0xfe, 0xe5, 0xa9, 0xb2, 0x73, 0x06, 0xb0, 0xb4, - 0xbb, 0xf4, 0x57, 0x93, 0xde, 0x01, 0x2d, 0x6e, 0xe4, 0xf1, 0x41, 0x0d, 0x50, 0x2a, 0xf0, 0x2e, - 0xa8, 0xd5, 0x52, 0xc2, 0x87, 0x11, 0x76, 0xe1, 0x4f, 0x69, 0xbd, 0x43, 0xea, 0x6c, 0x2a, 0x19, - 0x9f, 0xda, 0x3b, 0xa1, 0xd9, 0x96, 0x12, 0xd6, 0x80, 0xee, 0xae, 0xbd, 0xcc, 0x31, 0xfb, 0x62, - 0x2b, 0x6c, 0x23, 0xb5, 0x53, 0xfb, 0x39, 0x6b, 0x9c, 0x2d, 0x45, 0xf7, 0xd6, 0xaf, 0x77, 0xf2, - 0x9d, 0xcc, 0x1a, 0xec, 0xd4, 0x7f, 0x01, 0x1b, 0xd3, 0x66, 0xe3, 0x79, 0xea, 0x92, 0xc9, 0xd4, - 0x25, 0x6f, 0x53, 0x97, 0x3c, 0xce, 0xdc, 0xcc, 0x64, 0xe6, 0x66, 0x5e, 0x67, 0x6e, 0xe6, 0xea, - 0x48, 0x74, 0xf4, 0xed, 0x30, 0x64, 0x11, 0xf6, 0x79, 0x27, 0xee, 0x28, 0x09, 0x9a, 0x47, 0x18, - 0x43, 0x45, 0xdd, 0x74, 0x2b, 0x02, 0x97, 0xbf, 0x37, 0xfc, 0x9f, 0xac, 0xb8, 0xfe, 0x11, 0x00, - 0x00, 0xff, 0xff, 0xa1, 0x28, 0x0c, 0x86, 0xd7, 0x02, 0x00, 0x00, + // 339 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x92, 0xcb, 0x4e, 0xf2, 0x40, + 0x14, 0xc7, 0x99, 0x8f, 0xe4, 0x33, 0x8c, 0x51, 0x43, 0x63, 0x62, 0xa9, 0xa6, 0x21, 0xdd, 0x48, + 0x34, 0xcc, 0x04, 0x78, 0x02, 0x48, 0xbc, 0x2d, 0xd8, 0x74, 0xe9, 0xc6, 0xb4, 0xf5, 0x30, 0x12, + 0x60, 0x0e, 0xe9, 0x0c, 0x28, 0x2f, 0x61, 0x7c, 0x18, 0x1f, 0xc2, 0xb8, 0x62, 0xe9, 0xd2, 0xc0, + 0xd6, 0x87, 0x30, 0xb6, 0x0c, 0x18, 0x1a, 0x8d, 0xc6, 0xe5, 0xc9, 0xf9, 0xfd, 0x2f, 0x3d, 0x1d, + 0x5a, 0x8e, 0x50, 0x0d, 0x50, 0xf1, 0x0e, 0x80, 0x88, 0x03, 0xa9, 0xf9, 0xb8, 0x16, 0x82, 0x0e, + 0x6a, 0x5c, 0xdf, 0xb1, 0x61, 0x8c, 0x1a, 0xad, 0xbd, 0x94, 0x60, 0x86, 0x60, 0x0b, 0xc2, 0x29, + 0x09, 0x44, 0xd1, 0x07, 0x9e, 0x60, 0xe1, 0xa8, 0xc3, 0x03, 0x39, 0x49, 0x35, 0x4e, 0x29, 0xd5, + 0x5c, 0x25, 0x13, 0x5f, 0x18, 0x24, 0x83, 0x77, 0x4f, 0x68, 0xb1, 0xad, 0xc4, 0xd9, 0x87, 0x55, + 0xb3, 0xdf, 0xc7, 0xdb, 0x40, 0x46, 0x60, 0xd9, 0x74, 0x23, 0x31, 0x87, 0xd8, 0x26, 0x65, 0x52, + 0x29, 0xf8, 0x66, 0x5c, 0x6d, 0xc0, 0xfe, 0xf7, 0x79, 0x03, 0xd6, 0x09, 0x2d, 0x04, 0xc6, 0xc0, + 0xce, 0x97, 0x49, 0x65, 0xb3, 0xbe, 0xcb, 0xd2, 0x4e, 0xcc, 0x74, 0x62, 0x4d, 0x39, 0x69, 0x15, + 0x9f, 0x1f, 0xab, 0x5b, 0xa7, 0x00, 0xcb, 0xb8, 0x0b, 0x7f, 0xa5, 0xf4, 0xf6, 0x69, 0x29, 0xd3, + 0xc7, 0x07, 0x35, 0x44, 0xa9, 0xc0, 0x3b, 0xa7, 0x56, 0x5b, 0x09, 0x1f, 0xc6, 0xd8, 0x83, 0x3f, + 0xb5, 0xf5, 0x0e, 0xa8, 0x93, 0x75, 0x32, 0x39, 0xf5, 0x37, 0x42, 0xf3, 0x6d, 0x25, 0xac, 0x21, + 0xdd, 0x5e, 0xbb, 0xcc, 0x11, 0xfb, 0xe2, 0xfe, 0x2c, 0xd3, 0xda, 0xa9, 0xff, 0x9c, 0x35, 0xc9, + 0x96, 0xa2, 0x3b, 0xeb, 0x9f, 0x77, 0xfc, 0x9d, 0xcd, 0x1a, 0xec, 0x34, 0x7e, 0x01, 0x9b, 0xd0, + 0x56, 0xf3, 0x69, 0xe6, 0x92, 0xe9, 0xcc, 0x25, 0xaf, 0x33, 0x97, 0x3c, 0xcc, 0xdd, 0xdc, 0x74, + 0xee, 0xe6, 0x5e, 0xe6, 0x6e, 0xee, 0xf2, 0x50, 0x74, 0xf5, 0xcd, 0x28, 0x64, 0x11, 0x0e, 0x78, + 0x37, 0xee, 0x2a, 0x09, 0x9a, 0x47, 0x18, 0x43, 0x55, 0x5d, 0xf7, 0xaa, 0x02, 0x97, 0xef, 0x34, + 0xfc, 0x9f, 0xfc, 0xe2, 0xc6, 0x7b, 0x00, 0x00, 0x00, 0xff, 0xff, 0xf9, 0xfa, 0xe7, 0x2a, 0xc1, + 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -723,7 +722,10 @@ func (m *MsgGrantAllowance) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthTx } if (iNdEx + skippy) > l { @@ -773,7 +775,10 @@ func (m *MsgGrantAllowanceResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthTx } if (iNdEx + skippy) > l { @@ -887,7 +892,10 @@ func (m *MsgRevokeAllowance) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthTx } if (iNdEx + skippy) > l { @@ -937,7 +945,10 @@ func (m *MsgRevokeAllowanceResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthTx } if (iNdEx + skippy) > l { diff --git a/gov/gov.pb.go b/gov/gov.pb.go index 52402ea..a0658bb 100644 --- a/gov/gov.pb.go +++ b/gov/gov.pb.go @@ -1355,7 +1355,10 @@ func (m *TextProposal) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthGov } if (iNdEx + skippy) > l { @@ -1490,7 +1493,10 @@ func (m *Deposit) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthGov } if (iNdEx + skippy) > l { @@ -1813,7 +1819,10 @@ func (m *Proposal) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthGov } if (iNdEx + skippy) > l { @@ -1999,7 +2008,10 @@ func (m *TallyResult) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthGov } if (iNdEx + skippy) > l { @@ -2119,7 +2131,10 @@ func (m *Vote) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthGov } if (iNdEx + skippy) > l { @@ -2236,7 +2251,10 @@ func (m *DepositParams) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthGov } if (iNdEx + skippy) > l { @@ -2319,7 +2337,10 @@ func (m *VotingParams) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthGov } if (iNdEx + skippy) > l { @@ -2468,7 +2489,10 @@ func (m *TallyParams) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthGov } if (iNdEx + skippy) > l { diff --git a/gov/query.pb.go b/gov/query.pb.go index 8ef050d..eeaa667 100644 --- a/gov/query.pb.go +++ b/gov/query.pb.go @@ -2185,7 +2185,10 @@ func (m *QueryProposalRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -2268,7 +2271,10 @@ func (m *QueryProposalResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -2437,7 +2443,10 @@ func (m *QueryProposalsRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -2557,7 +2566,10 @@ func (m *QueryProposalsResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -2658,7 +2670,10 @@ func (m *QueryVoteRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -2741,7 +2756,10 @@ func (m *QueryVoteResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -2846,7 +2864,10 @@ func (m *QueryVotesRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -2966,7 +2987,10 @@ func (m *QueryVotesResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -3048,7 +3072,10 @@ func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -3197,7 +3224,10 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -3298,7 +3328,10 @@ func (m *QueryDepositRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -3381,7 +3414,10 @@ func (m *QueryDepositResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -3486,7 +3522,10 @@ func (m *QueryDepositsRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -3606,7 +3645,10 @@ func (m *QueryDepositsResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -3675,7 +3717,10 @@ func (m *QueryTallyResultRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -3758,7 +3803,10 @@ func (m *QueryTallyResultResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { diff --git a/gov/tx.pb.go b/gov/tx.pb.go index eed6cdc..89ec6b6 100644 --- a/gov/tx.pb.go +++ b/gov/tx.pb.go @@ -947,7 +947,10 @@ func (m *MsgSubmitProposal) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthTx } if (iNdEx + skippy) > l { @@ -1016,7 +1019,10 @@ func (m *MsgSubmitProposalResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthTx } if (iNdEx + skippy) > l { @@ -1136,7 +1142,10 @@ func (m *MsgVote) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthTx } if (iNdEx + skippy) > l { @@ -1186,7 +1195,10 @@ func (m *MsgVoteResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthTx } if (iNdEx + skippy) > l { @@ -1321,7 +1333,10 @@ func (m *MsgDeposit) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthTx } if (iNdEx + skippy) > l { @@ -1371,7 +1386,10 @@ func (m *MsgDepositResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthTx } if (iNdEx + skippy) > l { diff --git a/ibc/nft_transfer/codec.go b/ibc/nft_transfer/codec.go new file mode 100644 index 0000000..7b3904a --- /dev/null +++ b/ibc/nft_transfer/codec.go @@ -0,0 +1,23 @@ +package nft_transfer + +import ( + "github.com/irisnet/core-sdk-go/types" + "github.com/irisnet/core-sdk-go/common/codec" + codectypes "github.com/irisnet/core-sdk-go/common/codec/types" + cryptocodec "github.com/irisnet/core-sdk-go/common/crypto/codec" +) + +var ( + amino = codec.NewLegacyAmino() + ModuleCdc = codec.NewAminoCodec(amino) +) + +func init() { + cryptocodec.RegisterCrypto(amino) +} + +// RegisterInterfaces register the ibc nft-transfer module interfaces to protobuf +// Any. +func RegisterInterfaces(registry codectypes.InterfaceRegistry) { + registry.RegisterImplementations((*types.Msg)(nil), &MsgTransfer{}) +} diff --git a/ibc/nft_transfer/export.go b/ibc/nft_transfer/export.go new file mode 100644 index 0000000..c7a51c6 --- /dev/null +++ b/ibc/nft_transfer/export.go @@ -0,0 +1,17 @@ +package nft_transfer + +import ( + sdk "github.com/irisnet/core-sdk-go/types" +) + +// expose transfer module api for user +type Client interface { + sdk.Module + NFTTransfer(request MsgTransfer, baseTx sdk.BaseTx) (sdk.ResultTx, sdk.Error) + QueryPorts(request QueryPortsRequest) (QueryPortsResponse, sdk.Error) + QueryParams(request QueryParamsRequest) (QueryParamsResponse, sdk.Error) + QueryClassHash(request QueryClassHashRequest) (QueryClassHashResponse, sdk.Error) + QueryClassTrace(request QueryClassTraceRequest) (QueryClassTraceResponse, sdk.Error) + QueryClassTraces(request QueryClassTracesRequest) (QueryClassTracesResponse, sdk.Error) + QueryEscrowAddress(request QueryEscrowAddressRequest) (QueryEscrowAddressResponse, sdk.Error) +} \ No newline at end of file diff --git a/ibc/nft_transfer/keys.go b/ibc/nft_transfer/keys.go new file mode 100644 index 0000000..0690c3c --- /dev/null +++ b/ibc/nft_transfer/keys.go @@ -0,0 +1,62 @@ +package nft_transfer + +import ( + "crypto/sha256" + "fmt" + + "github.com/irisnet/core-sdk-go/types" +) + +const ( + // ModuleName defines the IBC nft-transfer name + ModuleName = "nonfungibletokentransfer" + + // Version defines the current version the IBC nft-transfer + // module supports + Version = "ics721-1" + + // StoreKey is the store key string for IBC nft-transfer + StoreKey = ModuleName + + // RouterKey is the message route for IBC nft-transfer + RouterKey = ModuleName + + // QuerierRoute is the querier route for IBC nft-transfer + QuerierRoute = ModuleName + + // ClassPrefix is the prefix used for internal SDK non-fungible token representation. + ClassPrefix = "ibc" +) + +var ( + // PortKey defines the key to store the port ID in store + PortKey = []byte{0x01} + + // ClassTraceKey defines the key to store the class trace info in store + ClassTraceKey = []byte{0x02} + + // ParamsKey is the key to query all nft_transfer params + ParamsKey = []byte{0x03} +) + +// GetEscrowAddress returns the escrow address for the specified channel. +// The escrow address follows the format as outlined in ADR 028: +// https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-028-public-key-addresses.md +func GetEscrowAddress(portID, channelID string) types.AccAddress { + // a slash is used to create domain separation between port and channel identifiers to + // prevent address collisions between escrow addresses created for different channels + contents := fmt.Sprintf("%s/%s", portID, channelID) + + // ADR 028 AddressHash construction + preImage := []byte(Version) + preImage = append(preImage, 0) + preImage = append(preImage, contents...) + hash := sha256.Sum256(preImage) + return hash[:20] +} + +// KeyPort creates and returns a new key used for port store operations +func KeyPort(portID string) []byte { + bz := []byte(PortKey) + return append(bz, []byte(portID)...) +} diff --git a/ibc/nft_transfer/query.pb.go b/ibc/nft_transfer/query.pb.go new file mode 100644 index 0000000..b1eb8bb --- /dev/null +++ b/ibc/nft_transfer/query.pb.go @@ -0,0 +1,2847 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: ibc/applications/nft_transfer/v1/query.proto + +package nft_transfer + +import ( + context "context" + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/proto" + query "github.com/irisnet/core-sdk-go/types/query" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + 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 + +// QueryClassTraceRequest is the request type for the Query/ClassDenom RPC +// method +type QueryClassTraceRequest struct { + // hash (in hex format) or classID (full classID with ibc prefix) of the + // denomination trace information. + Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` +} + +func (m *QueryClassTraceRequest) Reset() { *m = QueryClassTraceRequest{} } +func (m *QueryClassTraceRequest) String() string { return proto.CompactTextString(m) } +func (*QueryClassTraceRequest) ProtoMessage() {} +func (*QueryClassTraceRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5a14f935a5261724, []int{0} +} +func (m *QueryClassTraceRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryClassTraceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryClassTraceRequest.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 *QueryClassTraceRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryClassTraceRequest.Merge(m, src) +} +func (m *QueryClassTraceRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryClassTraceRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryClassTraceRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryClassTraceRequest proto.InternalMessageInfo + +func (m *QueryClassTraceRequest) GetHash() string { + if m != nil { + return m.Hash + } + return "" +} + +// QueryClassTraceResponse is the response type for the Query/ClassDenom RPC +// method. +type QueryClassTraceResponse struct { + // class_trace returns the requested class trace information. + ClassTrace *ClassTrace `protobuf:"bytes,1,opt,name=class_trace,json=classTrace,proto3" json:"class_trace,omitempty"` +} + +func (m *QueryClassTraceResponse) Reset() { *m = QueryClassTraceResponse{} } +func (m *QueryClassTraceResponse) String() string { return proto.CompactTextString(m) } +func (*QueryClassTraceResponse) ProtoMessage() {} +func (*QueryClassTraceResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5a14f935a5261724, []int{1} +} +func (m *QueryClassTraceResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryClassTraceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryClassTraceResponse.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 *QueryClassTraceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryClassTraceResponse.Merge(m, src) +} +func (m *QueryClassTraceResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryClassTraceResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryClassTraceResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryClassTraceResponse proto.InternalMessageInfo + +func (m *QueryClassTraceResponse) GetClassTrace() *ClassTrace { + if m != nil { + return m.ClassTrace + } + return nil +} + +// QueryConnectionsRequest is the request type for the Query/ClassTraces RPC +// method +type QueryClassTracesRequest struct { + // pagination defines an optional pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryClassTracesRequest) Reset() { *m = QueryClassTracesRequest{} } +func (m *QueryClassTracesRequest) String() string { return proto.CompactTextString(m) } +func (*QueryClassTracesRequest) ProtoMessage() {} +func (*QueryClassTracesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5a14f935a5261724, []int{2} +} +func (m *QueryClassTracesRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryClassTracesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryClassTracesRequest.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 *QueryClassTracesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryClassTracesRequest.Merge(m, src) +} +func (m *QueryClassTracesRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryClassTracesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryClassTracesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryClassTracesRequest proto.InternalMessageInfo + +func (m *QueryClassTracesRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryClassTracesResponse is the response type for the Query/ClassTraces RPC +// method. +type QueryClassTracesResponse struct { + // class_traces returns all class trace information. + ClassTraces Traces `protobuf:"bytes,1,rep,name=class_traces,json=classTraces,proto3,castrepeated=Traces" json:"class_traces"` + // pagination defines the pagination in the response. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryClassTracesResponse) Reset() { *m = QueryClassTracesResponse{} } +func (m *QueryClassTracesResponse) String() string { return proto.CompactTextString(m) } +func (*QueryClassTracesResponse) ProtoMessage() {} +func (*QueryClassTracesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5a14f935a5261724, []int{3} +} +func (m *QueryClassTracesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryClassTracesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryClassTracesResponse.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 *QueryClassTracesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryClassTracesResponse.Merge(m, src) +} +func (m *QueryClassTracesResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryClassTracesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryClassTracesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryClassTracesResponse proto.InternalMessageInfo + +func (m *QueryClassTracesResponse) GetClassTraces() Traces { + if m != nil { + return m.ClassTraces + } + return nil +} + +func (m *QueryClassTracesResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryClassHashRequest is the request type for the Query/ClassHash RPC +// method +type QueryClassHashRequest struct { + // The class trace ([port_id]/[channel_id])+/[denom] + Trace string `protobuf:"bytes,1,opt,name=trace,proto3" json:"trace,omitempty"` +} + +func (m *QueryClassHashRequest) Reset() { *m = QueryClassHashRequest{} } +func (m *QueryClassHashRequest) String() string { return proto.CompactTextString(m) } +func (*QueryClassHashRequest) ProtoMessage() {} +func (*QueryClassHashRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5a14f935a5261724, []int{4} +} +func (m *QueryClassHashRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryClassHashRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryClassHashRequest.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 *QueryClassHashRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryClassHashRequest.Merge(m, src) +} +func (m *QueryClassHashRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryClassHashRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryClassHashRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryClassHashRequest proto.InternalMessageInfo + +func (m *QueryClassHashRequest) GetTrace() string { + if m != nil { + return m.Trace + } + return "" +} + +// QueryClassHashResponse is the response type for the Query/ClassHash RPC +// method. +type QueryClassHashResponse struct { + // hash (in hex format) of the denomination trace information. + Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` +} + +func (m *QueryClassHashResponse) Reset() { *m = QueryClassHashResponse{} } +func (m *QueryClassHashResponse) String() string { return proto.CompactTextString(m) } +func (*QueryClassHashResponse) ProtoMessage() {} +func (*QueryClassHashResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5a14f935a5261724, []int{5} +} +func (m *QueryClassHashResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryClassHashResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryClassHashResponse.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 *QueryClassHashResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryClassHashResponse.Merge(m, src) +} +func (m *QueryClassHashResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryClassHashResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryClassHashResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryClassHashResponse proto.InternalMessageInfo + +func (m *QueryClassHashResponse) GetHash() string { + if m != nil { + return m.Hash + } + return "" +} + +// QueryEscrowAddressRequest is the request type for the EscrowAddress RPC +// method. +type QueryEscrowAddressRequest struct { + // unique port identifier + PortId string `protobuf:"bytes,1,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty"` + // unique channel identifier + ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` +} + +func (m *QueryEscrowAddressRequest) Reset() { *m = QueryEscrowAddressRequest{} } +func (m *QueryEscrowAddressRequest) String() string { return proto.CompactTextString(m) } +func (*QueryEscrowAddressRequest) ProtoMessage() {} +func (*QueryEscrowAddressRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5a14f935a5261724, []int{6} +} +func (m *QueryEscrowAddressRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryEscrowAddressRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryEscrowAddressRequest.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 *QueryEscrowAddressRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryEscrowAddressRequest.Merge(m, src) +} +func (m *QueryEscrowAddressRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryEscrowAddressRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryEscrowAddressRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryEscrowAddressRequest proto.InternalMessageInfo + +func (m *QueryEscrowAddressRequest) GetPortId() string { + if m != nil { + return m.PortId + } + return "" +} + +func (m *QueryEscrowAddressRequest) GetChannelId() string { + if m != nil { + return m.ChannelId + } + return "" +} + +// QueryEscrowAddressResponse is the response type of the EscrowAddress RPC +// method. +type QueryEscrowAddressResponse struct { + // the escrow account address + EscrowAddress string `protobuf:"bytes,1,opt,name=escrow_address,json=escrowAddress,proto3" json:"escrow_address,omitempty"` +} + +func (m *QueryEscrowAddressResponse) Reset() { *m = QueryEscrowAddressResponse{} } +func (m *QueryEscrowAddressResponse) String() string { return proto.CompactTextString(m) } +func (*QueryEscrowAddressResponse) ProtoMessage() {} +func (*QueryEscrowAddressResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5a14f935a5261724, []int{7} +} +func (m *QueryEscrowAddressResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryEscrowAddressResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryEscrowAddressResponse.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 *QueryEscrowAddressResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryEscrowAddressResponse.Merge(m, src) +} +func (m *QueryEscrowAddressResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryEscrowAddressResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryEscrowAddressResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryEscrowAddressResponse proto.InternalMessageInfo + +func (m *QueryEscrowAddressResponse) GetEscrowAddress() string { + if m != nil { + return m.EscrowAddress + } + return "" +} + +// QueryParamsRequest is request type for the Query/Params RPC method. +type QueryParamsRequest struct { +} + +func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } +func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryParamsRequest) ProtoMessage() {} +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5a14f935a5261724, []int{8} +} +func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsRequest.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 *QueryParamsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsRequest.Merge(m, src) +} +func (m *QueryParamsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo + +// QueryParamsResponse is response type for the Query/Params RPC method. +type QueryParamsResponse struct { + // params holds all the parameters of this module. + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } +func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryParamsResponse) ProtoMessage() {} +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5a14f935a5261724, []int{9} +} +func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsResponse.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 *QueryParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsResponse.Merge(m, src) +} +func (m *QueryParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo + +func (m *QueryParamsResponse) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +// QueryPortsRequest is request type for the Query/Ports RPC method. +type QueryPortsRequest struct { +} + +func (m *QueryPortsRequest) Reset() { *m = QueryPortsRequest{} } +func (m *QueryPortsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryPortsRequest) ProtoMessage() {} +func (*QueryPortsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5a14f935a5261724, []int{10} +} +func (m *QueryPortsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryPortsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryPortsRequest.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 *QueryPortsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryPortsRequest.Merge(m, src) +} +func (m *QueryPortsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryPortsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryPortsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryPortsRequest proto.InternalMessageInfo + +// QueryPortsResponse is response type for the Query/Ports RPC method. +type QueryPortsResponse struct { + // entries holds all the port of this module. + Entries []Entry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries"` +} + +func (m *QueryPortsResponse) Reset() { *m = QueryPortsResponse{} } +func (m *QueryPortsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryPortsResponse) ProtoMessage() {} +func (*QueryPortsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5a14f935a5261724, []int{11} +} +func (m *QueryPortsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryPortsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryPortsResponse.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 *QueryPortsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryPortsResponse.Merge(m, src) +} +func (m *QueryPortsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryPortsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryPortsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryPortsResponse proto.InternalMessageInfo + +func (m *QueryPortsResponse) GetEntries() []Entry { + if m != nil { + return m.Entries + } + return nil +} + +// Entry is response type for the Query/Ports RPC method. +type Entry struct { + // the registered port of nft-transfer module + Port string `protobuf:"bytes,1,opt,name=port,proto3" json:"port,omitempty"` + // the port is available or not + Enabled bool `protobuf:"varint,2,opt,name=enabled,proto3" json:"enabled,omitempty"` +} + +func (m *Entry) Reset() { *m = Entry{} } +func (m *Entry) String() string { return proto.CompactTextString(m) } +func (*Entry) ProtoMessage() {} +func (*Entry) Descriptor() ([]byte, []int) { + return fileDescriptor_5a14f935a5261724, []int{12} +} +func (m *Entry) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Entry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Entry.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 *Entry) XXX_Merge(src proto.Message) { + xxx_messageInfo_Entry.Merge(m, src) +} +func (m *Entry) XXX_Size() int { + return m.Size() +} +func (m *Entry) XXX_DiscardUnknown() { + xxx_messageInfo_Entry.DiscardUnknown(m) +} + +var xxx_messageInfo_Entry proto.InternalMessageInfo + +func (m *Entry) GetPort() string { + if m != nil { + return m.Port + } + return "" +} + +func (m *Entry) GetEnabled() bool { + if m != nil { + return m.Enabled + } + return false +} + +func init() { + proto.RegisterType((*QueryClassTraceRequest)(nil), "ibc.applications.nft_transfer.v1.QueryClassTraceRequest") + proto.RegisterType((*QueryClassTraceResponse)(nil), "ibc.applications.nft_transfer.v1.QueryClassTraceResponse") + proto.RegisterType((*QueryClassTracesRequest)(nil), "ibc.applications.nft_transfer.v1.QueryClassTracesRequest") + proto.RegisterType((*QueryClassTracesResponse)(nil), "ibc.applications.nft_transfer.v1.QueryClassTracesResponse") + proto.RegisterType((*QueryClassHashRequest)(nil), "ibc.applications.nft_transfer.v1.QueryClassHashRequest") + proto.RegisterType((*QueryClassHashResponse)(nil), "ibc.applications.nft_transfer.v1.QueryClassHashResponse") + proto.RegisterType((*QueryEscrowAddressRequest)(nil), "ibc.applications.nft_transfer.v1.QueryEscrowAddressRequest") + proto.RegisterType((*QueryEscrowAddressResponse)(nil), "ibc.applications.nft_transfer.v1.QueryEscrowAddressResponse") + proto.RegisterType((*QueryParamsRequest)(nil), "ibc.applications.nft_transfer.v1.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "ibc.applications.nft_transfer.v1.QueryParamsResponse") + proto.RegisterType((*QueryPortsRequest)(nil), "ibc.applications.nft_transfer.v1.QueryPortsRequest") + proto.RegisterType((*QueryPortsResponse)(nil), "ibc.applications.nft_transfer.v1.QueryPortsResponse") + proto.RegisterType((*Entry)(nil), "ibc.applications.nft_transfer.v1.Entry") +} + +func init() { + proto.RegisterFile("ibc/applications/nft_transfer/v1/query.proto", fileDescriptor_5a14f935a5261724) +} + +var fileDescriptor_5a14f935a5261724 = []byte{ + // 817 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0x4f, 0x4f, 0x1b, 0x47, + 0x14, 0xf7, 0x52, 0x6c, 0xf0, 0x73, 0x41, 0xea, 0x40, 0x8b, 0xbb, 0x6a, 0x8d, 0xbb, 0x52, 0xc1, + 0xaa, 0xf0, 0x4e, 0xcd, 0x9f, 0x96, 0xfe, 0xb9, 0x14, 0x04, 0x94, 0x43, 0x2b, 0xea, 0x56, 0x3d, + 0x54, 0xaa, 0xac, 0xf1, 0x7a, 0x58, 0xaf, 0x6a, 0x76, 0x96, 0x9d, 0x85, 0x0a, 0x21, 0x5f, 0xf2, + 0x09, 0x22, 0xe5, 0x98, 0x43, 0xee, 0x39, 0x47, 0x51, 0x3e, 0x40, 0x0e, 0x1c, 0x91, 0x72, 0x48, + 0x4e, 0x49, 0x64, 0xf2, 0x41, 0xa2, 0xf9, 0xb3, 0xf6, 0x5a, 0x76, 0xb0, 0xcd, 0x6d, 0xf6, 0xcd, + 0xfb, 0xbd, 0xf7, 0xfb, 0xbd, 0x37, 0xef, 0x69, 0x61, 0xcd, 0xab, 0x3b, 0x98, 0x04, 0x41, 0xcb, + 0x73, 0x48, 0xe4, 0x31, 0x9f, 0x63, 0xff, 0x38, 0xaa, 0x45, 0x21, 0xf1, 0xf9, 0x31, 0x0d, 0xf1, + 0x79, 0x05, 0x9f, 0x9e, 0xd1, 0xf0, 0xc2, 0x0e, 0x42, 0x16, 0x31, 0x54, 0xf4, 0xea, 0x8e, 0x9d, + 0xf4, 0xb6, 0x93, 0xde, 0xf6, 0x79, 0xc5, 0x5c, 0x74, 0x99, 0xcb, 0xa4, 0x33, 0x16, 0x27, 0x85, + 0x33, 0xbf, 0x71, 0x18, 0x3f, 0x61, 0x1c, 0xd7, 0x09, 0xa7, 0x2a, 0x20, 0x3e, 0xaf, 0xd4, 0x69, + 0x44, 0x2a, 0x38, 0x20, 0xae, 0xe7, 0xcb, 0x60, 0xda, 0x17, 0x8f, 0x64, 0xd4, 0xcd, 0xa7, 0x00, + 0x5f, 0xb8, 0x8c, 0xb9, 0x2d, 0x8a, 0x49, 0xe0, 0x61, 0xe2, 0xfb, 0x2c, 0xd2, 0xd4, 0xe4, 0xad, + 0xb5, 0x06, 0x9f, 0xfd, 0x21, 0x12, 0xee, 0xb6, 0x08, 0xe7, 0x7f, 0x85, 0xc4, 0xa1, 0x55, 0x7a, + 0x7a, 0x46, 0x79, 0x84, 0x10, 0x4c, 0x37, 0x09, 0x6f, 0xe6, 0x8d, 0xa2, 0x51, 0xca, 0x56, 0xe5, + 0xd9, 0x6a, 0xc2, 0xd2, 0x80, 0x37, 0x0f, 0x98, 0xcf, 0x29, 0xfa, 0x0d, 0x72, 0x8e, 0xb0, 0x0a, + 0x2a, 0x0e, 0x95, 0xa8, 0xdc, 0xfa, 0x9a, 0x3d, 0xaa, 0x22, 0x76, 0x22, 0x14, 0x38, 0xdd, 0xb3, + 0x45, 0x06, 0x32, 0xf1, 0x98, 0xd8, 0x3e, 0x40, 0xaf, 0x2a, 0x3a, 0xd1, 0x8a, 0xad, 0x4a, 0x68, + 0x8b, 0x12, 0xda, 0xaa, 0x27, 0xba, 0x84, 0xf6, 0x11, 0x71, 0x63, 0x51, 0xd5, 0x04, 0xd2, 0x7a, + 0x6e, 0x40, 0x7e, 0x30, 0x87, 0x96, 0x53, 0x83, 0x8f, 0x13, 0x72, 0x78, 0xde, 0x28, 0x7e, 0x34, + 0xa9, 0x9e, 0x9d, 0xf9, 0xab, 0xd7, 0xcb, 0xa9, 0xc7, 0x6f, 0x96, 0x33, 0x3a, 0x76, 0xae, 0xa7, + 0x8f, 0xa3, 0x83, 0x3e, 0x15, 0x53, 0x52, 0xc5, 0xea, 0x48, 0x15, 0x8a, 0x5d, 0x9f, 0x8c, 0x32, + 0x7c, 0xda, 0x53, 0xf1, 0x2b, 0xe1, 0xcd, 0xb8, 0x4e, 0x8b, 0x90, 0xee, 0xf5, 0x22, 0x5b, 0x55, + 0x1f, 0xfd, 0x0d, 0x57, 0xee, 0x5a, 0xf2, 0xb0, 0x86, 0xff, 0x09, 0x9f, 0x4b, 0xef, 0x3d, 0xee, + 0x84, 0xec, 0xff, 0x5f, 0x1a, 0x8d, 0x90, 0xf2, 0x6e, 0x23, 0x96, 0x60, 0x26, 0x60, 0x61, 0x54, + 0xf3, 0x1a, 0x1a, 0x93, 0x11, 0x9f, 0x87, 0x0d, 0xf4, 0x25, 0x80, 0xd3, 0x24, 0xbe, 0x4f, 0x5b, + 0xe2, 0x6e, 0x4a, 0xde, 0x65, 0xb5, 0xe5, 0xb0, 0x61, 0xed, 0x82, 0x39, 0x2c, 0xa8, 0xa6, 0xf1, + 0x35, 0xcc, 0x53, 0x79, 0x51, 0x23, 0xea, 0x46, 0x07, 0x9f, 0xa3, 0x49, 0x77, 0x6b, 0x11, 0x90, + 0x0c, 0x72, 0x44, 0x42, 0x72, 0x12, 0x53, 0xb2, 0xfe, 0x85, 0x85, 0x3e, 0xab, 0x8e, 0xb9, 0x0f, + 0x99, 0x40, 0x5a, 0xf4, 0x73, 0x29, 0x8d, 0xee, 0xa3, 0x8a, 0xb0, 0x33, 0x2d, 0x7a, 0x58, 0xd5, + 0x68, 0x6b, 0x01, 0x3e, 0x51, 0xe1, 0x59, 0x18, 0x25, 0x72, 0xa2, 0xa4, 0x51, 0xa7, 0x3c, 0x80, + 0x19, 0xea, 0x47, 0xa1, 0xd7, 0x7d, 0x3b, 0xab, 0xa3, 0x73, 0xee, 0xf9, 0x51, 0x78, 0xa1, 0x53, + 0xc6, 0x68, 0x6b, 0x0b, 0xd2, 0xd2, 0x2e, 0xfa, 0x23, 0xea, 0x1b, 0xf7, 0x47, 0x9c, 0x51, 0x5e, + 0x64, 0x21, 0xf5, 0x16, 0x55, 0x65, 0x9e, 0xad, 0xc6, 0x9f, 0xeb, 0x2f, 0x67, 0x21, 0x2d, 0x69, + 0xa1, 0x67, 0x06, 0x40, 0xef, 0x55, 0xa2, 0xed, 0xd1, 0x3c, 0x86, 0x6f, 0x04, 0xf3, 0x87, 0x3b, + 0x20, 0x55, 0x35, 0xac, 0xad, 0x7b, 0x2f, 0xde, 0x3d, 0x98, 0xc2, 0xa8, 0x1c, 0xaf, 0xaf, 0xc1, + 0xb5, 0x95, 0x1c, 0x37, 0x7c, 0x29, 0x5e, 0x5f, 0x1b, 0x3d, 0x31, 0x20, 0x97, 0x98, 0x4e, 0x34, + 0x39, 0x83, 0xb8, 0x4b, 0xe6, 0x8f, 0x77, 0x81, 0x6a, 0xf6, 0xb6, 0x64, 0x5f, 0x42, 0x2b, 0xe3, + 0xb1, 0x47, 0x4f, 0x0d, 0xc8, 0x76, 0xe7, 0x0b, 0x7d, 0x3f, 0x49, 0xe6, 0xc4, 0x00, 0x9b, 0xdb, + 0x93, 0x03, 0x35, 0xe1, 0xef, 0x24, 0xe1, 0x6f, 0x91, 0x3d, 0x8a, 0xb0, 0x28, 0xb3, 0x28, 0xb7, + 0x24, 0xde, 0x46, 0x1d, 0x03, 0xe6, 0xfa, 0xa6, 0x12, 0xfd, 0x34, 0x26, 0x87, 0x61, 0x0b, 0xc2, + 0xfc, 0xf9, 0x6e, 0x60, 0x2d, 0xe2, 0x6f, 0x29, 0xe2, 0x08, 0xfd, 0x7e, 0x8b, 0x08, 0xb5, 0x53, + 0x38, 0xbe, 0xec, 0xed, 0x9b, 0x36, 0x16, 0x93, 0xc1, 0xf1, 0xa5, 0xde, 0x4d, 0x6d, 0xdc, 0xbf, + 0x4e, 0xd0, 0x23, 0x03, 0x32, 0x6a, 0xba, 0xd1, 0xe6, 0x98, 0x04, 0xfb, 0x96, 0x8c, 0xb9, 0x35, + 0x21, 0x4a, 0xeb, 0x29, 0x49, 0x3d, 0x16, 0x2a, 0x7e, 0x58, 0x8f, 0x5a, 0x33, 0xe8, 0xa1, 0x01, + 0x69, 0xb9, 0x4d, 0xd0, 0xc6, 0xb8, 0xa9, 0x12, 0x0b, 0xc9, 0xdc, 0x9c, 0x0c, 0xa4, 0xe9, 0xad, + 0x4a, 0x7a, 0x5f, 0xa1, 0xe5, 0x5b, 0xe8, 0x09, 0xc0, 0xce, 0xe1, 0x55, 0xa7, 0x60, 0x5c, 0x77, + 0x0a, 0xc6, 0xdb, 0x4e, 0xc1, 0xb8, 0x7f, 0x53, 0x48, 0x5d, 0xdf, 0x14, 0x52, 0xaf, 0x6e, 0x0a, + 0xa9, 0x7f, 0xb0, 0xeb, 0x45, 0xcd, 0xb3, 0xba, 0xed, 0xb0, 0x13, 0xec, 0x85, 0x1e, 0xf7, 0x69, + 0x84, 0x1d, 0x16, 0xd2, 0x32, 0x6f, 0xfc, 0x57, 0x76, 0x99, 0x0c, 0x9c, 0x8c, 0x59, 0xcf, 0xc8, + 0x9f, 0x90, 0x8d, 0xf7, 0x01, 0x00, 0x00, 0xff, 0xff, 0x62, 0x6a, 0x30, 0x8e, 0x67, 0x09, 0x00, + 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + // ClassTrace queries a class trace information. + ClassTrace(ctx context.Context, in *QueryClassTraceRequest, opts ...grpc.CallOption) (*QueryClassTraceResponse, error) + // ClassTraces queries all class traces. + ClassTraces(ctx context.Context, in *QueryClassTracesRequest, opts ...grpc.CallOption) (*QueryClassTracesResponse, error) + // ClassHash queries a class hash information. + ClassHash(ctx context.Context, in *QueryClassHashRequest, opts ...grpc.CallOption) (*QueryClassHashResponse, error) + // EscrowAddress returns the escrow address for a particular port and channel + // id. + EscrowAddress(ctx context.Context, in *QueryEscrowAddressRequest, opts ...grpc.CallOption) (*QueryEscrowAddressResponse, error) + // Params queries all parameters of the nft-transfer module. + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + // Ports queries all port of the nft-transfer module. + Ports(ctx context.Context, in *QueryPortsRequest, opts ...grpc.CallOption) (*QueryPortsResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) ClassTrace(ctx context.Context, in *QueryClassTraceRequest, opts ...grpc.CallOption) (*QueryClassTraceResponse, error) { + out := new(QueryClassTraceResponse) + err := c.cc.Invoke(ctx, "/ibc.applications.nft_transfer.v1.Query/ClassTrace", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) ClassTraces(ctx context.Context, in *QueryClassTracesRequest, opts ...grpc.CallOption) (*QueryClassTracesResponse, error) { + out := new(QueryClassTracesResponse) + err := c.cc.Invoke(ctx, "/ibc.applications.nft_transfer.v1.Query/ClassTraces", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) ClassHash(ctx context.Context, in *QueryClassHashRequest, opts ...grpc.CallOption) (*QueryClassHashResponse, error) { + out := new(QueryClassHashResponse) + err := c.cc.Invoke(ctx, "/ibc.applications.nft_transfer.v1.Query/ClassHash", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) EscrowAddress(ctx context.Context, in *QueryEscrowAddressRequest, opts ...grpc.CallOption) (*QueryEscrowAddressResponse, error) { + out := new(QueryEscrowAddressResponse) + err := c.cc.Invoke(ctx, "/ibc.applications.nft_transfer.v1.Query/EscrowAddress", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, "/ibc.applications.nft_transfer.v1.Query/Params", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Ports(ctx context.Context, in *QueryPortsRequest, opts ...grpc.CallOption) (*QueryPortsResponse, error) { + out := new(QueryPortsResponse) + err := c.cc.Invoke(ctx, "/ibc.applications.nft_transfer.v1.Query/Ports", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // ClassTrace queries a class trace information. + ClassTrace(context.Context, *QueryClassTraceRequest) (*QueryClassTraceResponse, error) + // ClassTraces queries all class traces. + ClassTraces(context.Context, *QueryClassTracesRequest) (*QueryClassTracesResponse, error) + // ClassHash queries a class hash information. + ClassHash(context.Context, *QueryClassHashRequest) (*QueryClassHashResponse, error) + // EscrowAddress returns the escrow address for a particular port and channel + // id. + EscrowAddress(context.Context, *QueryEscrowAddressRequest) (*QueryEscrowAddressResponse, error) + // Params queries all parameters of the nft-transfer module. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // Ports queries all port of the nft-transfer module. + Ports(context.Context, *QueryPortsRequest) (*QueryPortsResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) ClassTrace(ctx context.Context, req *QueryClassTraceRequest) (*QueryClassTraceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ClassTrace not implemented") +} +func (*UnimplementedQueryServer) ClassTraces(ctx context.Context, req *QueryClassTracesRequest) (*QueryClassTracesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ClassTraces not implemented") +} +func (*UnimplementedQueryServer) ClassHash(ctx context.Context, req *QueryClassHashRequest) (*QueryClassHashResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ClassHash not implemented") +} +func (*UnimplementedQueryServer) EscrowAddress(ctx context.Context, req *QueryEscrowAddressRequest) (*QueryEscrowAddressResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method EscrowAddress not implemented") +} +func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} +func (*UnimplementedQueryServer) Ports(ctx context.Context, req *QueryPortsRequest) (*QueryPortsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Ports not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_ClassTrace_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryClassTraceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ClassTrace(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.applications.nft_transfer.v1.Query/ClassTrace", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ClassTrace(ctx, req.(*QueryClassTraceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_ClassTraces_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryClassTracesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ClassTraces(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.applications.nft_transfer.v1.Query/ClassTraces", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ClassTraces(ctx, req.(*QueryClassTracesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_ClassHash_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryClassHashRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ClassHash(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.applications.nft_transfer.v1.Query/ClassHash", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ClassHash(ctx, req.(*QueryClassHashRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_EscrowAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryEscrowAddressRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).EscrowAddress(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.applications.nft_transfer.v1.Query/EscrowAddress", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).EscrowAddress(ctx, req.(*QueryEscrowAddressRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Params(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.applications.nft_transfer.v1.Query/Params", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Ports_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryPortsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Ports(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.applications.nft_transfer.v1.Query/Ports", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Ports(ctx, req.(*QueryPortsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "ibc.applications.nft_transfer.v1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ClassTrace", + Handler: _Query_ClassTrace_Handler, + }, + { + MethodName: "ClassTraces", + Handler: _Query_ClassTraces_Handler, + }, + { + MethodName: "ClassHash", + Handler: _Query_ClassHash_Handler, + }, + { + MethodName: "EscrowAddress", + Handler: _Query_EscrowAddress_Handler, + }, + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "Ports", + Handler: _Query_Ports_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "ibc/applications/nft_transfer/v1/query.proto", +} + +func (m *QueryClassTraceRequest) 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 *QueryClassTraceRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryClassTraceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Hash) > 0 { + i -= len(m.Hash) + copy(dAtA[i:], m.Hash) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Hash))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryClassTraceResponse) 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 *QueryClassTraceResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryClassTraceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ClassTrace != nil { + { + size, err := m.ClassTrace.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryClassTracesRequest) 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 *QueryClassTracesRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryClassTracesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryClassTracesResponse) 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 *QueryClassTracesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryClassTracesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.ClassTraces) > 0 { + for iNdEx := len(m.ClassTraces) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ClassTraces[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryClassHashRequest) 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 *QueryClassHashRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryClassHashRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Trace) > 0 { + i -= len(m.Trace) + copy(dAtA[i:], m.Trace) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Trace))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryClassHashResponse) 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 *QueryClassHashResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryClassHashResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Hash) > 0 { + i -= len(m.Hash) + copy(dAtA[i:], m.Hash) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Hash))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryEscrowAddressRequest) 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 *QueryEscrowAddressRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryEscrowAddressRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ChannelId) > 0 { + i -= len(m.ChannelId) + copy(dAtA[i:], m.ChannelId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ChannelId))) + i-- + dAtA[i] = 0x12 + } + if len(m.PortId) > 0 { + i -= len(m.PortId) + copy(dAtA[i:], m.PortId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.PortId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryEscrowAddressResponse) 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 *QueryEscrowAddressResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryEscrowAddressResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.EscrowAddress) > 0 { + i -= len(m.EscrowAddress) + copy(dAtA[i:], m.EscrowAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.EscrowAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryParamsRequest) 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 *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryParamsResponse) 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 *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryPortsRequest) 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 *QueryPortsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryPortsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryPortsResponse) 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 *QueryPortsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryPortsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Entries) > 0 { + for iNdEx := len(m.Entries) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Entries[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Entry) 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 *Entry) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Entry) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Enabled { + i-- + if m.Enabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if len(m.Port) > 0 { + i -= len(m.Port) + copy(dAtA[i:], m.Port) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Port))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryClassTraceRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Hash) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryClassTraceResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ClassTrace != nil { + l = m.ClassTrace.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryClassTracesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryClassTracesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.ClassTraces) > 0 { + for _, e := range m.ClassTraces { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryClassHashRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Trace) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryClassHashResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Hash) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryEscrowAddressRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.PortId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.ChannelId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryEscrowAddressResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.EscrowAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryPortsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryPortsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Entries) > 0 { + for _, e := range m.Entries { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *Entry) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Port) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Enabled { + n += 2 + } + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryClassTraceRequest) 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 ErrIntOverflowQuery + } + 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: QueryClassTraceRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryClassTraceRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Hash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryClassTraceResponse) 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 ErrIntOverflowQuery + } + 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: QueryClassTraceResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryClassTraceResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClassTrace", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ClassTrace == nil { + m.ClassTrace = &ClassTrace{} + } + if err := m.ClassTrace.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryClassTracesRequest) 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 ErrIntOverflowQuery + } + 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: QueryClassTracesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryClassTracesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryClassTracesResponse) 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 ErrIntOverflowQuery + } + 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: QueryClassTracesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryClassTracesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClassTraces", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClassTraces = append(m.ClassTraces, ClassTrace{}) + if err := m.ClassTraces[len(m.ClassTraces)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryClassHashRequest) 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 ErrIntOverflowQuery + } + 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: QueryClassHashRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryClassHashRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Trace", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Trace = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryClassHashResponse) 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 ErrIntOverflowQuery + } + 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: QueryClassHashResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryClassHashResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Hash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryEscrowAddressRequest) 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 ErrIntOverflowQuery + } + 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: QueryEscrowAddressRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryEscrowAddressRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PortId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PortId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChannelId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryEscrowAddressResponse) 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 ErrIntOverflowQuery + } + 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: QueryEscrowAddressResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryEscrowAddressResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EscrowAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EscrowAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryParamsRequest) 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 ErrIntOverflowQuery + } + 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: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryParamsResponse) 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 ErrIntOverflowQuery + } + 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: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryPortsRequest) 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 ErrIntOverflowQuery + } + 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: QueryPortsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryPortsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryPortsResponse) 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 ErrIntOverflowQuery + } + 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: QueryPortsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryPortsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Entries", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Entries = append(m.Entries, Entry{}) + if err := m.Entries[len(m.Entries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Entry) 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 ErrIntOverflowQuery + } + 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: Entry: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Entry: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Port = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Enabled = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQuery(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, ErrIntOverflowQuery + } + 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, ErrIntOverflowQuery + } + 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, ErrIntOverflowQuery + } + 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, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/ibc/nft_transfer/trace.go b/ibc/nft_transfer/trace.go new file mode 100644 index 0000000..d760bfc --- /dev/null +++ b/ibc/nft_transfer/trace.go @@ -0,0 +1,183 @@ +package nft_transfer + +import ( + "crypto/sha256" + "encoding/hex" + "fmt" + "sort" + "strings" + + tmbytes "github.com/tendermint/tendermint/libs/bytes" + tmtypes "github.com/tendermint/tendermint/types" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + host "github.com/irisnet/core-sdk-go/ibc/v5/modules/core/24-host" +) + +// ParseHexHash parses a hex hash in string format to bytes and validates its correctness. +func ParseHexHash(hexHash string) (tmbytes.HexBytes, error) { + hash, err := hex.DecodeString(hexHash) + if err != nil { + return nil, err + } + + if err := tmtypes.ValidateHash(hash); err != nil { + return nil, err + } + + return hash, nil +} + +// GetClassPrefix returns the receiving class prefix +func GetClassPrefix(portID, channelID string) string { + return fmt.Sprintf("%s/%s/", portID, channelID) +} + +// RemoveClassPrefix returns the unprefixed classID. +// After the receiving chain receives the packet,if isAwayFromOrigin=false, it means that nft is moving +// in the direction of the original chain, and the portID/channelID prefix of the sending chain +// in trace.path needs to be removed +func RemoveClassPrefix(portID, channelID, classID string) (string, error) { + classPrefix := GetClassPrefix(portID, channelID) + if strings.HasPrefix(classID, classPrefix) { + return strings.TrimPrefix(classID, classPrefix), nil + } + return "", fmt.Errorf("invalid class:%s, no class prefix: %s", classID, classPrefix) +} + +// IsAwayFromOrigin determine if non-fungible token is moving away from +// the origin chain (the chain issued by the native nft). +// Note that fullClassPath refers to the full path of the unencoded classID. +// The longer the fullClassPath, the farther it is from the origin chain +func IsAwayFromOrigin(sourcePort, sourceChannel, fullClassPath string) bool { + prefixClassID := GetClassPrefix(sourcePort, sourceChannel) + if !strings.HasPrefix(fullClassPath, prefixClassID) { + return true + } + return fullClassPath[:len(prefixClassID)] != prefixClassID +} + +// ParseClassTrace parses a string with the ibc prefix (class trace) and the base classID +// into a ClassTrace type. +// +// Examples: +// +// - "port-1/channel-1/class-1" => ClassTrace{Path: "port-1/channel-1", BaseClassId: "class-1"} +// - "class-1" => ClassTrace{Path: "", BaseClassId: "class-1"} +func ParseClassTrace(rawClassID string) ClassTrace { + classSplit := strings.Split(rawClassID, "/") + + if classSplit[0] == rawClassID { + return ClassTrace{ + Path: "", + BaseClassId: rawClassID, + } + } + + return ClassTrace{ + Path: strings.Join(classSplit[:len(classSplit)-1], "/"), + BaseClassId: classSplit[len(classSplit)-1], + } +} + +// GetFullClassPath returns the full classId according to the ICS721 specification: +// tracePath + "/" + BaseClassId +// If there exists no trace then the base BaseClassId is returned. +func (ct ClassTrace) GetFullClassPath() string { + if ct.Path == "" { + return ct.BaseClassId + } + return ct.GetPrefix() + ct.BaseClassId +} + +// GetPrefix returns the receiving classId prefix composed by the trace info and a separator. +func (ct ClassTrace) GetPrefix() string { + return ct.Path + "/" +} + +// Hash returns the hex bytes of the SHA256 hash of the ClassTrace fields using the following formula: +// +// hash = sha256(tracePath + "/" + baseClassId) +func (ct ClassTrace) Hash() tmbytes.HexBytes { + hash := sha256.Sum256([]byte(ct.GetFullClassPath())) + return hash[:] +} + +// IBCClassID a classID for an ICS721 non-fungible token in the format +// 'ibc/{hash(tracePath + BaseClassId)}'. If the trace is empty, it will return the base classID. +func (ct ClassTrace) IBCClassID() string { + if ct.Path != "" { + return fmt.Sprintf("%s/%s", ClassPrefix, ct.Hash()) + } + return ct.BaseClassId +} + +// Validate performs a basic validation of the ClassTrace fields. +func (ct ClassTrace) Validate() error { + // empty trace is accepted when token lives on the original chain + switch { + case ct.Path == "" && ct.BaseClassId != "": + return nil + case strings.TrimSpace(ct.BaseClassId) == "": + return fmt.Errorf("base class_id cannot be blank") + } + + // NOTE: no base class validation + + identifiers := strings.Split(ct.Path, "/") + return validateTraceIdentifiers(identifiers) +} + +func validateTraceIdentifiers(identifiers []string) error { + if len(identifiers) == 0 || len(identifiers)%2 != 0 { + return fmt.Errorf("trace info must come in pairs of port and channel identifiers '{portID}/{channelID}', got the identifiers: %s", identifiers) + } + + // validate correctness of port and channel identifiers + for i := 0; i < len(identifiers); i += 2 { + if err := host.PortIdentifierValidator(identifiers[i]); err != nil { + return sdkerrors.Wrapf(err, "invalid port ID at position %d", i) + } + if err := host.ChannelIdentifierValidator(identifiers[i+1]); err != nil { + return sdkerrors.Wrapf(err, "invalid channel ID at position %d", i) + } + } + return nil +} + +// Traces defines a wrapper type for a slice of DenomTrace. +type Traces []ClassTrace + +// Validate performs a basic validation of each denomination trace info. +func (t Traces) Validate() error { + seenTraces := make(map[string]bool) + for i, trace := range t { + hash := trace.Hash().String() + if seenTraces[hash] { + return fmt.Errorf("duplicated class trace with hash %s", trace.Hash()) + } + + if err := trace.Validate(); err != nil { + return sdkerrors.Wrapf(err, "failed class trace %d validation", i) + } + seenTraces[hash] = true + } + return nil +} + +var _ sort.Interface = Traces{} + +// Len implements sort.Interface for Traces +func (t Traces) Len() int { return len(t) } + +// Less implements sort.Interface for Traces +func (t Traces) Less(i, j int) bool { return t[i].GetFullClassPath() < t[j].GetFullClassPath() } + +// Swap implements sort.Interface for Traces +func (t Traces) Swap(i, j int) { t[i], t[j] = t[j], t[i] } + +// Sort is a helper function to sort the set of denomination traces in-place +func (t Traces) Sort() Traces { + sort.Sort(t) + return t +} diff --git a/ibc/nft_transfer/transfer.go b/ibc/nft_transfer/transfer.go new file mode 100644 index 0000000..61a3dc6 --- /dev/null +++ b/ibc/nft_transfer/transfer.go @@ -0,0 +1,149 @@ +package nft_transfer + +import ( + context "context" + + "github.com/irisnet/core-sdk-go/common/codec" + "github.com/irisnet/core-sdk-go/common/codec/types" + sdk "github.com/irisnet/core-sdk-go/types" +) + +type nftTransferClient struct { + sdk.BaseClient + codec.Marshaler +} + +func NewClient(bc sdk.BaseClient, cdc codec.Marshaler) nftTransferClient { + return nftTransferClient{ + BaseClient: bc, + Marshaler: cdc, + } +} + +func (nft nftTransferClient) Name() string { + return ModuleName +} + +func (ntc nftTransferClient) RegisterInterfaceTypes(registry types.InterfaceRegistry) { + RegisterInterfaces(registry) +} + +func (ntc nftTransferClient) NFTTransfer(request MsgTransfer, baseTx sdk.BaseTx) (sdk.ResultTx, sdk.Error) { + author, err := ntc.QueryAddress(baseTx.From, baseTx.Password) + if err != nil { + return sdk.ResultTx{}, sdk.Wrap(err) + } + request.Sender = author.String() + // msg := &MsgTransfer{ + // SourcePort: request.SourcePort, + // SourceChannel: request.SourceChannel, + // ClassId: request.ClassId, + // TokenIds: request.TokenIds, + // Sender: author.String(), + // Receiver: request.Receiver, + // TimeoutHeight: request.TimeoutHeight, + // TimeoutTimestamp: request.TimeoutTimestamp, + // } + return ntc.BuildAndSend([]sdk.Msg{&request}, baseTx) +} + +func (ntc nftTransferClient) QueryClassTrace(request QueryClassTraceRequest) (QueryClassTraceResponse, sdk.Error) { + conn, err := ntc.GenConn() + if err != nil { + return QueryClassTraceResponse{}, sdk.Wrap(err) + } + res, err := NewQueryClient(conn).ClassTrace(context.Background(), + &QueryClassTraceRequest{ + Hash: request.Hash, + }, + ) + if err != nil { + return QueryClassTraceResponse{}, sdk.Wrap(err) + } + return QueryClassTraceResponse{ + ClassTrace: res.ClassTrace, + }, nil +} + +func (ntc nftTransferClient) QueryClassTraces(request QueryClassTracesRequest) (QueryClassTracesResponse, sdk.Error) { + conn, err := ntc.GenConn() + if err != nil { + return QueryClassTracesResponse{}, sdk.Wrap(err) + } + res, err := NewQueryClient(conn).ClassTraces(context.Background(), + &QueryClassTracesRequest{ + Pagination: request.Pagination, + }, + ) + if err != nil { + return QueryClassTracesResponse{}, sdk.Wrap(err) + } + return QueryClassTracesResponse{ + ClassTraces: res.ClassTraces, + }, nil +} + +func (nft nftTransferClient) QueryClassHash(request QueryClassHashRequest) (QueryClassHashResponse, sdk.Error) { + conn, err := nft.GenConn() + if err != nil { + return QueryClassHashResponse{}, sdk.Wrap(err) + } + res, err := NewQueryClient(conn).ClassHash(context.Background(), + &QueryClassHashRequest{ + Trace: request.Trace, + }, + ) + if err != nil { + return QueryClassHashResponse{}, sdk.Wrap(err) + } + return QueryClassHashResponse{ + Hash: res.Hash, + }, nil +} + +func (nft nftTransferClient) QueryEscrowAddress(request QueryEscrowAddressRequest) (QueryEscrowAddressResponse, sdk.Error) { + conn, err := nft.GenConn() + if err != nil { + return QueryEscrowAddressResponse{}, sdk.Wrap(err) + } + res, err := NewQueryClient(conn).EscrowAddress(context.Background(), + &QueryEscrowAddressRequest{ + PortId: request.PortId, + ChannelId: request.ChannelId, + }, + ) + if err != nil { + return QueryEscrowAddressResponse{}, sdk.Wrap(err) + } + return QueryEscrowAddressResponse{ + EscrowAddress: res.EscrowAddress, + }, nil +} + +func (nft nftTransferClient) QueryParams(request QueryParamsRequest) (QueryParamsResponse, sdk.Error) { + conn, err := nft.GenConn() + if err != nil { + return QueryParamsResponse{}, sdk.Wrap(err) + } + res, err := NewQueryClient(conn).Params(context.Background(), &QueryParamsRequest{}) + if err != nil { + return QueryParamsResponse{}, sdk.Wrap(err) + } + return QueryParamsResponse{ + Params: res.Params, + }, nil +} + +func (nft nftTransferClient) QueryPorts(request QueryPortsRequest) (QueryPortsResponse, sdk.Error) { + conn, err := nft.GenConn() + if err != nil { + return QueryPortsResponse{}, sdk.Wrap(err) + } + res, err := NewQueryClient(conn).Ports(context.Background(), &QueryPortsRequest{}) + if err != nil { + return QueryPortsResponse{}, sdk.Wrap(err) + } + return QueryPortsResponse{ + Entries: res.Entries, + }, nil +} diff --git a/ibc/nft_transfer/transfer.pb.go b/ibc/nft_transfer/transfer.pb.go new file mode 100644 index 0000000..745638f --- /dev/null +++ b/ibc/nft_transfer/transfer.pb.go @@ -0,0 +1,592 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: ibc/applications/nft_transfer/v1/transfer.proto + +package nft_transfer + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/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 + +// ClassTrace contains the base classID for ICS721 non-fungible tokens and the +// source tracing information path. +type ClassTrace struct { + // path defines the chain of port/channel identifiers used for tracing the + // source of the non-fungible token. + Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` + // base classID of the relayed non-fungible token. + BaseClassId string `protobuf:"bytes,2,opt,name=base_class_id,json=baseClassId,proto3" json:"base_class_id,omitempty"` +} + +func (m *ClassTrace) Reset() { *m = ClassTrace{} } +func (m *ClassTrace) String() string { return proto.CompactTextString(m) } +func (*ClassTrace) ProtoMessage() {} +func (*ClassTrace) Descriptor() ([]byte, []int) { + return fileDescriptor_fbbec0a5a50746a6, []int{0} +} +func (m *ClassTrace) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ClassTrace) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ClassTrace.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 *ClassTrace) XXX_Merge(src proto.Message) { + xxx_messageInfo_ClassTrace.Merge(m, src) +} +func (m *ClassTrace) XXX_Size() int { + return m.Size() +} +func (m *ClassTrace) XXX_DiscardUnknown() { + xxx_messageInfo_ClassTrace.DiscardUnknown(m) +} + +var xxx_messageInfo_ClassTrace proto.InternalMessageInfo + +func (m *ClassTrace) GetPath() string { + if m != nil { + return m.Path + } + return "" +} + +func (m *ClassTrace) GetBaseClassId() string { + if m != nil { + return m.BaseClassId + } + return "" +} + +// Params defines the set of IBC nft-transfer parameters. +// NOTE: To prevent a nft from being transferred, set the +// TransfersEnabled parameter to false. +type Params struct { + // send_enabled enables or disables all cross-chain nft transfers from this + // chain. + SendEnabled bool `protobuf:"varint,1,opt,name=send_enabled,json=sendEnabled,proto3" json:"send_enabled,omitempty"` + // receive_enabled enables or disables all cross-chain nft transfers to this + // chain. + ReceiveEnabled bool `protobuf:"varint,2,opt,name=receive_enabled,json=receiveEnabled,proto3" json:"receive_enabled,omitempty"` +} + +func (m *Params) Reset() { *m = Params{} } +func (m *Params) String() string { return proto.CompactTextString(m) } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_fbbec0a5a50746a6, []int{1} +} +func (m *Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Params.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 *Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_Params.Merge(m, src) +} +func (m *Params) XXX_Size() int { + return m.Size() +} +func (m *Params) XXX_DiscardUnknown() { + xxx_messageInfo_Params.DiscardUnknown(m) +} + +var xxx_messageInfo_Params proto.InternalMessageInfo + +func (m *Params) GetSendEnabled() bool { + if m != nil { + return m.SendEnabled + } + return false +} + +func (m *Params) GetReceiveEnabled() bool { + if m != nil { + return m.ReceiveEnabled + } + return false +} + +func init() { + proto.RegisterType((*ClassTrace)(nil), "ibc.applications.nft_transfer.v1.ClassTrace") + proto.RegisterType((*Params)(nil), "ibc.applications.nft_transfer.v1.Params") +} + +func init() { + proto.RegisterFile("ibc/applications/nft_transfer/v1/transfer.proto", fileDescriptor_fbbec0a5a50746a6) +} + +var fileDescriptor_fbbec0a5a50746a6 = []byte{ + // 256 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x90, 0xbd, 0x4e, 0xc3, 0x30, + 0x14, 0x85, 0x93, 0x0a, 0x55, 0xe0, 0xf2, 0x23, 0x79, 0xea, 0x64, 0x95, 0x2c, 0xb0, 0xd4, 0x56, + 0xc5, 0x1b, 0xf0, 0x33, 0x74, 0x43, 0x55, 0x27, 0x96, 0xe8, 0xda, 0xbe, 0x6d, 0x2d, 0x52, 0x3b, + 0xb2, 0x4d, 0x9e, 0x83, 0xc7, 0x62, 0xec, 0xc8, 0x88, 0x92, 0x17, 0x41, 0x31, 0xa5, 0xca, 0x76, + 0xf4, 0xf9, 0x3b, 0x96, 0xee, 0x21, 0xc2, 0x48, 0x25, 0xa0, 0xae, 0x2b, 0xa3, 0x20, 0x1a, 0x67, + 0x83, 0xb0, 0x9b, 0x58, 0x46, 0x0f, 0x36, 0x6c, 0xd0, 0x8b, 0x66, 0x21, 0xfe, 0x33, 0xaf, 0xbd, + 0x8b, 0x8e, 0xce, 0x8c, 0x54, 0x7c, 0x58, 0xe0, 0xc3, 0x02, 0x6f, 0x16, 0xc5, 0x33, 0x21, 0x4f, + 0x15, 0x84, 0xb0, 0xf6, 0xa0, 0x90, 0x52, 0x72, 0x56, 0x43, 0xdc, 0x4d, 0xf3, 0x59, 0x7e, 0x7f, + 0xb1, 0x4a, 0x99, 0x16, 0xe4, 0x4a, 0x42, 0xc0, 0x52, 0xf5, 0x5a, 0x69, 0xf4, 0x74, 0x94, 0x1e, + 0x27, 0x3d, 0x4c, 0xd5, 0xa5, 0x2e, 0xd6, 0x64, 0xfc, 0x0a, 0x1e, 0xf6, 0x81, 0xde, 0x92, 0xcb, + 0x80, 0x56, 0x97, 0x68, 0x41, 0x56, 0xa8, 0xd3, 0x4f, 0xe7, 0xab, 0x49, 0xcf, 0x5e, 0xfe, 0x10, + 0xbd, 0x23, 0x37, 0x1e, 0x15, 0x9a, 0x06, 0x4f, 0xd6, 0x28, 0x59, 0xd7, 0x47, 0x7c, 0x14, 0x1f, + 0x97, 0x5f, 0x2d, 0xcb, 0x0f, 0x2d, 0xcb, 0x7f, 0x5a, 0x96, 0x7f, 0x76, 0x2c, 0x3b, 0x74, 0x2c, + 0xfb, 0xee, 0x58, 0xf6, 0x26, 0xb6, 0x26, 0xee, 0x3e, 0x24, 0x57, 0x6e, 0x2f, 0x8c, 0x37, 0xc1, + 0x62, 0x14, 0xca, 0x79, 0x9c, 0x07, 0xfd, 0x3e, 0xdf, 0xba, 0xb4, 0xd3, 0xf0, 0x52, 0x39, 0x4e, + 0x7b, 0x3c, 0xfc, 0x06, 0x00, 0x00, 0xff, 0xff, 0xc1, 0x1a, 0xca, 0x17, 0x42, 0x01, 0x00, 0x00, +} + +func (m *ClassTrace) 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 *ClassTrace) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ClassTrace) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.BaseClassId) > 0 { + i -= len(m.BaseClassId) + copy(dAtA[i:], m.BaseClassId) + i = encodeVarintTransfer(dAtA, i, uint64(len(m.BaseClassId))) + i-- + dAtA[i] = 0x12 + } + if len(m.Path) > 0 { + i -= len(m.Path) + copy(dAtA[i:], m.Path) + i = encodeVarintTransfer(dAtA, i, uint64(len(m.Path))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Params) 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 *Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ReceiveEnabled { + i-- + if m.ReceiveEnabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if m.SendEnabled { + i-- + if m.SendEnabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintTransfer(dAtA []byte, offset int, v uint64) int { + offset -= sovTransfer(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *ClassTrace) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Path) + if l > 0 { + n += 1 + l + sovTransfer(uint64(l)) + } + l = len(m.BaseClassId) + if l > 0 { + n += 1 + l + sovTransfer(uint64(l)) + } + return n +} + +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SendEnabled { + n += 2 + } + if m.ReceiveEnabled { + n += 2 + } + return n +} + +func sovTransfer(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTransfer(x uint64) (n int) { + return sovTransfer(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *ClassTrace) 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 ErrIntOverflowTransfer + } + 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: ClassTrace: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ClassTrace: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransfer + } + 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 ErrInvalidLengthTransfer + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTransfer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Path = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BaseClassId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransfer + } + 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 ErrInvalidLengthTransfer + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTransfer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BaseClassId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTransfer(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTransfer + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTransfer + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Params) 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 ErrIntOverflowTransfer + } + 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: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SendEnabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransfer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.SendEnabled = bool(v != 0) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ReceiveEnabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTransfer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.ReceiveEnabled = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipTransfer(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTransfer + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTransfer + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTransfer(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, ErrIntOverflowTransfer + } + 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, ErrIntOverflowTransfer + } + 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, ErrIntOverflowTransfer + } + 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, ErrInvalidLengthTransfer + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTransfer + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTransfer + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTransfer = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTransfer = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTransfer = fmt.Errorf("proto: unexpected end of group") +) diff --git a/ibc/nft_transfer/tx.pb.go b/ibc/nft_transfer/tx.pb.go new file mode 100644 index 0000000..2cadd27 --- /dev/null +++ b/ibc/nft_transfer/tx.pb.go @@ -0,0 +1,1339 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: ibc/applications/nft_transfer/v1/tx.proto + +package nft_transfer + +import ( + context "context" + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/proto" + types "github.com/irisnet/core-sdk-go/ibc/v5/modules/core/02-client/types" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + 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 + +// MsgTransfer defines a msg to transfer non fungible tokens between +// ICS721 enabled chains. See ICS Spec here: +// https://github.com/cosmos/ibc/tree/master/spec/app/ics-721-nft-transfer#data-structures +type MsgTransfer struct { + // the port on which the packet will be sent + SourcePort string `protobuf:"bytes,1,opt,name=source_port,json=sourcePort,proto3" json:"source_port,omitempty"` + // the channel by which the packet will be sent + SourceChannel string `protobuf:"bytes,2,opt,name=source_channel,json=sourceChannel,proto3" json:"source_channel,omitempty"` + // the class_id of tokens to be transferred + ClassId string `protobuf:"bytes,3,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"` + // the non fungible tokens to be transferred + TokenIds []string `protobuf:"bytes,4,rep,name=token_ids,json=tokenIds,proto3" json:"token_ids,omitempty"` + // the sender address + Sender string `protobuf:"bytes,5,opt,name=sender,proto3" json:"sender,omitempty"` + // the recipient address on the destination chain + Receiver string `protobuf:"bytes,6,opt,name=receiver,proto3" json:"receiver,omitempty"` + // Timeout height relative to the current block height. + // The timeout is disabled when set to 0. + TimeoutHeight types.Height `protobuf:"bytes,7,opt,name=timeout_height,json=timeoutHeight,proto3" json:"timeout_height"` + // Timeout timestamp in absolute nanoseconds since unix epoch. + // The timeout is disabled when set to 0. + TimeoutTimestamp uint64 `protobuf:"varint,8,opt,name=timeout_timestamp,json=timeoutTimestamp,proto3" json:"timeout_timestamp,omitempty"` + // optional memo + Memo string `protobuf:"bytes,9,opt,name=memo,proto3" json:"memo,omitempty"` +} + +func (m *MsgTransfer) Reset() { *m = MsgTransfer{} } +func (m *MsgTransfer) String() string { return proto.CompactTextString(m) } +func (*MsgTransfer) ProtoMessage() {} +func (*MsgTransfer) Descriptor() ([]byte, []int) { + return fileDescriptor_d1cb5d976a414ada, []int{0} +} +func (m *MsgTransfer) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgTransfer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgTransfer.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 *MsgTransfer) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgTransfer.Merge(m, src) +} +func (m *MsgTransfer) XXX_Size() int { + return m.Size() +} +func (m *MsgTransfer) XXX_DiscardUnknown() { + xxx_messageInfo_MsgTransfer.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgTransfer proto.InternalMessageInfo + +// MsgTransferResponse defines the Msg/Transfer response type. +type MsgTransferResponse struct { + // sequence number of the transfer packet sent + Sequence uint64 `protobuf:"varint,1,opt,name=sequence,proto3" json:"sequence,omitempty"` +} + +func (m *MsgTransferResponse) Reset() { *m = MsgTransferResponse{} } +func (m *MsgTransferResponse) String() string { return proto.CompactTextString(m) } +func (*MsgTransferResponse) ProtoMessage() {} +func (*MsgTransferResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_d1cb5d976a414ada, []int{1} +} +func (m *MsgTransferResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgTransferResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgTransferResponse.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 *MsgTransferResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgTransferResponse.Merge(m, src) +} +func (m *MsgTransferResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgTransferResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgTransferResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgTransferResponse proto.InternalMessageInfo + +func (m *MsgTransferResponse) GetSequence() uint64 { + if m != nil { + return m.Sequence + } + return 0 +} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +type MsgUpdateParams 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"` + // params defines the nft-transfer parameters to update. + // + // NOTE: All parameters must be supplied. + Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` +} + +func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } +func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParams) ProtoMessage() {} +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return fileDescriptor_d1cb5d976a414ada, []int{2} +} +func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParams.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 *MsgUpdateParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParams.Merge(m, src) +} +func (m *MsgUpdateParams) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParams) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo + +func (m *MsgUpdateParams) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgUpdateParams) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +type MsgUpdateParamsResponse struct { +} + +func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } +func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParamsResponse) ProtoMessage() {} +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_d1cb5d976a414ada, []int{3} +} +func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParamsResponse.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 *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) +} +func (m *MsgUpdateParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgTransfer)(nil), "ibc.applications.nft_transfer.v1.MsgTransfer") + proto.RegisterType((*MsgTransferResponse)(nil), "ibc.applications.nft_transfer.v1.MsgTransferResponse") + proto.RegisterType((*MsgUpdateParams)(nil), "ibc.applications.nft_transfer.v1.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "ibc.applications.nft_transfer.v1.MsgUpdateParamsResponse") +} + +func init() { + proto.RegisterFile("ibc/applications/nft_transfer/v1/tx.proto", fileDescriptor_d1cb5d976a414ada) +} + +var fileDescriptor_d1cb5d976a414ada = []byte{ + // 544 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x53, 0x41, 0x6f, 0xd3, 0x30, + 0x18, 0x4d, 0xb6, 0xd2, 0xa5, 0x2e, 0x1b, 0x60, 0x10, 0x64, 0x01, 0xa5, 0x55, 0x25, 0xa4, 0x22, + 0xd4, 0x44, 0x2d, 0xe2, 0x00, 0xc7, 0x21, 0x01, 0x3d, 0x54, 0x9a, 0xa2, 0x71, 0xe1, 0x52, 0xa5, + 0xce, 0xb7, 0xd4, 0x5a, 0x63, 0x07, 0xdb, 0x2d, 0x20, 0xf1, 0x03, 0x38, 0xf2, 0x13, 0xf6, 0x73, + 0x76, 0xdc, 0x05, 0x89, 0x13, 0x42, 0xed, 0x85, 0x3f, 0xc0, 0x1d, 0xc5, 0x71, 0x4b, 0xe0, 0x52, + 0x76, 0x8a, 0xbf, 0x97, 0xf7, 0xbe, 0x67, 0x3f, 0xfb, 0x43, 0x8f, 0xe8, 0x84, 0x84, 0x71, 0x9e, + 0xcf, 0x28, 0x89, 0x15, 0xe5, 0x4c, 0x86, 0xec, 0x54, 0x8d, 0x95, 0x88, 0x99, 0x3c, 0x05, 0x11, + 0x2e, 0xfa, 0xa1, 0xfa, 0x10, 0xe4, 0x82, 0x2b, 0x8e, 0xdb, 0x74, 0x42, 0x82, 0x2a, 0x35, 0xa8, + 0x52, 0x83, 0x45, 0xdf, 0xbb, 0x93, 0xf2, 0x94, 0x6b, 0x72, 0x58, 0xac, 0x4a, 0x9d, 0xd7, 0x2a, + 0x2c, 0x08, 0x17, 0x10, 0x92, 0x19, 0x05, 0xa6, 0x8a, 0xa6, 0xe5, 0xca, 0x10, 0xc2, 0xed, 0x7b, + 0x58, 0x9b, 0x68, 0x41, 0xe7, 0xeb, 0x0e, 0x6a, 0x8e, 0x64, 0x7a, 0x62, 0x50, 0xdc, 0x42, 0x4d, + 0xc9, 0xe7, 0x82, 0xc0, 0x38, 0xe7, 0x42, 0xb9, 0x76, 0xdb, 0xee, 0x36, 0x22, 0x54, 0x42, 0xc7, + 0x5c, 0x28, 0xfc, 0x10, 0x1d, 0x18, 0x02, 0x99, 0xc6, 0x8c, 0xc1, 0xcc, 0xdd, 0xd1, 0x9c, 0xfd, + 0x12, 0x7d, 0x51, 0x82, 0xf8, 0x10, 0x39, 0x64, 0x16, 0x4b, 0x39, 0xa6, 0x89, 0xbb, 0xab, 0x09, + 0x7b, 0xba, 0x1e, 0x26, 0xf8, 0x3e, 0x6a, 0x28, 0x7e, 0x06, 0x6c, 0x4c, 0x13, 0xe9, 0xd6, 0xda, + 0xbb, 0xdd, 0x46, 0xe4, 0x68, 0x60, 0x98, 0x48, 0x7c, 0x17, 0xd5, 0x25, 0xb0, 0x04, 0x84, 0x7b, + 0x4d, 0xab, 0x4c, 0x85, 0x3d, 0xe4, 0x08, 0x20, 0x40, 0x17, 0x20, 0xdc, 0xba, 0xfe, 0xb3, 0xa9, + 0xf1, 0x2b, 0x74, 0xa0, 0x68, 0x06, 0x7c, 0xae, 0xc6, 0x53, 0xa0, 0xe9, 0x54, 0xb9, 0x7b, 0x6d, + 0xbb, 0xdb, 0x1c, 0x78, 0x41, 0x11, 0x73, 0x11, 0x57, 0x60, 0x42, 0x5a, 0xf4, 0x83, 0xd7, 0x9a, + 0x71, 0x54, 0xbb, 0xf8, 0xde, 0xb2, 0xa2, 0x7d, 0xa3, 0x2b, 0x41, 0xfc, 0x18, 0xdd, 0x5a, 0x37, + 0x2a, 0xbe, 0x52, 0xc5, 0x59, 0xee, 0x3a, 0x6d, 0xbb, 0x5b, 0x8b, 0x6e, 0x9a, 0x1f, 0x27, 0x6b, + 0x1c, 0x63, 0x54, 0xcb, 0x20, 0xe3, 0x6e, 0x43, 0xef, 0x46, 0xaf, 0x9f, 0x3b, 0x9f, 0xcf, 0x5b, + 0xd6, 0xcf, 0xf3, 0x96, 0xd5, 0xe9, 0xa3, 0xdb, 0x95, 0x58, 0x23, 0x90, 0x39, 0x67, 0x12, 0x8a, + 0x63, 0x48, 0x78, 0x37, 0x07, 0x46, 0x40, 0x67, 0x5b, 0x8b, 0x36, 0x75, 0xe7, 0x3d, 0xba, 0x31, + 0x92, 0xe9, 0x9b, 0x3c, 0x89, 0x15, 0x1c, 0xc7, 0x22, 0xce, 0x24, 0x7e, 0x80, 0x1a, 0xf1, 0x5c, + 0x4d, 0xb9, 0xa0, 0xea, 0xa3, 0xb9, 0x8b, 0x3f, 0x00, 0x7e, 0x89, 0xea, 0xb9, 0xe6, 0xe9, 0x2b, + 0x68, 0x0e, 0xba, 0xc1, 0xb6, 0x67, 0x15, 0x94, 0x7d, 0xcd, 0xe9, 0x8d, 0xba, 0x73, 0x88, 0xee, + 0xfd, 0x63, 0xbc, 0xde, 0xef, 0xe0, 0x97, 0x8d, 0x76, 0x47, 0x32, 0xc5, 0x39, 0x72, 0x36, 0x4f, + 0xa4, 0xb7, 0xdd, 0xa6, 0x72, 0x74, 0xef, 0xe9, 0x95, 0xe8, 0x9b, 0xa4, 0x3e, 0xa1, 0xeb, 0x7f, + 0x45, 0xd1, 0xff, 0xaf, 0x36, 0x55, 0x89, 0xf7, 0xec, 0xca, 0x92, 0xb5, 0xfb, 0xd1, 0xf0, 0x62, + 0xe9, 0xdb, 0x97, 0x4b, 0xdf, 0xfe, 0xb1, 0xf4, 0xed, 0x2f, 0x2b, 0xdf, 0xba, 0x5c, 0xf9, 0xd6, + 0xb7, 0x95, 0x6f, 0xbd, 0x0d, 0x53, 0xaa, 0xa6, 0xf3, 0x49, 0x40, 0x78, 0x16, 0x52, 0x41, 0x25, + 0x03, 0xa5, 0x27, 0xb2, 0x27, 0x93, 0xb3, 0x5e, 0xca, 0xf5, 0x00, 0x56, 0x5d, 0x26, 0x75, 0x3d, + 0x68, 0x4f, 0x7e, 0x07, 0x00, 0x00, 0xff, 0xff, 0x59, 0x17, 0xb9, 0x8b, 0x1f, 0x04, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // Transfer defines a rpc handler method for MsgTransfer. + Transfer(ctx context.Context, in *MsgTransfer, opts ...grpc.CallOption) (*MsgTransferResponse, error) + // UpdateParams defines a governance operation for updating the nft-transfer module parameters. + // The authority is defined in the keeper. + // + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) Transfer(ctx context.Context, in *MsgTransfer, opts ...grpc.CallOption) (*MsgTransferResponse, error) { + out := new(MsgTransferResponse) + err := c.cc.Invoke(ctx, "/ibc.applications.nft_transfer.v1.Msg/Transfer", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, "/ibc.applications.nft_transfer.v1.Msg/UpdateParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // Transfer defines a rpc handler method for MsgTransfer. + Transfer(context.Context, *MsgTransfer) (*MsgTransferResponse, error) + // UpdateParams defines a governance operation for updating the nft-transfer module parameters. + // The authority is defined in the keeper. + // + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) Transfer(ctx context.Context, req *MsgTransfer) (*MsgTransferResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Transfer not implemented") +} +func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_Transfer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgTransfer) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Transfer(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.applications.nft_transfer.v1.Msg/Transfer", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Transfer(ctx, req.(*MsgTransfer)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.applications.nft_transfer.v1.Msg/UpdateParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "ibc.applications.nft_transfer.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Transfer", + Handler: _Msg_Transfer_Handler, + }, + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "ibc/applications/nft_transfer/v1/tx.proto", +} + +func (m *MsgTransfer) 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 *MsgTransfer) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgTransfer) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Memo) > 0 { + i -= len(m.Memo) + copy(dAtA[i:], m.Memo) + i = encodeVarintTx(dAtA, i, uint64(len(m.Memo))) + i-- + dAtA[i] = 0x4a + } + if m.TimeoutTimestamp != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.TimeoutTimestamp)) + i-- + dAtA[i] = 0x40 + } + { + size, err := m.TimeoutHeight.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + if len(m.Receiver) > 0 { + i -= len(m.Receiver) + copy(dAtA[i:], m.Receiver) + i = encodeVarintTx(dAtA, i, uint64(len(m.Receiver))) + i-- + dAtA[i] = 0x32 + } + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0x2a + } + if len(m.TokenIds) > 0 { + for iNdEx := len(m.TokenIds) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.TokenIds[iNdEx]) + copy(dAtA[i:], m.TokenIds[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.TokenIds[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if len(m.ClassId) > 0 { + i -= len(m.ClassId) + copy(dAtA[i:], m.ClassId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ClassId))) + i-- + dAtA[i] = 0x1a + } + if len(m.SourceChannel) > 0 { + i -= len(m.SourceChannel) + copy(dAtA[i:], m.SourceChannel) + i = encodeVarintTx(dAtA, i, uint64(len(m.SourceChannel))) + i-- + dAtA[i] = 0x12 + } + if len(m.SourcePort) > 0 { + i -= len(m.SourcePort) + copy(dAtA[i:], m.SourcePort) + i = encodeVarintTx(dAtA, i, uint64(len(m.SourcePort))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgTransferResponse) 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 *MsgTransferResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgTransferResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Sequence != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Sequence)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParams) 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 *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParamsResponse) 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 *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgTransfer) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.SourcePort) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.SourceChannel) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ClassId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.TokenIds) > 0 { + for _, s := range m.TokenIds { + l = len(s) + n += 1 + l + sovTx(uint64(l)) + } + } + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Receiver) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.TimeoutHeight.Size() + n += 1 + l + sovTx(uint64(l)) + if m.TimeoutTimestamp != 0 { + n += 1 + sovTx(uint64(m.TimeoutTimestamp)) + } + l = len(m.Memo) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgTransferResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Sequence != 0 { + n += 1 + sovTx(uint64(m.Sequence)) + } + return n +} + +func (m *MsgUpdateParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgUpdateParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgTransfer) 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 ErrIntOverflowTx + } + 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: MsgTransfer: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgTransfer: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SourcePort", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SourcePort = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SourceChannel", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SourceChannel = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClassId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClassId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TokenIds", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TokenIds = append(m.TokenIds, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Receiver", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Receiver = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeoutHeight", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.TimeoutHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeoutTimestamp", wireType) + } + m.TimeoutTimestamp = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TimeoutTimestamp |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Memo", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Memo = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgTransferResponse) 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 ErrIntOverflowTx + } + 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: MsgTransferResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgTransferResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Sequence", wireType) + } + m.Sequence = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Sequence |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParams) 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 ErrIntOverflowTx + } + 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: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParamsResponse) 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 ErrIntOverflowTx + } + 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: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(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, ErrIntOverflowTx + } + 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, ErrIntOverflowTx + } + 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, ErrIntOverflowTx + } + 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, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) diff --git a/ibc/nft_transfer/types.go b/ibc/nft_transfer/types.go new file mode 100644 index 0000000..18b2209 --- /dev/null +++ b/ibc/nft_transfer/types.go @@ -0,0 +1,36 @@ +package nft_transfer + +import ( + sdk "github.com/irisnet/core-sdk-go/types" +) + +var ( + _ sdk.Msg = &MsgTransfer{} +) + +func (msg MsgTransfer) Route() string { + return ModuleName +} + +func (msg MsgTransfer) Type() string { + return "create_pool" +} + +func (msg MsgTransfer) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.Sender); err != nil { + return sdk.Wrapf("invalid creator") + } + return nil +} + +func (msg MsgTransfer) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&msg)) +} + +func (msg MsgTransfer) GetSigners() []sdk.AccAddress { + creator, err := sdk.AccAddressFromBech32(msg.Sender) + if err != nil { + panic(err) + } + return []sdk.AccAddress{creator} +} diff --git a/ibc/transfer/query.pb.go b/ibc/transfer/query.pb.go index 6c43193..5f4888c 100644 --- a/ibc/transfer/query.pb.go +++ b/ibc/transfer/query.pb.go @@ -1084,7 +1084,10 @@ func (m *QueryDenomTraceRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -1170,7 +1173,10 @@ func (m *QueryDenomTraceResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -1256,7 +1262,10 @@ func (m *QueryDenomTracesRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -1376,7 +1385,10 @@ func (m *QueryDenomTracesResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -1426,7 +1438,10 @@ func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -1512,7 +1527,10 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -1626,7 +1644,10 @@ func (m *DenomTrace) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -1716,7 +1737,10 @@ func (m *Params) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { diff --git a/ibc/transfer/tx.pb.go b/ibc/transfer/tx.pb.go index 080eb81..904da04 100644 --- a/ibc/transfer/tx.pb.go +++ b/ibc/transfer/tx.pb.go @@ -750,7 +750,10 @@ func (m *MsgTransfer) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthTx } if (iNdEx + skippy) > l { @@ -800,7 +803,10 @@ func (m *MsgTransferResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthTx } if (iNdEx + skippy) > l { @@ -888,7 +894,10 @@ func (m *Height) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthTx } if (iNdEx + skippy) > l { diff --git a/ibc/v5/modules/core/02-client/types/client.pb.go b/ibc/v5/modules/core/02-client/types/client.pb.go new file mode 100644 index 0000000..8b5d2f7 --- /dev/null +++ b/ibc/v5/modules/core/02-client/types/client.pb.go @@ -0,0 +1,1926 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: ibc/core/client/v1/client.proto + +package types + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + types "github.com/irisnet/core-sdk-go/common/codec/types" + upgrade "github.com/irisnet/core-sdk-go/types/upgrade" + _ "github.com/regen-network/cosmos-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 + +// IdentifiedClientState defines a client state with an additional client +// identifier field. +type IdentifiedClientState struct { + // client identifier + ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" yaml:"client_id"` + // client state + ClientState *types.Any `protobuf:"bytes,2,opt,name=client_state,json=clientState,proto3" json:"client_state,omitempty" yaml:"client_state"` +} + +func (m *IdentifiedClientState) Reset() { *m = IdentifiedClientState{} } +func (m *IdentifiedClientState) String() string { return proto.CompactTextString(m) } +func (*IdentifiedClientState) ProtoMessage() {} +func (*IdentifiedClientState) Descriptor() ([]byte, []int) { + return fileDescriptor_b6bc4c8185546947, []int{0} +} +func (m *IdentifiedClientState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *IdentifiedClientState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_IdentifiedClientState.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 *IdentifiedClientState) XXX_Merge(src proto.Message) { + xxx_messageInfo_IdentifiedClientState.Merge(m, src) +} +func (m *IdentifiedClientState) XXX_Size() int { + return m.Size() +} +func (m *IdentifiedClientState) XXX_DiscardUnknown() { + xxx_messageInfo_IdentifiedClientState.DiscardUnknown(m) +} + +var xxx_messageInfo_IdentifiedClientState proto.InternalMessageInfo + +func (m *IdentifiedClientState) GetClientId() string { + if m != nil { + return m.ClientId + } + return "" +} + +func (m *IdentifiedClientState) GetClientState() *types.Any { + if m != nil { + return m.ClientState + } + return nil +} + +// ConsensusStateWithHeight defines a consensus state with an additional height +// field. +type ConsensusStateWithHeight struct { + // consensus state height + Height Height `protobuf:"bytes,1,opt,name=height,proto3" json:"height"` + // consensus state + ConsensusState *types.Any `protobuf:"bytes,2,opt,name=consensus_state,json=consensusState,proto3" json:"consensus_state,omitempty" yaml:"consensus_state"` +} + +func (m *ConsensusStateWithHeight) Reset() { *m = ConsensusStateWithHeight{} } +func (m *ConsensusStateWithHeight) String() string { return proto.CompactTextString(m) } +func (*ConsensusStateWithHeight) ProtoMessage() {} +func (*ConsensusStateWithHeight) Descriptor() ([]byte, []int) { + return fileDescriptor_b6bc4c8185546947, []int{1} +} +func (m *ConsensusStateWithHeight) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ConsensusStateWithHeight) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ConsensusStateWithHeight.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 *ConsensusStateWithHeight) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConsensusStateWithHeight.Merge(m, src) +} +func (m *ConsensusStateWithHeight) XXX_Size() int { + return m.Size() +} +func (m *ConsensusStateWithHeight) XXX_DiscardUnknown() { + xxx_messageInfo_ConsensusStateWithHeight.DiscardUnknown(m) +} + +var xxx_messageInfo_ConsensusStateWithHeight proto.InternalMessageInfo + +func (m *ConsensusStateWithHeight) GetHeight() Height { + if m != nil { + return m.Height + } + return Height{} +} + +func (m *ConsensusStateWithHeight) GetConsensusState() *types.Any { + if m != nil { + return m.ConsensusState + } + return nil +} + +// ClientConsensusStates defines all the stored consensus states for a given +// client. +type ClientConsensusStates struct { + // client identifier + ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" yaml:"client_id"` + // consensus states and their heights associated with the client + ConsensusStates []ConsensusStateWithHeight `protobuf:"bytes,2,rep,name=consensus_states,json=consensusStates,proto3" json:"consensus_states" yaml:"consensus_states"` +} + +func (m *ClientConsensusStates) Reset() { *m = ClientConsensusStates{} } +func (m *ClientConsensusStates) String() string { return proto.CompactTextString(m) } +func (*ClientConsensusStates) ProtoMessage() {} +func (*ClientConsensusStates) Descriptor() ([]byte, []int) { + return fileDescriptor_b6bc4c8185546947, []int{2} +} +func (m *ClientConsensusStates) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ClientConsensusStates) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ClientConsensusStates.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 *ClientConsensusStates) XXX_Merge(src proto.Message) { + xxx_messageInfo_ClientConsensusStates.Merge(m, src) +} +func (m *ClientConsensusStates) XXX_Size() int { + return m.Size() +} +func (m *ClientConsensusStates) XXX_DiscardUnknown() { + xxx_messageInfo_ClientConsensusStates.DiscardUnknown(m) +} + +var xxx_messageInfo_ClientConsensusStates proto.InternalMessageInfo + +func (m *ClientConsensusStates) GetClientId() string { + if m != nil { + return m.ClientId + } + return "" +} + +func (m *ClientConsensusStates) GetConsensusStates() []ConsensusStateWithHeight { + if m != nil { + return m.ConsensusStates + } + return nil +} + +// ClientUpdateProposal is a governance proposal. If it passes, the substitute +// client's latest consensus state is copied over to the subject client. The proposal +// handler may fail if the subject and the substitute do not match in client and +// chain parameters (with exception to latest height, frozen height, and chain-id). +type ClientUpdateProposal struct { + // the title of the update proposal + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + // the description of the proposal + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + // the client identifier for the client to be updated if the proposal passes + SubjectClientId string `protobuf:"bytes,3,opt,name=subject_client_id,json=subjectClientId,proto3" json:"subject_client_id,omitempty" yaml:"subject_client_id"` + // the substitute client identifier for the client standing in for the subject + // client + SubstituteClientId string `protobuf:"bytes,4,opt,name=substitute_client_id,json=substituteClientId,proto3" json:"substitute_client_id,omitempty" yaml:"substitute_client_id"` +} + +func (m *ClientUpdateProposal) Reset() { *m = ClientUpdateProposal{} } +func (m *ClientUpdateProposal) String() string { return proto.CompactTextString(m) } +func (*ClientUpdateProposal) ProtoMessage() {} +func (*ClientUpdateProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_b6bc4c8185546947, []int{3} +} +func (m *ClientUpdateProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ClientUpdateProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ClientUpdateProposal.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 *ClientUpdateProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_ClientUpdateProposal.Merge(m, src) +} +func (m *ClientUpdateProposal) XXX_Size() int { + return m.Size() +} +func (m *ClientUpdateProposal) XXX_DiscardUnknown() { + xxx_messageInfo_ClientUpdateProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_ClientUpdateProposal proto.InternalMessageInfo + +// UpgradeProposal is a gov Content type for initiating an IBC breaking +// upgrade. +type UpgradeProposal struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + Plan upgrade.Plan `protobuf:"bytes,3,opt,name=plan,proto3" json:"plan"` + // An UpgradedClientState must be provided to perform an IBC breaking upgrade. + // This will make the chain commit to the correct upgraded (self) client state + // before the upgrade occurs, so that connecting chains can verify that the + // new upgraded client is valid by verifying a proof on the previous version + // of the chain. This will allow IBC connections to persist smoothly across + // planned chain upgrades + UpgradedClientState *types.Any `protobuf:"bytes,4,opt,name=upgraded_client_state,json=upgradedClientState,proto3" json:"upgraded_client_state,omitempty" yaml:"upgraded_client_state"` +} + +func (m *UpgradeProposal) Reset() { *m = UpgradeProposal{} } +func (m *UpgradeProposal) String() string { return proto.CompactTextString(m) } +func (*UpgradeProposal) ProtoMessage() {} +func (*UpgradeProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_b6bc4c8185546947, []int{4} +} +func (m *UpgradeProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *UpgradeProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UpgradeProposal.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 *UpgradeProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_UpgradeProposal.Merge(m, src) +} +func (m *UpgradeProposal) XXX_Size() int { + return m.Size() +} +func (m *UpgradeProposal) XXX_DiscardUnknown() { + xxx_messageInfo_UpgradeProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_UpgradeProposal proto.InternalMessageInfo + +// Height is a monotonically increasing data type +// that can be compared against another Height for the purposes of updating and +// freezing clients +// +// Normally the RevisionHeight is incremented at each height while keeping +// RevisionNumber the same. However some consensus algorithms may choose to +// reset the height in certain conditions e.g. hard forks, state-machine +// breaking changes In these cases, the RevisionNumber is incremented so that +// height continues to be monitonically increasing even as the RevisionHeight +// gets reset +type Height struct { + // the revision that the client is currently on + RevisionNumber uint64 `protobuf:"varint,1,opt,name=revision_number,json=revisionNumber,proto3" json:"revision_number,omitempty" yaml:"revision_number"` + // the height within the given revision + RevisionHeight uint64 `protobuf:"varint,2,opt,name=revision_height,json=revisionHeight,proto3" json:"revision_height,omitempty" yaml:"revision_height"` +} + +func (m *Height) Reset() { *m = Height{} } +func (m *Height) String() string { return proto.CompactTextString(m) } +func (*Height) ProtoMessage() {} +func (*Height) Descriptor() ([]byte, []int) { + return fileDescriptor_b6bc4c8185546947, []int{5} +} +func (m *Height) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Height) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Height.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 *Height) XXX_Merge(src proto.Message) { + xxx_messageInfo_Height.Merge(m, src) +} +func (m *Height) XXX_Size() int { + return m.Size() +} +func (m *Height) XXX_DiscardUnknown() { + xxx_messageInfo_Height.DiscardUnknown(m) +} + +var xxx_messageInfo_Height proto.InternalMessageInfo + +// Params defines the set of IBC light client parameters. +type Params struct { + // allowed_clients defines the list of allowed client state types. + AllowedClients []string `protobuf:"bytes,1,rep,name=allowed_clients,json=allowedClients,proto3" json:"allowed_clients,omitempty" yaml:"allowed_clients"` +} + +func (m *Params) Reset() { *m = Params{} } +func (m *Params) String() string { return proto.CompactTextString(m) } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_b6bc4c8185546947, []int{6} +} +func (m *Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Params.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 *Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_Params.Merge(m, src) +} +func (m *Params) XXX_Size() int { + return m.Size() +} +func (m *Params) XXX_DiscardUnknown() { + xxx_messageInfo_Params.DiscardUnknown(m) +} + +var xxx_messageInfo_Params proto.InternalMessageInfo + +func (m *Params) GetAllowedClients() []string { + if m != nil { + return m.AllowedClients + } + return nil +} + +func init() { + proto.RegisterType((*IdentifiedClientState)(nil), "ibc.core.client.v1.IdentifiedClientState") + proto.RegisterType((*ConsensusStateWithHeight)(nil), "ibc.core.client.v1.ConsensusStateWithHeight") + proto.RegisterType((*ClientConsensusStates)(nil), "ibc.core.client.v1.ClientConsensusStates") + proto.RegisterType((*ClientUpdateProposal)(nil), "ibc.core.client.v1.ClientUpdateProposal") + proto.RegisterType((*UpgradeProposal)(nil), "ibc.core.client.v1.UpgradeProposal") + proto.RegisterType((*Height)(nil), "ibc.core.client.v1.Height") + proto.RegisterType((*Params)(nil), "ibc.core.client.v1.Params") +} + +func init() { proto.RegisterFile("ibc/core/client/v1/client.proto", fileDescriptor_b6bc4c8185546947) } + +var fileDescriptor_b6bc4c8185546947 = []byte{ + // 737 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0x3f, 0x6f, 0xd3, 0x40, + 0x1c, 0x8d, 0xd3, 0x10, 0x91, 0x0b, 0x6a, 0x8a, 0x9b, 0xd2, 0x10, 0xaa, 0x38, 0x3a, 0x21, 0x94, + 0x81, 0xd8, 0x24, 0x08, 0x84, 0xb2, 0x91, 0x2c, 0xed, 0x00, 0x0a, 0x46, 0x15, 0x02, 0x21, 0x45, + 0xfe, 0x73, 0x75, 0xae, 0x38, 0xbe, 0xc8, 0x77, 0x0e, 0xe4, 0x1b, 0xb0, 0xc1, 0x82, 0xc4, 0xc0, + 0xd0, 0x6f, 0xc0, 0xc2, 0x47, 0x60, 0xe8, 0x58, 0x31, 0x31, 0x59, 0xa8, 0x5d, 0x98, 0xf3, 0x09, + 0x90, 0xef, 0xce, 0x6d, 0xd2, 0x3f, 0x80, 0x60, 0xbb, 0x7b, 0xbf, 0x77, 0xef, 0xde, 0xef, 0xc5, + 0xbf, 0x1c, 0xd0, 0xb0, 0xed, 0x18, 0x0e, 0x09, 0x91, 0xe1, 0xf8, 0x18, 0x05, 0xcc, 0x98, 0xb4, + 0xe4, 0x4a, 0x1f, 0x87, 0x84, 0x11, 0x55, 0xc5, 0xb6, 0xa3, 0x27, 0x04, 0x5d, 0xc2, 0x93, 0x56, + 0xb5, 0xec, 0x11, 0x8f, 0xf0, 0xb2, 0x91, 0xac, 0x04, 0xb3, 0x7a, 0xdd, 0x23, 0xc4, 0xf3, 0x91, + 0xc1, 0x77, 0x76, 0xb4, 0x63, 0x58, 0xc1, 0x54, 0x96, 0x6e, 0x3a, 0x84, 0x8e, 0x08, 0x35, 0xa2, + 0xb1, 0x17, 0x5a, 0x2e, 0x32, 0x26, 0x2d, 0x1b, 0x31, 0xab, 0x95, 0xee, 0x53, 0x01, 0xc1, 0x1a, + 0x08, 0x65, 0xb1, 0x11, 0x25, 0xf8, 0x49, 0x01, 0x6b, 0x5b, 0x2e, 0x0a, 0x18, 0xde, 0xc1, 0xc8, + 0xed, 0x71, 0x27, 0x4f, 0x99, 0xc5, 0x90, 0xda, 0x02, 0x05, 0x61, 0x6c, 0x80, 0xdd, 0x8a, 0x52, + 0x57, 0x1a, 0x85, 0x6e, 0x79, 0x16, 0x6b, 0x2b, 0x53, 0x6b, 0xe4, 0x77, 0xe0, 0x71, 0x09, 0x9a, + 0x97, 0xc5, 0x7a, 0xcb, 0x55, 0xfb, 0xe0, 0x8a, 0xc4, 0x69, 0x22, 0x51, 0xc9, 0xd6, 0x95, 0x46, + 0xb1, 0x5d, 0xd6, 0x85, 0x7f, 0x3d, 0xf5, 0xaf, 0x3f, 0x0c, 0xa6, 0xdd, 0xf5, 0x59, 0xac, 0xad, + 0x2e, 0x68, 0xf1, 0x33, 0xd0, 0x2c, 0x3a, 0x27, 0x26, 0xe0, 0x67, 0x05, 0x54, 0x7a, 0x24, 0xa0, + 0x28, 0xa0, 0x11, 0xe5, 0xd0, 0x33, 0xcc, 0x86, 0x9b, 0x08, 0x7b, 0x43, 0xa6, 0x3e, 0x00, 0xf9, + 0x21, 0x5f, 0x71, 0x7b, 0xc5, 0x76, 0x55, 0x3f, 0x1b, 0xa9, 0x2e, 0xb8, 0xdd, 0xdc, 0x7e, 0xac, + 0x65, 0x4c, 0xc9, 0x57, 0x9f, 0x83, 0x92, 0x93, 0xaa, 0xfe, 0x85, 0xd7, 0xea, 0x2c, 0xd6, 0xae, + 0x49, 0xaf, 0x8b, 0xc7, 0xa0, 0xb9, 0xec, 0x2c, 0xd8, 0x83, 0x5f, 0x15, 0xb0, 0x26, 0x62, 0x5c, + 0xf4, 0x4d, 0xff, 0x25, 0xd0, 0x37, 0x60, 0xe5, 0xd4, 0x85, 0xb4, 0x92, 0xad, 0x2f, 0x35, 0x8a, + 0xed, 0xdb, 0xe7, 0xf5, 0x7a, 0x51, 0x52, 0x5d, 0x2d, 0xe9, 0x7e, 0x16, 0x6b, 0xeb, 0xe7, 0x36, + 0x41, 0xa1, 0x59, 0x5a, 0xec, 0x82, 0xc2, 0x77, 0x59, 0x50, 0x16, 0x6d, 0x6c, 0x8f, 0x5d, 0x8b, + 0xa1, 0x7e, 0x48, 0xc6, 0x84, 0x5a, 0xbe, 0x5a, 0x06, 0x97, 0x18, 0x66, 0x3e, 0x12, 0x1d, 0x98, + 0x62, 0xa3, 0xd6, 0x41, 0xd1, 0x45, 0xd4, 0x09, 0xf1, 0x98, 0x61, 0x12, 0xf0, 0x30, 0x0b, 0xe6, + 0x3c, 0xa4, 0x6e, 0x82, 0xab, 0x34, 0xb2, 0x77, 0x91, 0xc3, 0x06, 0x27, 0x29, 0x2c, 0xf1, 0x14, + 0x36, 0x66, 0xb1, 0x56, 0x11, 0xce, 0xce, 0x50, 0xa0, 0x59, 0x92, 0x58, 0x2f, 0x0d, 0xe5, 0x09, + 0x28, 0xd3, 0xc8, 0xa6, 0x0c, 0xb3, 0x88, 0xa1, 0x39, 0xb1, 0x1c, 0x17, 0xd3, 0x66, 0xb1, 0x76, + 0xe3, 0x58, 0xec, 0x0c, 0x0b, 0x9a, 0xea, 0x09, 0x9c, 0x4a, 0x76, 0xe0, 0xdb, 0x3d, 0x2d, 0xf3, + 0xed, 0x4b, 0xb3, 0x2a, 0x67, 0xc3, 0x23, 0x13, 0x5d, 0x8e, 0x52, 0x12, 0x2a, 0x43, 0x01, 0x83, + 0x1f, 0xb2, 0xa0, 0xb4, 0x2d, 0xc6, 0xea, 0xbf, 0xc3, 0xb8, 0x0f, 0x72, 0x63, 0xdf, 0x0a, 0x78, + 0xff, 0xc5, 0xf6, 0x86, 0x2e, 0xaf, 0x4d, 0xa7, 0x36, 0xbd, 0xba, 0xef, 0x5b, 0x81, 0xfc, 0x72, + 0x39, 0x5f, 0xdd, 0x05, 0x6b, 0x92, 0xe3, 0x0e, 0x16, 0x26, 0x2d, 0xf7, 0x9b, 0xaf, 0xb7, 0x3e, + 0x8b, 0xb5, 0x0d, 0x91, 0xc8, 0xb9, 0x87, 0xa1, 0xb9, 0x9a, 0xe2, 0x73, 0xf3, 0xdf, 0xb9, 0x95, + 0x64, 0xf2, 0x73, 0x4f, 0x53, 0xfe, 0x90, 0xcb, 0x47, 0x05, 0xe4, 0xe5, 0x40, 0xf6, 0x40, 0x29, + 0x44, 0x13, 0x4c, 0x31, 0x09, 0x06, 0x41, 0x34, 0xb2, 0x51, 0xc8, 0x83, 0xc9, 0xcd, 0x0f, 0xd0, + 0x29, 0x02, 0x34, 0x97, 0x53, 0xe4, 0x31, 0x07, 0x16, 0x44, 0xe4, 0x78, 0x67, 0x2f, 0x14, 0x11, + 0x84, 0x39, 0x11, 0xe1, 0xa4, 0x93, 0x4b, 0xcc, 0xc3, 0x47, 0x20, 0xdf, 0xb7, 0x42, 0x6b, 0x44, + 0x13, 0x51, 0xcb, 0xf7, 0xc9, 0xeb, 0xe3, 0xd6, 0x69, 0x45, 0xa9, 0x2f, 0x35, 0x0a, 0xf3, 0xa2, + 0xa7, 0x08, 0xd0, 0x5c, 0x96, 0x88, 0x48, 0x85, 0x76, 0x5f, 0xee, 0x1f, 0xd6, 0x94, 0x83, 0xc3, + 0x9a, 0xf2, 0xe3, 0xb0, 0xa6, 0xbc, 0x3f, 0xaa, 0x65, 0x0e, 0x8e, 0x6a, 0x99, 0xef, 0x47, 0xb5, + 0xcc, 0x8b, 0xae, 0x87, 0xd9, 0x30, 0xb2, 0x75, 0x87, 0x8c, 0x0c, 0x1c, 0x62, 0x1a, 0x20, 0xc6, + 0xff, 0xfb, 0x9b, 0xd4, 0x7d, 0xd5, 0xf4, 0x88, 0x91, 0xbc, 0x05, 0x93, 0x7b, 0xc6, 0x88, 0xb8, + 0x91, 0x8f, 0xa8, 0x78, 0x16, 0xee, 0xb4, 0x9b, 0xf2, 0x65, 0x60, 0xd3, 0x31, 0xa2, 0x76, 0x9e, + 0xff, 0x68, 0x77, 0x7f, 0x05, 0x00, 0x00, 0xff, 0xff, 0xd6, 0x55, 0x66, 0x6e, 0x39, 0x06, 0x00, + 0x00, +} + +func (this *UpgradeProposal) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*UpgradeProposal) + if !ok { + that2, ok := that.(UpgradeProposal) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Title != that1.Title { + return false + } + if this.Description != that1.Description { + return false + } + if !this.Plan.Equal(&that1.Plan) { + return false + } + if !this.UpgradedClientState.Equal(that1.UpgradedClientState) { + return false + } + return true +} +func (m *IdentifiedClientState) 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 *IdentifiedClientState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IdentifiedClientState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ClientState != nil { + { + size, err := m.ClientState.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintClient(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.ClientId) > 0 { + i -= len(m.ClientId) + copy(dAtA[i:], m.ClientId) + i = encodeVarintClient(dAtA, i, uint64(len(m.ClientId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ConsensusStateWithHeight) 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 *ConsensusStateWithHeight) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConsensusStateWithHeight) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ConsensusState != nil { + { + size, err := m.ConsensusState.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintClient(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + { + size, err := m.Height.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintClient(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *ClientConsensusStates) 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 *ClientConsensusStates) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ClientConsensusStates) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ConsensusStates) > 0 { + for iNdEx := len(m.ConsensusStates) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ConsensusStates[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintClient(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.ClientId) > 0 { + i -= len(m.ClientId) + copy(dAtA[i:], m.ClientId) + i = encodeVarintClient(dAtA, i, uint64(len(m.ClientId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ClientUpdateProposal) 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 *ClientUpdateProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ClientUpdateProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.SubstituteClientId) > 0 { + i -= len(m.SubstituteClientId) + copy(dAtA[i:], m.SubstituteClientId) + i = encodeVarintClient(dAtA, i, uint64(len(m.SubstituteClientId))) + i-- + dAtA[i] = 0x22 + } + if len(m.SubjectClientId) > 0 { + i -= len(m.SubjectClientId) + copy(dAtA[i:], m.SubjectClientId) + i = encodeVarintClient(dAtA, i, uint64(len(m.SubjectClientId))) + i-- + dAtA[i] = 0x1a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintClient(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintClient(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *UpgradeProposal) 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 *UpgradeProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpgradeProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.UpgradedClientState != nil { + { + size, err := m.UpgradedClientState.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintClient(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + { + size, err := m.Plan.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintClient(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintClient(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintClient(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Height) 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 *Height) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Height) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.RevisionHeight != 0 { + i = encodeVarintClient(dAtA, i, uint64(m.RevisionHeight)) + i-- + dAtA[i] = 0x10 + } + if m.RevisionNumber != 0 { + i = encodeVarintClient(dAtA, i, uint64(m.RevisionNumber)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Params) 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 *Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.AllowedClients) > 0 { + for iNdEx := len(m.AllowedClients) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.AllowedClients[iNdEx]) + copy(dAtA[i:], m.AllowedClients[iNdEx]) + i = encodeVarintClient(dAtA, i, uint64(len(m.AllowedClients[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintClient(dAtA []byte, offset int, v uint64) int { + offset -= sovClient(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *IdentifiedClientState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ClientId) + if l > 0 { + n += 1 + l + sovClient(uint64(l)) + } + if m.ClientState != nil { + l = m.ClientState.Size() + n += 1 + l + sovClient(uint64(l)) + } + return n +} + +func (m *ConsensusStateWithHeight) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Height.Size() + n += 1 + l + sovClient(uint64(l)) + if m.ConsensusState != nil { + l = m.ConsensusState.Size() + n += 1 + l + sovClient(uint64(l)) + } + return n +} + +func (m *ClientConsensusStates) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ClientId) + if l > 0 { + n += 1 + l + sovClient(uint64(l)) + } + if len(m.ConsensusStates) > 0 { + for _, e := range m.ConsensusStates { + l = e.Size() + n += 1 + l + sovClient(uint64(l)) + } + } + return n +} + +func (m *ClientUpdateProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovClient(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovClient(uint64(l)) + } + l = len(m.SubjectClientId) + if l > 0 { + n += 1 + l + sovClient(uint64(l)) + } + l = len(m.SubstituteClientId) + if l > 0 { + n += 1 + l + sovClient(uint64(l)) + } + return n +} + +func (m *UpgradeProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovClient(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovClient(uint64(l)) + } + l = m.Plan.Size() + n += 1 + l + sovClient(uint64(l)) + if m.UpgradedClientState != nil { + l = m.UpgradedClientState.Size() + n += 1 + l + sovClient(uint64(l)) + } + return n +} + +func (m *Height) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.RevisionNumber != 0 { + n += 1 + sovClient(uint64(m.RevisionNumber)) + } + if m.RevisionHeight != 0 { + n += 1 + sovClient(uint64(m.RevisionHeight)) + } + return n +} + +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.AllowedClients) > 0 { + for _, s := range m.AllowedClients { + l = len(s) + n += 1 + l + sovClient(uint64(l)) + } + } + return n +} + +func sovClient(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozClient(x uint64) (n int) { + return sovClient(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *IdentifiedClientState) 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 ErrIntOverflowClient + } + 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: IdentifiedClientState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: IdentifiedClientState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClient + } + 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 ErrInvalidLengthClient + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientState", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthClient + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ClientState == nil { + m.ClientState = &types.Any{} + } + if err := m.ClientState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipClient(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthClient + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthClient + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ConsensusStateWithHeight) 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 ErrIntOverflowClient + } + 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: ConsensusStateWithHeight: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ConsensusStateWithHeight: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthClient + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Height.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsensusState", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthClient + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ConsensusState == nil { + m.ConsensusState = &types.Any{} + } + if err := m.ConsensusState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipClient(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthClient + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthClient + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ClientConsensusStates) 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 ErrIntOverflowClient + } + 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: ClientConsensusStates: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ClientConsensusStates: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClient + } + 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 ErrInvalidLengthClient + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsensusStates", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthClient + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConsensusStates = append(m.ConsensusStates, ConsensusStateWithHeight{}) + if err := m.ConsensusStates[len(m.ConsensusStates)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipClient(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthClient + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthClient + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ClientUpdateProposal) 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 ErrIntOverflowClient + } + 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: ClientUpdateProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ClientUpdateProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClient + } + 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 ErrInvalidLengthClient + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClient + } + 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 ErrInvalidLengthClient + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SubjectClientId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClient + } + 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 ErrInvalidLengthClient + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SubjectClientId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SubstituteClientId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClient + } + 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 ErrInvalidLengthClient + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SubstituteClientId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipClient(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthClient + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthClient + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *UpgradeProposal) 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 ErrIntOverflowClient + } + 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: UpgradeProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UpgradeProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClient + } + 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 ErrInvalidLengthClient + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClient + } + 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 ErrInvalidLengthClient + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Plan", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthClient + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Plan.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UpgradedClientState", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthClient + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.UpgradedClientState == nil { + m.UpgradedClientState = &types.Any{} + } + if err := m.UpgradedClientState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipClient(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthClient + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthClient + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Height) 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 ErrIntOverflowClient + } + 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: Height: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Height: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RevisionNumber", wireType) + } + m.RevisionNumber = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.RevisionNumber |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RevisionHeight", wireType) + } + m.RevisionHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.RevisionHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipClient(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthClient + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthClient + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Params) 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 ErrIntOverflowClient + } + 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: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AllowedClients", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClient + } + 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 ErrInvalidLengthClient + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AllowedClients = append(m.AllowedClients, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipClient(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthClient + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthClient + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipClient(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, ErrIntOverflowClient + } + 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, ErrIntOverflowClient + } + 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, ErrIntOverflowClient + } + 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, ErrInvalidLengthClient + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupClient + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthClient + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthClient = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowClient = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupClient = fmt.Errorf("proto: unexpected end of group") +) diff --git a/ibc/v5/modules/core/24-host/errors.go b/ibc/v5/modules/core/24-host/errors.go new file mode 100644 index 0000000..fe8129b --- /dev/null +++ b/ibc/v5/modules/core/24-host/errors.go @@ -0,0 +1,15 @@ +package host + +import ( + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +// SubModuleName defines the ICS 24 host +const SubModuleName = "host" + +// IBC client sentinel errors +var ( + ErrInvalidID = sdkerrors.Register(SubModuleName, 2, "invalid identifier") + ErrInvalidPath = sdkerrors.Register(SubModuleName, 3, "invalid path") + ErrInvalidPacket = sdkerrors.Register(SubModuleName, 4, "invalid packet") +) diff --git a/ibc/v5/modules/core/24-host/validate.go b/ibc/v5/modules/core/24-host/validate.go new file mode 100644 index 0000000..23341ce --- /dev/null +++ b/ibc/v5/modules/core/24-host/validate.go @@ -0,0 +1,118 @@ +package host + +import ( + "regexp" + "strings" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +// DefaultMaxCharacterLength defines the default maximum character length used +// in validation of identifiers including the client, connection, port and +// channel identifiers. +// +// NOTE: this restriction is specific to this golang implementation of IBC. If +// your use case demands a higher limit, please open an issue and we will consider +// adjusting this restriction. +const DefaultMaxCharacterLength = 64 + +// DefaultMaxPortCharacterLength defines the default maximum character length used +// in validation of port identifiers. +var DefaultMaxPortCharacterLength = 128 + +// IsValidID defines regular expression to check if the string consist of +// characters in one of the following categories only: +// - Alphanumeric +// - `.`, `_`, `+`, `-`, `#` +// - `[`, `]`, `<`, `>` +var IsValidID = regexp.MustCompile(`^[a-zA-Z0-9\.\_\+\-\#\[\]\<\>]+$`).MatchString + +// ICS 024 Identifier and Path Validation Implementation +// +// This file defines ValidateFn to validate identifier and path strings +// The spec for ICS 024 can be located here: +// https://github.com/cosmos/ibc/tree/master/spec/core/ics-024-host-requirements + +// ValidateFn function type to validate path and identifier bytestrings +type ValidateFn func(string) error + +func defaultIdentifierValidator(id string, min, max int) error { + if strings.TrimSpace(id) == "" { + return sdkerrors.Wrap(ErrInvalidID, "identifier cannot be blank") + } + // valid id MUST NOT contain "/" separator + if strings.Contains(id, "/") { + return sdkerrors.Wrapf(ErrInvalidID, "identifier %s cannot contain separator '/'", id) + } + // valid id must fit the length requirements + if len(id) < min || len(id) > max { + return sdkerrors.Wrapf(ErrInvalidID, "identifier %s has invalid length: %d, must be between %d-%d characters", id, len(id), min, max) + } + // valid id must contain only lower alphabetic characters + if !IsValidID(id) { + return sdkerrors.Wrapf( + ErrInvalidID, + "identifier %s must contain only alphanumeric or the following characters: '.', '_', '+', '-', '#', '[', ']', '<', '>'", + id, + ) + } + return nil +} + +// ClientIdentifierValidator is the default validator function for Client identifiers. +// A valid Identifier must be between 9-64 characters and only contain alphanumeric and some allowed +// special characters (see IsValidID). +func ClientIdentifierValidator(id string) error { + return defaultIdentifierValidator(id, 9, DefaultMaxCharacterLength) +} + +// ConnectionIdentifierValidator is the default validator function for Connection identifiers. +// A valid Identifier must be between 10-64 characters and only contain alphanumeric and some allowed +// special characters (see IsValidID). +func ConnectionIdentifierValidator(id string) error { + return defaultIdentifierValidator(id, 10, DefaultMaxCharacterLength) +} + +// ChannelIdentifierValidator is the default validator function for Channel identifiers. +// A valid Identifier must be between 8-64 characters and only contain alphanumeric and some allowed +// special characters (see IsValidID). +func ChannelIdentifierValidator(id string) error { + return defaultIdentifierValidator(id, 8, DefaultMaxCharacterLength) +} + +// PortIdentifierValidator is the default validator function for Port identifiers. +// A valid Identifier must be between 2-64 characters and only contain alphanumeric and some allowed +// special characters (see IsValidID). +func PortIdentifierValidator(id string) error { + return defaultIdentifierValidator(id, 2, DefaultMaxPortCharacterLength) +} + +// NewPathValidator takes in a Identifier Validator function and returns +// a Path Validator function which requires path to consist of `/`-separated valid identifiers, +// where a valid identifier is between 1-64 characters, contains only alphanumeric and some allowed +// special characters (see IsValidID), and satisfies the custom `idValidator` function. +func NewPathValidator(idValidator ValidateFn) ValidateFn { + return func(path string) error { + pathArr := strings.Split(path, "/") + if len(pathArr) > 0 && pathArr[0] == path { + return sdkerrors.Wrapf(ErrInvalidPath, "path %s doesn't contain any separator '/'", path) + } + + for _, p := range pathArr { + // a path beginning or ending in a separator returns empty string elements. + if p == "" { + return sdkerrors.Wrapf(ErrInvalidPath, "path %s cannot begin or end with '/'", path) + } + + if err := idValidator(p); err != nil { + return err + } + // Each path element must either be a valid identifier or constant number + if err := defaultIdentifierValidator(p, 1, DefaultMaxCharacterLength); err != nil { + return sdkerrors.Wrapf(err, "path %s contains an invalid identifier: '%s'", path, p) + } + } + + return nil + } +} diff --git a/proto/cosmos/feegrant/v1beta1/tx.proto b/proto/cosmos/feegrant/v1beta1/tx.proto index b036828..63fdb45 100644 --- a/proto/cosmos/feegrant/v1beta1/tx.proto +++ b/proto/cosmos/feegrant/v1beta1/tx.proto @@ -1,7 +1,6 @@ syntax = "proto3"; package cosmos.feegrant.v1beta1; -import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; import "cosmos_proto/cosmos.proto"; diff --git a/proto/cosmos/upgrade/v1beta1/upgrade.proto b/proto/cosmos/upgrade/v1beta1/upgrade.proto new file mode 100644 index 0000000..e3257cf --- /dev/null +++ b/proto/cosmos/upgrade/v1beta1/upgrade.proto @@ -0,0 +1,86 @@ +syntax = "proto3"; +package cosmos.upgrade.v1beta1; + +import "google/protobuf/any.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/irisnet/core-sdk-go/types/upgrade"; +option (gogoproto.goproto_getters_all) = false; + +// Plan specifies information about a planned upgrade and when it should occur. +message Plan { + option (gogoproto.equal) = true; + // option (gogoproto.goproto_stringer) = false; + + // Sets the name for the upgrade. This name will be used by the upgraded + // version of the software to apply any special "on-upgrade" commands during + // the first BeginBlock method after the upgrade is applied. It is also used + // to detect whether a software version can handle a given upgrade. If no + // upgrade handler with this name has been set in the software, it will be + // assumed that the software is out-of-date when the upgrade Time or Height is + // reached and the software will exit. + string name = 1; + + // Deprecated: Time based upgrades have been deprecated. Time based upgrade logic + // has been removed from the SDK. + // If this field is not empty, an error will be thrown. + google.protobuf.Timestamp time = 2 [deprecated = true, (gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + + // The height at which the upgrade must be performed. + // Only used if Time is not set. + int64 height = 3; + + // Any application specific upgrade info to be included on-chain + // such as a git commit that validators could automatically upgrade to + string info = 4; + + // 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. + google.protobuf.Any upgraded_client_state = 5 [deprecated = true]; +} + +// SoftwareUpgradeProposal is a gov Content type for initiating a software +// upgrade. +// Deprecated: This legacy proposal is deprecated in favor of Msg-based gov +// proposals, see MsgSoftwareUpgrade. +message SoftwareUpgradeProposal { + option deprecated = true; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + option (gogoproto.equal) = true; + // option (gogoproto.goproto_stringer) = false; + + string title = 1; + string description = 2; + Plan plan = 3 [(gogoproto.nullable) = false]; +} + +// CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software +// upgrade. +// Deprecated: This legacy proposal is deprecated in favor of Msg-based gov +// proposals, see MsgCancelUpgrade. +message CancelSoftwareUpgradeProposal { + option deprecated = true; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + option (gogoproto.equal) = true; + // option (gogoproto.goproto_stringer) = false; + + string title = 1; + string description = 2; +} + +// ModuleVersion specifies a module and its consensus version. +// +// Since: cosmos-sdk 0.43 +message ModuleVersion { + option (gogoproto.equal) = true; + // option (gogoproto.goproto_stringer) = true; + + // name of the app module + string name = 1; + + // consensus version of the app module + uint64 version = 2; +} diff --git a/proto/ibc/applications/nft_transfer/v1/query.proto b/proto/ibc/applications/nft_transfer/v1/query.proto new file mode 100644 index 0000000..f22e8a1 --- /dev/null +++ b/proto/ibc/applications/nft_transfer/v1/query.proto @@ -0,0 +1,137 @@ +syntax = "proto3"; + +package ibc.applications.nft_transfer.v1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "ibc/applications/nft_transfer/v1/transfer.proto"; +import "google/api/annotations.proto"; + +option go_package = "github.com/irisnet/core-sdk-go/ibc/nft_transfer"; + +// Query provides defines the gRPC querier service. +service Query { + // ClassTrace queries a class trace information. + rpc ClassTrace(QueryClassTraceRequest) returns (QueryClassTraceResponse) { + option (google.api.http).get = + "/ibc/apps/nft_transfer/v1/class_traces/{hash}"; + } + + // ClassTraces queries all class traces. + rpc ClassTraces(QueryClassTracesRequest) returns (QueryClassTracesResponse) { + option (google.api.http).get = "/ibc/apps/nft_transfer/v1/class_traces"; + } + + // ClassHash queries a class hash information. + rpc ClassHash(QueryClassHashRequest) returns (QueryClassHashResponse) { + option (google.api.http).get = + "/ibc/apps/nft_transfer/v1/class_hashes/{trace}"; + } + + // EscrowAddress returns the escrow address for a particular port and channel + // id. + rpc EscrowAddress(QueryEscrowAddressRequest) + returns (QueryEscrowAddressResponse) { + option (google.api.http).get = + "/ibc/apps/nft_transfer/v1/channels/{channel_id}/ports/{port_id}/" + "escrow_address"; + } + + // Params queries all parameters of the nft-transfer module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/ibc/apps/nft_transfer/v1/params"; + } + + // Ports queries all port of the nft-transfer module. + rpc Ports(QueryPortsRequest) returns (QueryPortsResponse) { + option (google.api.http).get = "/ibc/apps/nft_transfer/v1/ports"; + } +} + +// QueryClassTraceRequest is the request type for the Query/ClassDenom RPC +// method +message QueryClassTraceRequest { + // hash (in hex format) or classID (full classID with ibc prefix) of the + // denomination trace information. + string hash = 1; +} + +// QueryClassTraceResponse is the response type for the Query/ClassDenom RPC +// method. +message QueryClassTraceResponse { + // class_trace returns the requested class trace information. + ClassTrace class_trace = 1; +} + +// QueryConnectionsRequest is the request type for the Query/ClassTraces RPC +// method +message QueryClassTracesRequest { + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryClassTracesResponse is the response type for the Query/ClassTraces RPC +// method. +message QueryClassTracesResponse { + // class_traces returns all class trace information. + repeated ClassTrace class_traces = 1 + [ (gogoproto.castrepeated) = "Traces", (gogoproto.nullable) = false ]; + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryClassHashRequest is the request type for the Query/ClassHash RPC +// method +message QueryClassHashRequest { + // The class trace ([port_id]/[channel_id])+/[denom] + string trace = 1; +} + +// QueryClassHashResponse is the response type for the Query/ClassHash RPC +// method. +message QueryClassHashResponse { + // hash (in hex format) of the denomination trace information. + string hash = 1; +} + +// QueryEscrowAddressRequest is the request type for the EscrowAddress RPC +// method. +message QueryEscrowAddressRequest { + // unique port identifier + string port_id = 1; + // unique channel identifier + string channel_id = 2; +} + +// QueryEscrowAddressResponse is the response type of the EscrowAddress RPC +// method. +message QueryEscrowAddressResponse { + // the escrow account address + string escrow_address = 1; +} + +// QueryParamsRequest is request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is response type for the Query/Params RPC method. +message QueryParamsResponse { + // params holds all the parameters of this module. + Params params = 1 [(gogoproto.nullable) = false]; +} + +// QueryPortsRequest is request type for the Query/Ports RPC method. +message QueryPortsRequest {} + +// QueryPortsResponse is response type for the Query/Ports RPC method. +message QueryPortsResponse { + // entries holds all the port of this module. + repeated Entry entries = 1 [(gogoproto.nullable) = false]; +} + +// Entry is response type for the Query/Ports RPC method. +message Entry { + // the registered port of nft-transfer module + string port = 1; + // the port is available or not + bool enabled = 2; +} \ No newline at end of file diff --git a/proto/ibc/applications/nft_transfer/v1/transfer.proto b/proto/ibc/applications/nft_transfer/v1/transfer.proto new file mode 100644 index 0000000..cc7147f --- /dev/null +++ b/proto/ibc/applications/nft_transfer/v1/transfer.proto @@ -0,0 +1,27 @@ +syntax = "proto3"; + +package ibc.applications.nft_transfer.v1; + +option go_package = "github.com/irisnet/core-sdk-go/ibc/nft_transfer"; + +// ClassTrace contains the base classID for ICS721 non-fungible tokens and the +// source tracing information path. +message ClassTrace { + // path defines the chain of port/channel identifiers used for tracing the + // source of the non-fungible token. + string path = 1; + // base classID of the relayed non-fungible token. + string base_class_id = 2; +} + +// Params defines the set of IBC nft-transfer parameters. +// NOTE: To prevent a nft from being transferred, set the +// TransfersEnabled parameter to false. +message Params { + // send_enabled enables or disables all cross-chain nft transfers from this + // chain. + bool send_enabled = 1; + // receive_enabled enables or disables all cross-chain nft transfers to this + // chain. + bool receive_enabled = 2; +} diff --git a/proto/ibc/applications/nft_transfer/v1/tx.proto b/proto/ibc/applications/nft_transfer/v1/tx.proto new file mode 100644 index 0000000..9fdd74a --- /dev/null +++ b/proto/ibc/applications/nft_transfer/v1/tx.proto @@ -0,0 +1,74 @@ +syntax = "proto3"; + +package ibc.applications.nft_transfer.v1; + +option go_package = "github.com/irisnet/core-sdk-go/ibc/nft_transfer"; + +import "gogoproto/gogo.proto"; +import "ibc/core/client/v1/client.proto"; +import "ibc/applications/nft_transfer/v1/transfer.proto"; + +// Msg defines the ibc/nft-transfer Msg service. +service Msg { + // Transfer defines a rpc handler method for MsgTransfer. + rpc Transfer(MsgTransfer) returns (MsgTransferResponse); + + // UpdateParams defines a governance operation for updating the nft-transfer module parameters. + // The authority is defined in the keeper. + // + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +// MsgTransfer defines a msg to transfer non fungible tokens between +// ICS721 enabled chains. See ICS Spec here: +// https://github.com/cosmos/ibc/tree/master/spec/app/ics-721-nft-transfer#data-structures +message MsgTransfer { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // the port on which the packet will be sent + string source_port = 1; + // the channel by which the packet will be sent + string source_channel = 2; + // the class_id of tokens to be transferred + string class_id = 3; + // the non fungible tokens to be transferred + repeated string token_ids = 4; + // the sender address + string sender = 5; + // the recipient address on the destination chain + string receiver = 6; + // Timeout height relative to the current block height. + // The timeout is disabled when set to 0. + ibc.core.client.v1.Height timeout_height = 7 [ + (gogoproto.nullable) = false + ]; + // Timeout timestamp in absolute nanoseconds since unix epoch. + // The timeout is disabled when set to 0. + uint64 timeout_timestamp = 8; + // optional memo + string memo = 9; +} + +// MsgTransferResponse defines the Msg/Transfer response type. +message MsgTransferResponse { + // sequence number of the transfer packet sent + uint64 sequence = 1; +} + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +message MsgUpdateParams { + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 ; + + // params defines the nft-transfer parameters to update. + // + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +message MsgUpdateParamsResponse {} diff --git a/proto/ibc/core/client/v1/client.proto b/proto/ibc/core/client/v1/client.proto new file mode 100644 index 0000000..06d08c0 --- /dev/null +++ b/proto/ibc/core/client/v1/client.proto @@ -0,0 +1,103 @@ +syntax = "proto3"; + +package ibc.core.client.v1; + +option go_package = "github.com/irisnet/core-sdk-go/ibc/v5/modules/core/02-client/types"; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "cosmos/upgrade/v1beta1/upgrade.proto"; +import "cosmos_proto/cosmos.proto"; + +// IdentifiedClientState defines a client state with an additional client +// identifier field. +message IdentifiedClientState { + // client identifier + string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + // client state + google.protobuf.Any client_state = 2 [(gogoproto.moretags) = "yaml:\"client_state\""]; +} + +// ConsensusStateWithHeight defines a consensus state with an additional height +// field. +message ConsensusStateWithHeight { + // consensus state height + Height height = 1 [(gogoproto.nullable) = false]; + // consensus state + google.protobuf.Any consensus_state = 2 [(gogoproto.moretags) = "yaml:\"consensus_state\""]; +} + +// ClientConsensusStates defines all the stored consensus states for a given +// client. +message ClientConsensusStates { + // client identifier + string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + // consensus states and their heights associated with the client + repeated ConsensusStateWithHeight consensus_states = 2 + [(gogoproto.moretags) = "yaml:\"consensus_states\"", (gogoproto.nullable) = false]; +} + +// ClientUpdateProposal is a governance proposal. If it passes, the substitute +// client's latest consensus state is copied over to the subject client. The proposal +// handler may fail if the subject and the substitute do not match in client and +// chain parameters (with exception to latest height, frozen height, and chain-id). +message ClientUpdateProposal { + option (gogoproto.goproto_getters) = false; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + // the title of the update proposal + string title = 1; + // the description of the proposal + string description = 2; + // the client identifier for the client to be updated if the proposal passes + string subject_client_id = 3 [(gogoproto.moretags) = "yaml:\"subject_client_id\""]; + // the substitute client identifier for the client standing in for the subject + // client + string substitute_client_id = 4 [(gogoproto.moretags) = "yaml:\"substitute_client_id\""]; +} + +// UpgradeProposal is a gov Content type for initiating an IBC breaking +// upgrade. +message UpgradeProposal { + option (gogoproto.goproto_getters) = false; + // option (gogoproto.goproto_stringer) = false; + option (gogoproto.equal) = true; + option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content"; + + string title = 1; + string description = 2; + cosmos.upgrade.v1beta1.Plan plan = 3 [(gogoproto.nullable) = false]; + + // An UpgradedClientState must be provided to perform an IBC breaking upgrade. + // This will make the chain commit to the correct upgraded (self) client state + // before the upgrade occurs, so that connecting chains can verify that the + // new upgraded client is valid by verifying a proof on the previous version + // of the chain. This will allow IBC connections to persist smoothly across + // planned chain upgrades + google.protobuf.Any upgraded_client_state = 4 [(gogoproto.moretags) = "yaml:\"upgraded_client_state\""]; +} + +// Height is a monotonically increasing data type +// that can be compared against another Height for the purposes of updating and +// freezing clients +// +// Normally the RevisionHeight is incremented at each height while keeping +// RevisionNumber the same. However some consensus algorithms may choose to +// reset the height in certain conditions e.g. hard forks, state-machine +// breaking changes In these cases, the RevisionNumber is incremented so that +// height continues to be monitonically increasing even as the RevisionHeight +// gets reset +message Height { + option (gogoproto.goproto_getters) = false; + // option (gogoproto.goproto_stringer) = false; + + // the revision that the client is currently on + uint64 revision_number = 1 [(gogoproto.moretags) = "yaml:\"revision_number\""]; + // the height within the given revision + uint64 revision_height = 2 [(gogoproto.moretags) = "yaml:\"revision_height\""]; +} + +// Params defines the set of IBC light client parameters. +message Params { + // allowed_clients defines the list of allowed client state types. + repeated string allowed_clients = 1 [(gogoproto.moretags) = "yaml:\"allowed_clients\""]; +} diff --git a/staking/query.pb.go b/staking/query.pb.go index 8754dd4..139b7df 100644 --- a/staking/query.pb.go +++ b/staking/query.pb.go @@ -3750,7 +3750,10 @@ func (m *QueryValidatorsRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -3870,7 +3873,10 @@ func (m *QueryValidatorsResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -3952,7 +3958,10 @@ func (m *QueryValidatorRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -4035,7 +4044,10 @@ func (m *QueryValidatorResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -4153,7 +4165,10 @@ func (m *QueryValidatorDelegationsRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -4273,7 +4288,10 @@ func (m *QueryValidatorDelegationsResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -4391,7 +4409,10 @@ func (m *QueryValidatorUnbondingDelegationsRequest) Unmarshal(dAtA []byte) error if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -4511,7 +4532,10 @@ func (m *QueryValidatorUnbondingDelegationsResponse) Unmarshal(dAtA []byte) erro if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -4625,7 +4649,10 @@ func (m *QueryDelegationRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -4711,7 +4738,10 @@ func (m *QueryDelegationResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -4825,7 +4855,10 @@ func (m *QueryUnbondingDelegationRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -4908,7 +4941,10 @@ func (m *QueryUnbondingDelegationResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -5026,7 +5062,10 @@ func (m *QueryDelegatorDelegationsRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -5146,7 +5185,10 @@ func (m *QueryDelegatorDelegationsResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -5264,7 +5306,10 @@ func (m *QueryDelegatorUnbondingDelegationsRequest) Unmarshal(dAtA []byte) error if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -5384,7 +5429,10 @@ func (m *QueryDelegatorUnbondingDelegationsResponse) Unmarshal(dAtA []byte) erro if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -5566,7 +5614,10 @@ func (m *QueryRedelegationsRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -5686,7 +5737,10 @@ func (m *QueryRedelegationsResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -5804,7 +5858,10 @@ func (m *QueryDelegatorValidatorsRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -5924,7 +5981,10 @@ func (m *QueryDelegatorValidatorsResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -6038,7 +6098,10 @@ func (m *QueryDelegatorValidatorRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -6121,7 +6184,10 @@ func (m *QueryDelegatorValidatorResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -6190,7 +6256,10 @@ func (m *QueryHistoricalInfoRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -6276,7 +6345,10 @@ func (m *QueryHistoricalInfoResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -6326,7 +6398,10 @@ func (m *QueryPoolRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -6409,7 +6484,10 @@ func (m *QueryPoolResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -6459,7 +6537,10 @@ func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -6542,7 +6623,10 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { diff --git a/staking/staking.pb.go b/staking/staking.pb.go index 1f6398b..644c55f 100644 --- a/staking/staking.pb.go +++ b/staking/staking.pb.go @@ -3596,7 +3596,10 @@ func (m *HistoricalInfo) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthStaking + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthStaking } if (iNdEx + skippy) > l { @@ -3748,7 +3751,10 @@ func (m *CommissionRates) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthStaking + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthStaking } if (iNdEx + skippy) > l { @@ -3864,7 +3870,10 @@ func (m *Commission) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthStaking + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthStaking } if (iNdEx + skippy) > l { @@ -4074,7 +4083,10 @@ func (m *Description) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthStaking + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthStaking } if (iNdEx + skippy) > l { @@ -4451,7 +4463,10 @@ func (m *Validator) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthStaking + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthStaking } if (iNdEx + skippy) > l { @@ -4533,7 +4548,10 @@ func (m *ValAddresses) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthStaking + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthStaking } if (iNdEx + skippy) > l { @@ -4647,7 +4665,10 @@ func (m *DVPair) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthStaking + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthStaking } if (iNdEx + skippy) > l { @@ -4731,7 +4752,10 @@ func (m *DVPairs) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthStaking + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthStaking } if (iNdEx + skippy) > l { @@ -4877,7 +4901,10 @@ func (m *DVVTriplet) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthStaking + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthStaking } if (iNdEx + skippy) > l { @@ -4961,7 +4988,10 @@ func (m *DVVTriplets) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthStaking + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthStaking } if (iNdEx + skippy) > l { @@ -5109,7 +5139,10 @@ func (m *Delegation) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthStaking + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthStaking } if (iNdEx + skippy) > l { @@ -5257,7 +5290,10 @@ func (m *UnbondingDelegation) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthStaking + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthStaking } if (iNdEx + skippy) > l { @@ -5427,7 +5463,10 @@ func (m *UnbondingDelegationEntry) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthStaking + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthStaking } if (iNdEx + skippy) > l { @@ -5597,7 +5636,10 @@ func (m *RedelegationEntry) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthStaking + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthStaking } if (iNdEx + skippy) > l { @@ -5777,7 +5819,10 @@ func (m *Redelegation) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthStaking + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthStaking } if (iNdEx + skippy) > l { @@ -5949,7 +5994,10 @@ func (m *Params) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthStaking + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthStaking } if (iNdEx + skippy) > l { @@ -6065,7 +6113,10 @@ func (m *DelegationResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthStaking + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthStaking } if (iNdEx + skippy) > l { @@ -6182,7 +6233,10 @@ func (m *RedelegationEntryResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthStaking + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthStaking } if (iNdEx + skippy) > l { @@ -6299,7 +6353,10 @@ func (m *RedelegationResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthStaking + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthStaking } if (iNdEx + skippy) > l { @@ -6417,7 +6474,10 @@ func (m *Pool) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthStaking + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthStaking } if (iNdEx + skippy) > l { diff --git a/staking/tx.pb.go b/staking/tx.pb.go index 1f55015..e2c0ec2 100644 --- a/staking/tx.pb.go +++ b/staking/tx.pb.go @@ -1643,7 +1643,10 @@ func (m *MsgCreateValidator) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthTx } if (iNdEx + skippy) > l { @@ -1693,7 +1696,10 @@ func (m *MsgCreateValidatorResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthTx } if (iNdEx + skippy) > l { @@ -1880,7 +1886,10 @@ func (m *MsgEditValidator) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthTx } if (iNdEx + skippy) > l { @@ -1930,7 +1939,10 @@ func (m *MsgEditValidatorResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthTx } if (iNdEx + skippy) > l { @@ -2077,7 +2089,10 @@ func (m *MsgDelegate) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthTx } if (iNdEx + skippy) > l { @@ -2127,7 +2142,10 @@ func (m *MsgDelegateResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthTx } if (iNdEx + skippy) > l { @@ -2306,7 +2324,10 @@ func (m *MsgBeginRedelegate) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthTx } if (iNdEx + skippy) > l { @@ -2389,7 +2410,10 @@ func (m *MsgBeginRedelegateResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthTx } if (iNdEx + skippy) > l { @@ -2536,7 +2560,10 @@ func (m *MsgUndelegate) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthTx } if (iNdEx + skippy) > l { @@ -2619,7 +2646,10 @@ func (m *MsgUndelegateResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthTx } if (iNdEx + skippy) > l { diff --git a/store/commit_info.pb.go b/store/commit_info.pb.go index 3008ee8..e378320 100644 --- a/store/commit_info.pb.go +++ b/store/commit_info.pb.go @@ -488,7 +488,10 @@ func (m *CommitInfo) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthCommitInfo + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthCommitInfo } if (iNdEx + skippy) > l { @@ -603,7 +606,10 @@ func (m *StoreInfo) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthCommitInfo + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthCommitInfo } if (iNdEx + skippy) > l { @@ -706,7 +712,10 @@ func (m *CommitID) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthCommitInfo + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthCommitInfo } if (iNdEx + skippy) > l { diff --git a/store/listening.pb.go b/store/listening.pb.go index 68a22d5..71bae25 100644 --- a/store/listening.pb.go +++ b/store/listening.pb.go @@ -370,7 +370,10 @@ func (m *StoreKVPair) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthListening + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthListening } if (iNdEx + skippy) > l { diff --git a/store/snapshot.pb.go b/store/snapshot.pb.go index e7a318c..21fcb0d 100644 --- a/store/snapshot.pb.go +++ b/store/snapshot.pb.go @@ -605,7 +605,10 @@ func (m *SnapshotItem) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthSnapshot + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthSnapshot } if (iNdEx + skippy) > l { @@ -687,7 +690,10 @@ func (m *SnapshotStoreItem) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthSnapshot + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthSnapshot } if (iNdEx + skippy) > l { @@ -843,7 +849,10 @@ func (m *SnapshotIAVLItem) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthSnapshot + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthSnapshot } if (iNdEx + skippy) > l { diff --git a/store/types/snapshots/snapshot.pb.go b/store/types/snapshots/snapshot.pb.go index 3641f60..686dc98 100644 --- a/store/types/snapshots/snapshot.pb.go +++ b/store/types/snapshots/snapshot.pb.go @@ -479,7 +479,10 @@ func (m *Snapshot) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthSnapshot + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthSnapshot } if (iNdEx + skippy) > l { @@ -561,7 +564,10 @@ func (m *Metadata) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthSnapshot + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthSnapshot } if (iNdEx + skippy) > l { diff --git a/types/abci.pb.go b/types/abci.pb.go index 9bdfeff..2e6c094 100644 --- a/types/abci.pb.go +++ b/types/abci.pb.go @@ -1881,7 +1881,10 @@ func (m *TxResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthAbci + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthAbci } if (iNdEx + skippy) > l { @@ -2016,7 +2019,10 @@ func (m *ABCIMessageLog) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthAbci + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthAbci } if (iNdEx + skippy) > l { @@ -2132,7 +2138,10 @@ func (m *StringEvent) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthAbci + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthAbci } if (iNdEx + skippy) > l { @@ -2246,7 +2255,10 @@ func (m *Attribute) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthAbci + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthAbci } if (iNdEx + skippy) > l { @@ -2334,7 +2346,10 @@ func (m *GasInfo) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthAbci + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthAbci } if (iNdEx + skippy) > l { @@ -2484,7 +2499,10 @@ func (m *Result) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthAbci + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthAbci } if (iNdEx + skippy) > l { @@ -2603,7 +2621,10 @@ func (m *SimulationResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthAbci + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthAbci } if (iNdEx + skippy) > l { @@ -2719,7 +2740,10 @@ func (m *MsgData) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthAbci + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthAbci } if (iNdEx + skippy) > l { @@ -2803,7 +2827,10 @@ func (m *TxMsgData) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthAbci + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthAbci } if (iNdEx + skippy) > l { @@ -2982,7 +3009,10 @@ func (m *SearchTxsResult) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthAbci + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthAbci } if (iNdEx + skippy) > l { diff --git a/types/auth/auth.pb.go b/types/auth/auth.pb.go index 038f5eb..a95f4eb 100644 --- a/types/auth/auth.pb.go +++ b/types/auth/auth.pb.go @@ -652,7 +652,10 @@ func (m *BaseAccount) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthAuth + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthAuth } if (iNdEx + skippy) > l { @@ -802,7 +805,10 @@ func (m *ModuleAccount) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthAuth + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthAuth } if (iNdEx + skippy) > l { @@ -947,7 +953,10 @@ func (m *Params) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthAuth + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthAuth } if (iNdEx + skippy) > l { diff --git a/types/auth/query.pb.go b/types/auth/query.pb.go index 694dae5..0a0d00a 100644 --- a/types/auth/query.pb.go +++ b/types/auth/query.pb.go @@ -610,7 +610,10 @@ func (m *QueryAccountRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -696,7 +699,10 @@ func (m *QueryAccountResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -746,7 +752,10 @@ func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { @@ -829,7 +838,10 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthQuery } if (iNdEx + skippy) > l { diff --git a/types/coin.pb.go b/types/coin.pb.go index 38f8ec3..a8e3053 100644 --- a/types/coin.pb.go +++ b/types/coin.pb.go @@ -593,7 +593,10 @@ func (m *Coin) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthCoin + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthCoin } if (iNdEx + skippy) > l { @@ -709,7 +712,10 @@ func (m *DecCoin) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthCoin + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthCoin } if (iNdEx + skippy) > l { @@ -793,7 +799,10 @@ func (m *IntProto) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthCoin + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthCoin } if (iNdEx + skippy) > l { @@ -877,7 +886,10 @@ func (m *DecProto) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthCoin + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthCoin } if (iNdEx + skippy) > l { diff --git a/types/kv/kv.pb.go b/types/kv/kv.pb.go index be1963c..24f5718 100644 --- a/types/kv/kv.pb.go +++ b/types/kv/kv.pb.go @@ -339,7 +339,10 @@ func (m *Pairs) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthKv + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthKv } if (iNdEx + skippy) > l { @@ -457,7 +460,10 @@ func (m *Pair) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthKv + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthKv } if (iNdEx + skippy) > l { diff --git a/types/query/pagination.pb.go b/types/query/pagination.pb.go index 0550c87..6f23da4 100644 --- a/types/query/pagination.pb.go +++ b/types/query/pagination.pb.go @@ -25,10 +25,10 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // PageRequest is to be embedded in gRPC request messages for efficient // pagination. Ex: // -// message SomeRequest { -// Foo some_parameter = 1; -// PageRequest pagination = 2; -// } +// message SomeRequest { +// Foo some_parameter = 1; +// PageRequest pagination = 2; +// } type PageRequest struct { // key is a value returned in PageResponse.next_key to begin // querying the next page most efficiently. Only one of offset or key @@ -112,10 +112,10 @@ func (m *PageRequest) GetCountTotal() bool { // PageResponse is to be embedded in gRPC response messages where the // corresponding request message has used PageRequest. // -// message SomeResponse { -// repeated Bar results = 1; -// PageResponse page = 2; -// } +// message SomeResponse { +// repeated Bar results = 1; +// PageResponse page = 2; +// } type PageResponse struct { // next_key is the key to be passed to PageRequest.key to // query the next page most efficiently @@ -470,7 +470,10 @@ func (m *PageRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthPagination + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthPagination } if (iNdEx + skippy) > l { @@ -573,7 +576,10 @@ func (m *PageResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthPagination + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthPagination } if (iNdEx + skippy) > l { diff --git a/types/rpc/json_rpc_client.go b/types/rpc/json_rpc_client.go index bf2f2a4..f964a44 100644 --- a/types/rpc/json_rpc_client.go +++ b/types/rpc/json_rpc_client.go @@ -34,7 +34,7 @@ type JSONRpcClient struct { *WSEvents } -func NewJSONRpcClient(rpcAddr, wsAddr string, endpoint string, timeout uint, header http.Header) (JSONRpcClient, error) { +func NewJSONRPCClient(rpcAddr, wsAddr string, endpoint string, timeout uint, header http.Header) (JSONRpcClient, error) { if wsAddr == "" { wsAddr = rpcAddr } diff --git a/types/tx/signing/signing.pb.go b/types/tx/signing/signing.pb.go index 75e668e..e57e87e 100644 --- a/types/tx/signing/signing.pb.go +++ b/types/tx/signing/signing.pb.go @@ -184,7 +184,6 @@ type SignatureDescriptor_Data struct { // sum is the oneof that specifies whether this represents single or multi-signature data // // Types that are valid to be assigned to Sum: - // // *SignatureDescriptor_Data_Single_ // *SignatureDescriptor_Data_Multi_ Sum isSignatureDescriptor_Data_Sum `protobuf_oneof:"sum"` @@ -869,7 +868,10 @@ func (m *SignatureDescriptors) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthSigning + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthSigning } if (iNdEx + skippy) > l { @@ -1010,7 +1012,10 @@ func (m *SignatureDescriptor) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthSigning + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthSigning } if (iNdEx + skippy) > l { @@ -1130,7 +1135,10 @@ func (m *SignatureDescriptor_Data) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthSigning + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthSigning } if (iNdEx + skippy) > l { @@ -1233,7 +1241,10 @@ func (m *SignatureDescriptor_Data_Single) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthSigning + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthSigning } if (iNdEx + skippy) > l { @@ -1353,7 +1364,10 @@ func (m *SignatureDescriptor_Data_Multi) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthSigning + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthSigning } if (iNdEx + skippy) > l { diff --git a/types/tx/tx.pb.go b/types/tx/tx.pb.go index dec3352..3264dda 100644 --- a/types/tx/tx.pb.go +++ b/types/tx/tx.pb.go @@ -476,7 +476,6 @@ type ModeInfo struct { // multisig signer // // Types that are valid to be assigned to Sum: - // // *ModeInfo_Single_ // *ModeInfo_Multi_ Sum isModeInfo_Sum `protobuf_oneof:"sum"` @@ -1749,7 +1748,10 @@ func (m *Tx) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthTx } if (iNdEx + skippy) > l { @@ -1899,7 +1901,10 @@ func (m *TxRaw) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthTx } if (iNdEx + skippy) > l { @@ -2068,7 +2073,10 @@ func (m *SignDoc) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthTx } if (iNdEx + skippy) > l { @@ -2271,7 +2279,10 @@ func (m *TxBody) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthTx } if (iNdEx + skippy) > l { @@ -2391,7 +2402,10 @@ func (m *AuthInfo) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthTx } if (iNdEx + skippy) > l { @@ -2532,7 +2546,10 @@ func (m *SignerInfo) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthTx } if (iNdEx + skippy) > l { @@ -2652,7 +2669,10 @@ func (m *ModeInfo) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthTx } if (iNdEx + skippy) > l { @@ -2721,7 +2741,10 @@ func (m *ModeInfo_Single) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthTx } if (iNdEx + skippy) > l { @@ -2841,7 +2864,10 @@ func (m *ModeInfo_Multi) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthTx } if (iNdEx + skippy) > l { @@ -3008,7 +3034,10 @@ func (m *Fee) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthTx } if (iNdEx + skippy) > l { diff --git a/types/upgrade/upgrade.pb.go b/types/upgrade/upgrade.pb.go new file mode 100644 index 0000000..985589e --- /dev/null +++ b/types/upgrade/upgrade.pb.go @@ -0,0 +1,1324 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/upgrade/v1beta1/upgrade.proto + +package upgrade + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + types "github.com/irisnet/core-sdk-go/common/codec/types" + _ "github.com/regen-network/cosmos-proto" + _ "google.golang.org/protobuf/types/known/timestamppb" + io "io" + math "math" + math_bits "math/bits" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// 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 + +// Plan specifies information about a planned upgrade and when it should occur. +type Plan struct { + // Sets the name for the upgrade. This name will be used by the upgraded + // version of the software to apply any special "on-upgrade" commands during + // the first BeginBlock method after the upgrade is applied. It is also used + // to detect whether a software version can handle a given upgrade. If no + // upgrade handler with this name has been set in the software, it will be + // assumed that the software is out-of-date when the upgrade Time or Height is + // reached and the software will exit. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Deprecated: Time based upgrades have been deprecated. Time based upgrade logic + // has been removed from the SDK. + // If this field is not empty, an error will be thrown. + Time time.Time `protobuf:"bytes,2,opt,name=time,proto3,stdtime" json:"time"` // Deprecated: Do not use. + // The height at which the upgrade must be performed. + // Only used if Time is not set. + Height int64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` + // Any application specific upgrade info to be included on-chain + // such as a git commit that validators could automatically upgrade to + Info string `protobuf:"bytes,4,opt,name=info,proto3" json:"info,omitempty"` + // 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. +} + +func (m *Plan) Reset() { *m = Plan{} } +func (m *Plan) String() string { return proto.CompactTextString(m) } +func (*Plan) ProtoMessage() {} +func (*Plan) Descriptor() ([]byte, []int) { + return fileDescriptor_ccf2a7d4d7b48dca, []int{0} +} +func (m *Plan) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Plan) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Plan.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 *Plan) XXX_Merge(src proto.Message) { + xxx_messageInfo_Plan.Merge(m, src) +} +func (m *Plan) XXX_Size() int { + return m.Size() +} +func (m *Plan) XXX_DiscardUnknown() { + xxx_messageInfo_Plan.DiscardUnknown(m) +} + +var xxx_messageInfo_Plan proto.InternalMessageInfo + +// SoftwareUpgradeProposal is a gov Content type for initiating a software +// upgrade. +// Deprecated: This legacy proposal is deprecated in favor of Msg-based gov +// proposals, see MsgSoftwareUpgrade. +// +// Deprecated: Do not use. +type SoftwareUpgradeProposal struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + Plan Plan `protobuf:"bytes,3,opt,name=plan,proto3" json:"plan"` +} + +func (m *SoftwareUpgradeProposal) Reset() { *m = SoftwareUpgradeProposal{} } +func (m *SoftwareUpgradeProposal) String() string { return proto.CompactTextString(m) } +func (*SoftwareUpgradeProposal) ProtoMessage() {} +func (*SoftwareUpgradeProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_ccf2a7d4d7b48dca, []int{1} +} +func (m *SoftwareUpgradeProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SoftwareUpgradeProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SoftwareUpgradeProposal.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 *SoftwareUpgradeProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_SoftwareUpgradeProposal.Merge(m, src) +} +func (m *SoftwareUpgradeProposal) XXX_Size() int { + return m.Size() +} +func (m *SoftwareUpgradeProposal) XXX_DiscardUnknown() { + xxx_messageInfo_SoftwareUpgradeProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_SoftwareUpgradeProposal proto.InternalMessageInfo + +// CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software +// upgrade. +// Deprecated: This legacy proposal is deprecated in favor of Msg-based gov +// proposals, see MsgCancelUpgrade. +// +// Deprecated: Do not use. +type CancelSoftwareUpgradeProposal struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` +} + +func (m *CancelSoftwareUpgradeProposal) Reset() { *m = CancelSoftwareUpgradeProposal{} } +func (m *CancelSoftwareUpgradeProposal) String() string { return proto.CompactTextString(m) } +func (*CancelSoftwareUpgradeProposal) ProtoMessage() {} +func (*CancelSoftwareUpgradeProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_ccf2a7d4d7b48dca, []int{2} +} +func (m *CancelSoftwareUpgradeProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CancelSoftwareUpgradeProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CancelSoftwareUpgradeProposal.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 *CancelSoftwareUpgradeProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_CancelSoftwareUpgradeProposal.Merge(m, src) +} +func (m *CancelSoftwareUpgradeProposal) XXX_Size() int { + return m.Size() +} +func (m *CancelSoftwareUpgradeProposal) XXX_DiscardUnknown() { + xxx_messageInfo_CancelSoftwareUpgradeProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_CancelSoftwareUpgradeProposal proto.InternalMessageInfo + +// ModuleVersion specifies a module and its consensus version. +// +// Since: cosmos-sdk 0.43 +type ModuleVersion struct { + // name of the app module + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // consensus version of the app module + Version uint64 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` +} + +func (m *ModuleVersion) Reset() { *m = ModuleVersion{} } +func (m *ModuleVersion) String() string { return proto.CompactTextString(m) } +func (*ModuleVersion) ProtoMessage() {} +func (*ModuleVersion) Descriptor() ([]byte, []int) { + return fileDescriptor_ccf2a7d4d7b48dca, []int{3} +} +func (m *ModuleVersion) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ModuleVersion) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ModuleVersion.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 *ModuleVersion) XXX_Merge(src proto.Message) { + xxx_messageInfo_ModuleVersion.Merge(m, src) +} +func (m *ModuleVersion) XXX_Size() int { + return m.Size() +} +func (m *ModuleVersion) XXX_DiscardUnknown() { + xxx_messageInfo_ModuleVersion.DiscardUnknown(m) +} + +var xxx_messageInfo_ModuleVersion proto.InternalMessageInfo + +func init() { + proto.RegisterType((*Plan)(nil), "cosmos.upgrade.v1beta1.Plan") + proto.RegisterType((*SoftwareUpgradeProposal)(nil), "cosmos.upgrade.v1beta1.SoftwareUpgradeProposal") + proto.RegisterType((*CancelSoftwareUpgradeProposal)(nil), "cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal") + proto.RegisterType((*ModuleVersion)(nil), "cosmos.upgrade.v1beta1.ModuleVersion") +} + +func init() { + proto.RegisterFile("cosmos/upgrade/v1beta1/upgrade.proto", fileDescriptor_ccf2a7d4d7b48dca) +} + +var fileDescriptor_ccf2a7d4d7b48dca = []byte{ + // 481 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x93, 0x3f, 0x6f, 0xd3, 0x40, + 0x18, 0xc6, 0x7d, 0xad, 0x5b, 0xd4, 0xab, 0x58, 0x4c, 0x28, 0xd7, 0x08, 0x9c, 0x28, 0xea, 0x90, + 0x81, 0xd8, 0x6a, 0x91, 0x18, 0xb2, 0x91, 0x6c, 0x08, 0xa4, 0xca, 0x05, 0x06, 0x96, 0xe8, 0x62, + 0x5f, 0x2e, 0x27, 0xec, 0x7b, 0x2d, 0xdf, 0x25, 0x28, 0x03, 0xdf, 0xa1, 0x1f, 0x81, 0x6f, 0xc0, + 0xc2, 0x87, 0xc8, 0x58, 0x31, 0x20, 0x26, 0xfe, 0x24, 0x0b, 0x1f, 0x03, 0xdd, 0x9d, 0x5d, 0x21, + 0xe8, 0xc0, 0xc0, 0xf6, 0x3e, 0xaf, 0x9f, 0xc7, 0xbf, 0x7b, 0xdf, 0xb3, 0xf1, 0x49, 0x0a, 0xaa, + 0x00, 0x15, 0x2f, 0x4a, 0x5e, 0xd1, 0x8c, 0xc5, 0xcb, 0xd3, 0x29, 0xd3, 0xf4, 0xb4, 0xd1, 0x51, + 0x59, 0x81, 0x86, 0xe0, 0xc8, 0xb9, 0xa2, 0xa6, 0x5b, 0xbb, 0xda, 0xc7, 0x1c, 0x80, 0xe7, 0x2c, + 0xb6, 0xae, 0xe9, 0x62, 0x16, 0x53, 0xb9, 0x72, 0x91, 0x76, 0x8b, 0x03, 0x07, 0x5b, 0xc6, 0xa6, + 0xaa, 0xbb, 0x9d, 0x3f, 0x03, 0x5a, 0x14, 0x4c, 0x69, 0x5a, 0x94, 0xb5, 0xe1, 0xd8, 0x91, 0x26, + 0x2e, 0x59, 0x63, 0xad, 0xe8, 0x7d, 0x46, 0xd8, 0x3f, 0xcf, 0xa9, 0x0c, 0x02, 0xec, 0x4b, 0x5a, + 0x30, 0x82, 0xba, 0xa8, 0x7f, 0x90, 0xd8, 0x3a, 0x18, 0x62, 0xdf, 0xbc, 0x8a, 0xec, 0x74, 0x51, + 0xff, 0xf0, 0xac, 0x1d, 0x39, 0x4e, 0xd4, 0x70, 0xa2, 0x17, 0x0d, 0x67, 0x84, 0xd7, 0x5f, 0x3b, + 0xde, 0xe5, 0xb7, 0x0e, 0x22, 0x28, 0xb1, 0x99, 0xe0, 0x08, 0xef, 0xcf, 0x99, 0xe0, 0x73, 0x4d, + 0x76, 0xbb, 0xa8, 0xbf, 0x9b, 0xd4, 0xca, 0x70, 0x84, 0x9c, 0x01, 0xf1, 0x1d, 0xc7, 0xd4, 0xc1, + 0x33, 0x7c, 0xb7, 0x5e, 0x42, 0x36, 0x49, 0x73, 0xc1, 0xa4, 0x9e, 0x28, 0x4d, 0x35, 0x23, 0x7b, + 0x16, 0xdc, 0xfa, 0x0b, 0xfc, 0x44, 0xae, 0x46, 0x3b, 0x04, 0x25, 0x77, 0x9a, 0xd8, 0xd8, 0xa6, + 0x2e, 0x4c, 0x68, 0xe8, 0xff, 0x7c, 0xdf, 0x41, 0xbd, 0x0f, 0x08, 0xdf, 0xbb, 0x80, 0x99, 0x7e, + 0x4b, 0x2b, 0xf6, 0xd2, 0xb9, 0xce, 0x2b, 0x28, 0x41, 0xd1, 0x3c, 0x68, 0xe1, 0x3d, 0x2d, 0x74, + 0xde, 0x0c, 0xeb, 0x44, 0xd0, 0xc5, 0x87, 0x19, 0x53, 0x69, 0x25, 0x4a, 0x2d, 0x40, 0xda, 0xa1, + 0x0f, 0x92, 0xdf, 0x5b, 0xc1, 0x63, 0xec, 0x97, 0x39, 0x95, 0x76, 0xa2, 0xc3, 0xb3, 0xfb, 0xd1, + 0xcd, 0x17, 0x18, 0x99, 0x7d, 0x8e, 0x7c, 0xb3, 0x91, 0xc4, 0xfa, 0x87, 0x27, 0xe6, 0x44, 0x9f, + 0x3e, 0x0e, 0xda, 0x75, 0x80, 0xc3, 0xf2, 0xda, 0x3c, 0x06, 0xa9, 0x99, 0xd4, 0x04, 0xf5, 0xde, + 0xe1, 0x07, 0x63, 0x2a, 0x53, 0x96, 0xff, 0xe7, 0x63, 0xff, 0x23, 0x7e, 0x8c, 0x6f, 0x3f, 0x87, + 0x6c, 0x91, 0xb3, 0x57, 0xac, 0x52, 0x66, 0xda, 0x9b, 0xbe, 0x08, 0x82, 0x6f, 0x2d, 0xdd, 0x63, + 0x0b, 0xf2, 0x93, 0x46, 0xba, 0xad, 0x8f, 0x9e, 0xae, 0x7f, 0x84, 0xde, 0x7a, 0x13, 0xa2, 0xab, + 0x4d, 0x88, 0xbe, 0x6f, 0x42, 0x74, 0xb9, 0x0d, 0xbd, 0xab, 0x6d, 0xe8, 0x7d, 0xd9, 0x86, 0xde, + 0xeb, 0x87, 0x5c, 0xe8, 0xf9, 0x62, 0x1a, 0xa5, 0x50, 0xc4, 0xa2, 0x12, 0x4a, 0x32, 0x1d, 0xa7, + 0x50, 0xb1, 0x81, 0xca, 0xde, 0x0c, 0x38, 0xc4, 0x7a, 0x55, 0xb2, 0xeb, 0xbf, 0x66, 0xba, 0x6f, + 0xaf, 0xfb, 0xd1, 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xed, 0x2c, 0xf4, 0xf0, 0x4e, 0x03, 0x00, + 0x00, +} + +func (this *Plan) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Plan) + if !ok { + that2, ok := that.(Plan) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Name != that1.Name { + return false + } + if !this.Time.Equal(that1.Time) { + return false + } + if this.Height != that1.Height { + return false + } + if this.Info != that1.Info { + return false + } + if !this.UpgradedClientState.Equal(that1.UpgradedClientState) { + return false + } + return true +} +func (this *SoftwareUpgradeProposal) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*SoftwareUpgradeProposal) + if !ok { + that2, ok := that.(SoftwareUpgradeProposal) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Title != that1.Title { + return false + } + if this.Description != that1.Description { + return false + } + if !this.Plan.Equal(&that1.Plan) { + return false + } + return true +} +func (this *CancelSoftwareUpgradeProposal) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*CancelSoftwareUpgradeProposal) + if !ok { + that2, ok := that.(CancelSoftwareUpgradeProposal) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Title != that1.Title { + return false + } + if this.Description != that1.Description { + return false + } + return true +} +func (this *ModuleVersion) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*ModuleVersion) + if !ok { + that2, ok := that.(ModuleVersion) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Name != that1.Name { + return false + } + if this.Version != that1.Version { + return false + } + return true +} +func (m *Plan) 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 *Plan) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Plan) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.UpgradedClientState != nil { + { + size, err := m.UpgradedClientState.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUpgrade(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if len(m.Info) > 0 { + i -= len(m.Info) + copy(dAtA[i:], m.Info) + i = encodeVarintUpgrade(dAtA, i, uint64(len(m.Info))) + i-- + dAtA[i] = 0x22 + } + if m.Height != 0 { + i = encodeVarintUpgrade(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x18 + } + n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Time, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Time):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintUpgrade(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x12 + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintUpgrade(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SoftwareUpgradeProposal) 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 *SoftwareUpgradeProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SoftwareUpgradeProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Plan.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUpgrade(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintUpgrade(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintUpgrade(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *CancelSoftwareUpgradeProposal) 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 *CancelSoftwareUpgradeProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CancelSoftwareUpgradeProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintUpgrade(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintUpgrade(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ModuleVersion) 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 *ModuleVersion) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ModuleVersion) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Version != 0 { + i = encodeVarintUpgrade(dAtA, i, uint64(m.Version)) + i-- + dAtA[i] = 0x10 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintUpgrade(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintUpgrade(dAtA []byte, offset int, v uint64) int { + offset -= sovUpgrade(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Plan) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovUpgrade(uint64(l)) + } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Time) + n += 1 + l + sovUpgrade(uint64(l)) + if m.Height != 0 { + n += 1 + sovUpgrade(uint64(m.Height)) + } + l = len(m.Info) + if l > 0 { + n += 1 + l + sovUpgrade(uint64(l)) + } + if m.UpgradedClientState != nil { + l = m.UpgradedClientState.Size() + n += 1 + l + sovUpgrade(uint64(l)) + } + return n +} + +func (m *SoftwareUpgradeProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovUpgrade(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovUpgrade(uint64(l)) + } + l = m.Plan.Size() + n += 1 + l + sovUpgrade(uint64(l)) + return n +} + +func (m *CancelSoftwareUpgradeProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovUpgrade(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovUpgrade(uint64(l)) + } + return n +} + +func (m *ModuleVersion) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovUpgrade(uint64(l)) + } + if m.Version != 0 { + n += 1 + sovUpgrade(uint64(m.Version)) + } + return n +} + +func sovUpgrade(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozUpgrade(x uint64) (n int) { + return sovUpgrade(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Plan) 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 ErrIntOverflowUpgrade + } + 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: Plan: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Plan: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUpgrade + } + 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 ErrInvalidLengthUpgrade + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUpgrade + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Time", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUpgrade + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUpgrade + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUpgrade + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Time, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + m.Height = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUpgrade + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUpgrade + } + 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 ErrInvalidLengthUpgrade + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUpgrade + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Info = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UpgradedClientState", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUpgrade + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUpgrade + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUpgrade + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.UpgradedClientState == nil { + m.UpgradedClientState = &types.Any{} + } + if err := m.UpgradedClientState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipUpgrade(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthUpgrade + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthUpgrade + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SoftwareUpgradeProposal) 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 ErrIntOverflowUpgrade + } + 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: SoftwareUpgradeProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SoftwareUpgradeProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUpgrade + } + 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 ErrInvalidLengthUpgrade + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUpgrade + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUpgrade + } + 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 ErrInvalidLengthUpgrade + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUpgrade + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Plan", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUpgrade + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUpgrade + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUpgrade + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Plan.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipUpgrade(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthUpgrade + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthUpgrade + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CancelSoftwareUpgradeProposal) 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 ErrIntOverflowUpgrade + } + 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: CancelSoftwareUpgradeProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CancelSoftwareUpgradeProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUpgrade + } + 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 ErrInvalidLengthUpgrade + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUpgrade + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUpgrade + } + 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 ErrInvalidLengthUpgrade + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUpgrade + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipUpgrade(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthUpgrade + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthUpgrade + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ModuleVersion) 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 ErrIntOverflowUpgrade + } + 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: ModuleVersion: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ModuleVersion: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUpgrade + } + 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 ErrInvalidLengthUpgrade + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthUpgrade + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + m.Version = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUpgrade + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Version |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipUpgrade(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthUpgrade + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthUpgrade + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipUpgrade(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, ErrIntOverflowUpgrade + } + 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, ErrIntOverflowUpgrade + } + 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, ErrIntOverflowUpgrade + } + 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, ErrInvalidLengthUpgrade + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupUpgrade + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthUpgrade + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthUpgrade = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowUpgrade = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupUpgrade = fmt.Errorf("proto: unexpected end of group") +)