diff --git a/CHANGELOG.md b/CHANGELOG.md index e220eb440016..32c4811db4ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -211,7 +211,6 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i * (simapp) [#19146](https://github.com/cosmos/cosmos-sdk/pull/19146) Replace `--v` CLI option with `--validator-count`/`-n`. * (module) [#19370](https://github.com/cosmos/cosmos-sdk/pull/19370) Deprecate `module.Configurator`, use `appmodule.HasMigrations` and `appmodule.HasServices` instead from Core API. -* (x/auth) [#20531](https://github.com/cosmos/cosmos-sdk/pull/20531) Deprecate auth keeper `NextAccountNumber`, use `keeper.AccountsModKeeper.NextAccountNumber` instead. ## [v0.50.8](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.50.8) - 2024-07-15 diff --git a/x/auth/CHANGELOG.md b/x/auth/CHANGELOG.md index 594f89f87267..02a11f7b2914 100644 --- a/x/auth/CHANGELOG.md +++ b/x/auth/CHANGELOG.md @@ -37,10 +37,11 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [#18780](https://github.com/cosmos/cosmos-sdk/pull/18780) Move sig verification out of the for loop, into the authenticate method. * [#19188](https://github.com/cosmos/cosmos-sdk/pull/19188) Remove creation of `BaseAccount` when sending a message to an account that does not exist. * When signing a transaction with an account that has not been created accountnumber 0 must be used +* [#19363](https://github.com/cosmos/cosmos-sdk/pull/19363), [#19370](https://github.com/cosmos/cosmos-sdk/pull/19370) RegisterMigrations, InitGenesis and ExportGenesis return error instead of panic. ### CLI Breaking Changes -* (vesting) [#18100](https://github.com/cosmos/cosmos-sdk/pull/18100) `appd tx vesting create-vesting-account` takes an amount of coin as last argument instead of second. Coins are space separated. +* (vesting) [#19539](https://github.com/cosmos/cosmos-sdk/pull/19539) Remove vesting CLI. ### API Breaking Changes @@ -49,9 +50,8 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [#19161](https://github.com/cosmos/cosmos-sdk/pull/19161) Remove `simulate` from `SetGasMeter` * [#19363](https://github.com/cosmos/cosmos-sdk/pull/19363) Remove `IterateAccounts` and `GetAllAccounts` methods from the AccountKeeper interface and Keeper. * [#19290](https://github.com/cosmos/cosmos-sdk/issues/19290) Pass `appmodule.Environment` to NewKeeper instead of passing individual services. -* [#19535](https://github.com/cosmos/cosmos-sdk/pull/19535) Remove vesting account creation when the chain is running. The accounts module is required for creating vesting accounts on a running chain. +* [#19535](https://github.com/cosmos/cosmos-sdk/pull/19535) Remove vesting account creation when the chain is running. The accounts module is required for creating [#vesting accounts](../accounts/defaults/lockup/README.md) on a running chain. * [#19600](https://github.com/cosmos/cosmos-sdk/pull/19600) add a consensus query method to the consensus module in order for modules to query consensus for the consensus params. - ### Consensus Breaking Changes @@ -64,4 +64,8 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [#19239](https://github.com/cosmos/cosmos-sdk/pull/19239) Sets from flag in multi-sign command to avoid no key name provided error. * [#19099](https://github.com/cosmos/cosmos-sdk/pull/19099) `verifyIsOnCurve` now checks if we are simulating to avoid malformed public key error. * [#20323](https://github.com/cosmos/cosmos-sdk/pull/20323) Ignore undecodable txs in GetBlocksWithTxs. -* [#20963](https://github.com/cosmos/cosmos-sdk/pull/20963) UseGrantedFees used to return error with raw addresses. Now it uses addresses in string format. \ No newline at end of file +* [#20963](https://github.com/cosmos/cosmos-sdk/pull/20963) UseGrantedFees used to return error with raw addresses. Now it uses addresses in string format. + +### Deprecated + +* (x/auth) [#20531](https://github.com/cosmos/cosmos-sdk/pull/20531) Deprecate auth keeper `NextAccountNumber`, use `keeper.AccountsModKeeper.NextAccountNumber` instead. diff --git a/x/auth/ante/unorderedtx/manager.go b/x/auth/ante/unorderedtx/manager.go index 00e6ae624d5c..97bf4d5cd7f1 100644 --- a/x/auth/ante/unorderedtx/manager.go +++ b/x/auth/ante/unorderedtx/manager.go @@ -32,7 +32,7 @@ type TxHash [32]byte // Manager contains the tx hash dictionary for duplicates checking, and expire // them when block production progresses. type Manager struct { - // blockCh defines a channel to receive newly committed block heights + // blockCh defines a channel to receive newly committed block time blockCh chan time.Time // doneCh allows us to ensure the purgeLoop has gracefully terminated prior to closing doneCh chan struct{} @@ -152,7 +152,7 @@ func (m *Manager) OnInit() error { return nil } -// OnNewBlock sends the latest block number to the background purge loop, which +// OnNewBlock sends the latest block time to the background purge loop, which // should be called in ABCI Commit event. func (m *Manager) OnNewBlock(blockTime time.Time) { m.blockCh <- blockTime @@ -213,7 +213,7 @@ func (m *Manager) flushToFile() error { return nil } -// expiredTxs returns expired tx hashes based on the provided block height. +// expiredTxs returns expired tx hashes based on the provided block time. func (m *Manager) expiredTxs(blockTime time.Time) []TxHash { m.mu.RLock() defer m.mu.RUnlock() diff --git a/x/auth/ante/unorderedtx/manager_test.go b/x/auth/ante/unorderedtx/manager_test.go index 40e48c72be27..9ac795b2dc32 100644 --- a/x/auth/ante/unorderedtx/manager_test.go +++ b/x/auth/ante/unorderedtx/manager_test.go @@ -103,11 +103,11 @@ func TestUnorderedTxManager_Flow(t *testing.T) { currentTime := time.Now() // Seed the manager with a txs, some of which should eventually be purged and - // the others will remain. Txs with TTL less than or equal to 50 should be purged. - for i := 1; i <= 100; i++ { + // the others will remain. First 25 Txs should be purged. + for i := 1; i <= 50; i++ { txHash := [32]byte{byte(i)} - if i <= 50 { + if i <= 25 { txm.Add(txHash, currentTime.Add(time.Millisecond*500*time.Duration(i))) } else { txm.Add(txHash, currentTime.Add(time.Hour)) @@ -123,19 +123,19 @@ func TestUnorderedTxManager_Flow(t *testing.T) { for t := range ticker.C { txm.OnNewBlock(t) - if t.After(currentTime.Add(time.Millisecond * 500 * time.Duration(50))) { + if t.After(currentTime.Add(time.Millisecond * 500 * time.Duration(25))) { doneBlockCh <- true return } } }() - // Eventually all the txs that should be expired by block 50 should be purged. + // Eventually all the txs that are expired should be purged. // The remaining txs should remain. require.Eventually( t, func() bool { - return txm.Size() == 50 + return txm.Size() == 25 }, 2*time.Minute, 5*time.Second, diff --git a/x/auth/ante/unorderedtx/snapshotter.go b/x/auth/ante/unorderedtx/snapshotter.go index 690c45445493..39142e956bb0 100644 --- a/x/auth/ante/unorderedtx/snapshotter.go +++ b/x/auth/ante/unorderedtx/snapshotter.go @@ -80,10 +80,8 @@ func (s *Snapshotter) restore(height uint64, payloadReader snapshot.ExtensionPay copy(txHash[:], payload[i:i+txHashSize]) timestamp := binary.BigEndian.Uint64(payload[i+txHashSize : i+chunkSize]) - // need to come up with a way to fetch blocktime to filter out expired txs - // - // right now we dont have access block time at this flow, so we would just include the expired txs - // and let it be purge during purge loop + + // purge any expired txs if timestamp != 0 && timestamp > height { s.m.Add(txHash, time.Unix(int64(timestamp), 0)) } diff --git a/x/auth/keeper/keeper_test.go b/x/auth/keeper/keeper_test.go index f3f0fcd13cbf..a511dfa01c8f 100644 --- a/x/auth/keeper/keeper_test.go +++ b/x/auth/keeper/keeper_test.go @@ -2,6 +2,7 @@ package keeper_test import ( "context" + "encoding/binary" "testing" "github.com/golang/mock/gomock" @@ -250,3 +251,32 @@ func (suite *KeeperTestSuite) TestInitGenesis() { // we expect nextNum to be 2 because we initialize fee_collector as account number 1 suite.Require().Equal(2, int(nextNum)) } + +func (suite *KeeperTestSuite) TestMigrateAccountNumberUnsafe() { + suite.SetupTest() // reset + + legacyAccNum := uint64(10) + val := make([]byte, 8) + binary.LittleEndian.PutUint64(val, legacyAccNum) + + // Set value for legacy account number + store := suite.accountKeeper.KVStoreService.OpenKVStore(suite.ctx) + err := store.Set(types.GlobalAccountNumberKey.Bytes(), val) + require.NoError(suite.T(), err) + + // check if value is set + val, err = store.Get(types.GlobalAccountNumberKey.Bytes()) + require.NoError(suite.T(), err) + require.NotEmpty(suite.T(), val) + + suite.acctsModKeeper.EXPECT().InitAccountNumberSeqUnsafe(gomock.Any(), gomock.Any()).AnyTimes().DoAndReturn(func(ctx context.Context, accNum uint64) (uint64, error) { + return legacyAccNum, nil + }) + + err = keeper.MigrateAccountNumberUnsafe(suite.ctx, &suite.accountKeeper) + require.NoError(suite.T(), err) + + val, err = store.Get(types.GlobalAccountNumberKey.Bytes()) + require.NoError(suite.T(), err) + require.Empty(suite.T(), val) +} diff --git a/x/auth/keeper/msg_server.go b/x/auth/keeper/msg_server.go index 50e3a65b5c39..db302b48c90a 100644 --- a/x/auth/keeper/msg_server.go +++ b/x/auth/keeper/msg_server.go @@ -23,7 +23,7 @@ func NewMsgServerImpl(ak AccountKeeper) types.MsgServer { } } -func (ms msgServer) NonAtomicExec(goCtx context.Context, msg *types.MsgNonAtomicExec) (*types.MsgNonAtomicExecResponse, error) { +func (ms msgServer) NonAtomicExec(ctx context.Context, msg *types.MsgNonAtomicExec) (*types.MsgNonAtomicExecResponse, error) { if msg.Signer == "" { return nil, errors.New("empty signer address string is not allowed") } @@ -42,7 +42,7 @@ func (ms msgServer) NonAtomicExec(goCtx context.Context, msg *types.MsgNonAtomic return nil, err } - results, err := ms.ak.NonAtomicMsgsExec(goCtx, signer, msgs) + results, err := ms.ak.NonAtomicMsgsExec(ctx, signer, msgs) if err != nil { return nil, err } diff --git a/x/auth/keeper/msg_server_test.go b/x/auth/keeper/msg_server_test.go index b1decd0b3800..43a17bc13bc0 100644 --- a/x/auth/keeper/msg_server_test.go +++ b/x/auth/keeper/msg_server_test.go @@ -1,7 +1,17 @@ package keeper_test import ( + "context" + + "github.com/cosmos/gogoproto/proto" + any "github.com/cosmos/gogoproto/types/any" + "github.com/golang/mock/gomock" + "google.golang.org/protobuf/runtime/protoiface" + "cosmossdk.io/x/auth/types" + + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/testutil/testdata" ) func (s *KeeperTestSuite) TestUpdateParams() { @@ -94,6 +104,20 @@ func (s *KeeperTestSuite) TestUpdateParams() { expectErr: true, expErrMsg: "invalid SECK256k1 signature verification cost", }, + { + name: "valid transaction", + req: &types.MsgUpdateParams{ + Authority: s.accountKeeper.GetAuthority(), + Params: types.Params{ + MaxMemoCharacters: 140, + TxSigLimit: 9, + TxSizeCostPerByte: 5, + SigVerifyCostED25519: 694, + SigVerifyCostSecp256k1: 511, + }, + }, + expectErr: false, + }, } for _, tc := range testCases { @@ -109,3 +133,73 @@ func (s *KeeperTestSuite) TestUpdateParams() { }) } } + +func (s *KeeperTestSuite) TestNonAtomicExec() { + _, _, addr := testdata.KeyTestPubAddr() + + msgUpdateParams := &types.MsgUpdateParams{} + + msgAny, err := codectypes.NewAnyWithValue(msgUpdateParams) + s.Require().NoError(err) + + testCases := []struct { + name string + req *types.MsgNonAtomicExec + expectErr bool + expErrMsg string + }{ + { + name: "error: empty signer", + req: &types.MsgNonAtomicExec{ + Signer: "", + Msgs: []*any.Any{}, + }, + expectErr: true, + expErrMsg: "empty signer address string is not allowed", + }, + { + name: "error: invalid signer", + req: &types.MsgNonAtomicExec{ + Signer: "invalid_signer", + Msgs: []*any.Any{}, + }, + expectErr: true, + expErrMsg: "invalid signer address", + }, + { + name: "error: empty messages", + req: &types.MsgNonAtomicExec{ + Signer: addr.String(), + Msgs: []*any.Any{}, + }, + expectErr: true, + expErrMsg: "messages cannot be empty", + }, + { + name: "valid transaction", + req: &types.MsgNonAtomicExec{ + Signer: addr.String(), + Msgs: []*any.Any{msgAny}, + }, + expectErr: false, + }, + } + + s.acctsModKeeper.EXPECT().SendModuleMessageUntyped(gomock.Any(), gomock.Any(), gomock.Any()). + DoAndReturn(func(_ context.Context, sender []byte, msg proto.Message) (protoiface.MessageV1, error) { + return msg, nil + }).AnyTimes() + + for _, tc := range testCases { + tc := tc + s.Run(tc.name, func() { + _, err := s.msgServer.NonAtomicExec(s.ctx, tc.req) + if tc.expectErr { + s.Require().Error(err) + s.Require().Contains(err.Error(), tc.expErrMsg) + } else { + s.Require().NoError(err) + } + }) + } +} diff --git a/x/auth/vesting/README.md b/x/auth/vesting/README.md index 7c8e6208fb38..199c4175a981 100644 --- a/x/auth/vesting/README.md +++ b/x/auth/vesting/README.md @@ -582,42 +582,3 @@ according to a custom vesting schedule. Coins in this account can still be used for delegating and for governance votes even while locked. -## CLI - -A user can query and interact with the `vesting` module using the CLI. - -### Transactions - -The `tx` commands allow users to interact with the `vesting` module. - -```bash -simd tx vesting --help -``` - -#### create-periodic-vesting-account - -The `create-periodic-vesting-account` command creates a new vesting account funded with an allocation of tokens, where a sequence of coins and period length in seconds. Periods are sequential, in that the duration of a period only starts at the end of the previous period. The duration of the first period starts upon account creation. - -```bash -simd tx vesting create-periodic-vesting-account [to_address] [periods_json_file] [flags] -``` - -Example: - -```bash -simd tx vesting create-periodic-vesting-account cosmos1.. periods.json -``` - -#### create-vesting-account - -The `create-vesting-account` command creates a new vesting account funded with an allocation of tokens. The account can either be a delayed or continuous vesting account, which is determined by the '--delayed' flag. All vesting accounts created will have their start time set by the committed block's time. The end_time must be provided as a UNIX epoch timestamp. - -```bash -simd tx vesting create-vesting-account [to_address] [amount] [end_time] [flags] -``` - -Example: - -```bash -simd tx vesting create-vesting-account cosmos1.. 100stake 2592000 -``` diff --git a/x/auth/vesting/types/codec.go b/x/auth/vesting/types/codec.go index 9ebc5a2c46a9..b76805e32aa0 100644 --- a/x/auth/vesting/types/codec.go +++ b/x/auth/vesting/types/codec.go @@ -3,13 +3,10 @@ package types import ( corelegacy "cosmossdk.io/core/legacy" "cosmossdk.io/core/registry" - coretransaction "cosmossdk.io/core/transaction" authtypes "cosmossdk.io/x/auth/types" "cosmossdk.io/x/auth/vesting/exported" - "github.com/cosmos/cosmos-sdk/codec/legacy" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/msgservice" ) // RegisterLegacyAminoCodec registers the vesting interfaces and concrete types on the @@ -21,9 +18,6 @@ func RegisterLegacyAminoCodec(cdc corelegacy.Amino) { cdc.RegisterConcrete(&DelayedVestingAccount{}, "cosmos-sdk/DelayedVestingAccount") cdc.RegisterConcrete(&PeriodicVestingAccount{}, "cosmos-sdk/PeriodicVestingAccount") cdc.RegisterConcrete(&PermanentLockedAccount{}, "cosmos-sdk/PermanentLockedAccount") - legacy.RegisterAminoMsg(cdc, &MsgCreateVestingAccount{}, "cosmos-sdk/MsgCreateVestingAccount") - legacy.RegisterAminoMsg(cdc, &MsgCreatePermanentLockedAccount{}, "cosmos-sdk/MsgCreatePermLockedAccount") - legacy.RegisterAminoMsg(cdc, &MsgCreatePeriodicVestingAccount{}, "cosmos-sdk/MsgCreatePeriodVestAccount") } // RegisterInterfaces associates protoName with AccountI and VestingAccount @@ -55,12 +49,4 @@ func RegisterInterfaces(registrar registry.InterfaceRegistrar) { &PeriodicVestingAccount{}, &PermanentLockedAccount{}, ) - - registrar.RegisterImplementations( - (*coretransaction.Msg)(nil), - &MsgCreateVestingAccount{}, - &MsgCreatePermanentLockedAccount{}, - ) - - msgservice.RegisterMsgServiceDesc(registrar, &_Msg_serviceDesc) } diff --git a/x/auth/vesting/types/msgs.go b/x/auth/vesting/types/msgs.go deleted file mode 100644 index a718bd04e996..000000000000 --- a/x/auth/vesting/types/msgs.go +++ /dev/null @@ -1,43 +0,0 @@ -package types - -import ( - coretransaction "cosmossdk.io/core/transaction" - - sdk "github.com/cosmos/cosmos-sdk/types" -) - -var ( - _ coretransaction.Msg = &MsgCreateVestingAccount{} - _ coretransaction.Msg = &MsgCreatePermanentLockedAccount{} - _ coretransaction.Msg = &MsgCreatePeriodicVestingAccount{} -) - -// NewMsgCreateVestingAccount returns a reference to a new MsgCreateVestingAccount. -func NewMsgCreateVestingAccount(fromAddr, toAddr sdk.AccAddress, amount sdk.Coins, endTime int64, delayed bool) *MsgCreateVestingAccount { - return &MsgCreateVestingAccount{ - FromAddress: fromAddr.String(), - ToAddress: toAddr.String(), - Amount: amount, - EndTime: endTime, - Delayed: delayed, - } -} - -// NewMsgCreatePermanentLockedAccount returns a reference to a new MsgCreatePermanentLockedAccount. -func NewMsgCreatePermanentLockedAccount(fromAddr, toAddr sdk.AccAddress, amount sdk.Coins) *MsgCreatePermanentLockedAccount { - return &MsgCreatePermanentLockedAccount{ - FromAddress: fromAddr.String(), - ToAddress: toAddr.String(), - Amount: amount, - } -} - -// NewMsgCreatePeriodicVestingAccount returns a reference to a new MsgCreatePeriodicVestingAccount. -func NewMsgCreatePeriodicVestingAccount(fromAddr, toAddr sdk.AccAddress, startTime int64, periods []Period) *MsgCreatePeriodicVestingAccount { - return &MsgCreatePeriodicVestingAccount{ - FromAddress: fromAddr.String(), - ToAddress: toAddr.String(), - StartTime: startTime, - VestingPeriods: periods, - } -} diff --git a/x/auth/vesting/types/tx.pb.go b/x/auth/vesting/types/tx.pb.go deleted file mode 100644 index ec54c961ec33..000000000000 --- a/x/auth/vesting/types/tx.pb.go +++ /dev/null @@ -1,1819 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/vesting/v1beta1/tx.proto - -package types - -import ( - context "context" - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/cosmos-sdk/types/msgservice" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/proto" - 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 - -// MsgCreateVestingAccount defines a message that enables creating a vesting -// account. -type MsgCreateVestingAccount struct { - FromAddress string `protobuf:"bytes,1,opt,name=from_address,json=fromAddress,proto3" json:"from_address,omitempty"` - ToAddress string `protobuf:"bytes,2,opt,name=to_address,json=toAddress,proto3" json:"to_address,omitempty"` - Amount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"` - // end of vesting as unix time (in seconds). - EndTime int64 `protobuf:"varint,4,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` - Delayed bool `protobuf:"varint,5,opt,name=delayed,proto3" json:"delayed,omitempty"` - // start of vesting as unix time (in seconds). - // - // Since 0.51.x - StartTime int64 `protobuf:"varint,6,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` -} - -func (m *MsgCreateVestingAccount) Reset() { *m = MsgCreateVestingAccount{} } -func (m *MsgCreateVestingAccount) String() string { return proto.CompactTextString(m) } -func (*MsgCreateVestingAccount) ProtoMessage() {} -func (*MsgCreateVestingAccount) Descriptor() ([]byte, []int) { - return fileDescriptor_5338ca97811f9792, []int{0} -} -func (m *MsgCreateVestingAccount) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgCreateVestingAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgCreateVestingAccount.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 *MsgCreateVestingAccount) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgCreateVestingAccount.Merge(m, src) -} -func (m *MsgCreateVestingAccount) XXX_Size() int { - return m.Size() -} -func (m *MsgCreateVestingAccount) XXX_DiscardUnknown() { - xxx_messageInfo_MsgCreateVestingAccount.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgCreateVestingAccount proto.InternalMessageInfo - -func (m *MsgCreateVestingAccount) GetFromAddress() string { - if m != nil { - return m.FromAddress - } - return "" -} - -func (m *MsgCreateVestingAccount) GetToAddress() string { - if m != nil { - return m.ToAddress - } - return "" -} - -func (m *MsgCreateVestingAccount) GetAmount() github_com_cosmos_cosmos_sdk_types.Coins { - if m != nil { - return m.Amount - } - return nil -} - -func (m *MsgCreateVestingAccount) GetEndTime() int64 { - if m != nil { - return m.EndTime - } - return 0 -} - -func (m *MsgCreateVestingAccount) GetDelayed() bool { - if m != nil { - return m.Delayed - } - return false -} - -func (m *MsgCreateVestingAccount) GetStartTime() int64 { - if m != nil { - return m.StartTime - } - return 0 -} - -// MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount response type. -type MsgCreateVestingAccountResponse struct { -} - -func (m *MsgCreateVestingAccountResponse) Reset() { *m = MsgCreateVestingAccountResponse{} } -func (m *MsgCreateVestingAccountResponse) String() string { return proto.CompactTextString(m) } -func (*MsgCreateVestingAccountResponse) ProtoMessage() {} -func (*MsgCreateVestingAccountResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5338ca97811f9792, []int{1} -} -func (m *MsgCreateVestingAccountResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgCreateVestingAccountResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgCreateVestingAccountResponse.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 *MsgCreateVestingAccountResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgCreateVestingAccountResponse.Merge(m, src) -} -func (m *MsgCreateVestingAccountResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgCreateVestingAccountResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgCreateVestingAccountResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgCreateVestingAccountResponse proto.InternalMessageInfo - -// MsgCreatePermanentLockedAccount defines a message that enables creating a permanent -// locked account. -// -// Since: cosmos-sdk 0.46 -type MsgCreatePermanentLockedAccount struct { - FromAddress string `protobuf:"bytes,1,opt,name=from_address,json=fromAddress,proto3" json:"from_address,omitempty" yaml:"from_address"` - ToAddress string `protobuf:"bytes,2,opt,name=to_address,json=toAddress,proto3" json:"to_address,omitempty" yaml:"to_address"` - Amount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"` -} - -func (m *MsgCreatePermanentLockedAccount) Reset() { *m = MsgCreatePermanentLockedAccount{} } -func (m *MsgCreatePermanentLockedAccount) String() string { return proto.CompactTextString(m) } -func (*MsgCreatePermanentLockedAccount) ProtoMessage() {} -func (*MsgCreatePermanentLockedAccount) Descriptor() ([]byte, []int) { - return fileDescriptor_5338ca97811f9792, []int{2} -} -func (m *MsgCreatePermanentLockedAccount) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgCreatePermanentLockedAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgCreatePermanentLockedAccount.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 *MsgCreatePermanentLockedAccount) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgCreatePermanentLockedAccount.Merge(m, src) -} -func (m *MsgCreatePermanentLockedAccount) XXX_Size() int { - return m.Size() -} -func (m *MsgCreatePermanentLockedAccount) XXX_DiscardUnknown() { - xxx_messageInfo_MsgCreatePermanentLockedAccount.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgCreatePermanentLockedAccount proto.InternalMessageInfo - -func (m *MsgCreatePermanentLockedAccount) GetFromAddress() string { - if m != nil { - return m.FromAddress - } - return "" -} - -func (m *MsgCreatePermanentLockedAccount) GetToAddress() string { - if m != nil { - return m.ToAddress - } - return "" -} - -func (m *MsgCreatePermanentLockedAccount) GetAmount() github_com_cosmos_cosmos_sdk_types.Coins { - if m != nil { - return m.Amount - } - return nil -} - -// MsgCreatePermanentLockedAccountResponse defines the Msg/CreatePermanentLockedAccount response type. -// -// Since: cosmos-sdk 0.46 -type MsgCreatePermanentLockedAccountResponse struct { -} - -func (m *MsgCreatePermanentLockedAccountResponse) Reset() { - *m = MsgCreatePermanentLockedAccountResponse{} -} -func (m *MsgCreatePermanentLockedAccountResponse) String() string { return proto.CompactTextString(m) } -func (*MsgCreatePermanentLockedAccountResponse) ProtoMessage() {} -func (*MsgCreatePermanentLockedAccountResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5338ca97811f9792, []int{3} -} -func (m *MsgCreatePermanentLockedAccountResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgCreatePermanentLockedAccountResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgCreatePermanentLockedAccountResponse.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 *MsgCreatePermanentLockedAccountResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgCreatePermanentLockedAccountResponse.Merge(m, src) -} -func (m *MsgCreatePermanentLockedAccountResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgCreatePermanentLockedAccountResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgCreatePermanentLockedAccountResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgCreatePermanentLockedAccountResponse proto.InternalMessageInfo - -// MsgCreateVestingAccount defines a message that enables creating a vesting -// account. -// -// Since: cosmos-sdk 0.46 -type MsgCreatePeriodicVestingAccount struct { - FromAddress string `protobuf:"bytes,1,opt,name=from_address,json=fromAddress,proto3" json:"from_address,omitempty"` - ToAddress string `protobuf:"bytes,2,opt,name=to_address,json=toAddress,proto3" json:"to_address,omitempty"` - // start of vesting as unix time (in seconds). - StartTime int64 `protobuf:"varint,3,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` - VestingPeriods []Period `protobuf:"bytes,4,rep,name=vesting_periods,json=vestingPeriods,proto3" json:"vesting_periods"` -} - -func (m *MsgCreatePeriodicVestingAccount) Reset() { *m = MsgCreatePeriodicVestingAccount{} } -func (m *MsgCreatePeriodicVestingAccount) String() string { return proto.CompactTextString(m) } -func (*MsgCreatePeriodicVestingAccount) ProtoMessage() {} -func (*MsgCreatePeriodicVestingAccount) Descriptor() ([]byte, []int) { - return fileDescriptor_5338ca97811f9792, []int{4} -} -func (m *MsgCreatePeriodicVestingAccount) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgCreatePeriodicVestingAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgCreatePeriodicVestingAccount.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 *MsgCreatePeriodicVestingAccount) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgCreatePeriodicVestingAccount.Merge(m, src) -} -func (m *MsgCreatePeriodicVestingAccount) XXX_Size() int { - return m.Size() -} -func (m *MsgCreatePeriodicVestingAccount) XXX_DiscardUnknown() { - xxx_messageInfo_MsgCreatePeriodicVestingAccount.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgCreatePeriodicVestingAccount proto.InternalMessageInfo - -func (m *MsgCreatePeriodicVestingAccount) GetFromAddress() string { - if m != nil { - return m.FromAddress - } - return "" -} - -func (m *MsgCreatePeriodicVestingAccount) GetToAddress() string { - if m != nil { - return m.ToAddress - } - return "" -} - -func (m *MsgCreatePeriodicVestingAccount) GetStartTime() int64 { - if m != nil { - return m.StartTime - } - return 0 -} - -func (m *MsgCreatePeriodicVestingAccount) GetVestingPeriods() []Period { - if m != nil { - return m.VestingPeriods - } - return nil -} - -// MsgCreateVestingAccountResponse defines the Msg/CreatePeriodicVestingAccount -// response type. -// -// Since: cosmos-sdk 0.46 -type MsgCreatePeriodicVestingAccountResponse struct { -} - -func (m *MsgCreatePeriodicVestingAccountResponse) Reset() { - *m = MsgCreatePeriodicVestingAccountResponse{} -} -func (m *MsgCreatePeriodicVestingAccountResponse) String() string { return proto.CompactTextString(m) } -func (*MsgCreatePeriodicVestingAccountResponse) ProtoMessage() {} -func (*MsgCreatePeriodicVestingAccountResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5338ca97811f9792, []int{5} -} -func (m *MsgCreatePeriodicVestingAccountResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgCreatePeriodicVestingAccountResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgCreatePeriodicVestingAccountResponse.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 *MsgCreatePeriodicVestingAccountResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgCreatePeriodicVestingAccountResponse.Merge(m, src) -} -func (m *MsgCreatePeriodicVestingAccountResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgCreatePeriodicVestingAccountResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgCreatePeriodicVestingAccountResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgCreatePeriodicVestingAccountResponse proto.InternalMessageInfo - -func init() { - proto.RegisterType((*MsgCreateVestingAccount)(nil), "cosmos.vesting.v1beta1.MsgCreateVestingAccount") - proto.RegisterType((*MsgCreateVestingAccountResponse)(nil), "cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse") - proto.RegisterType((*MsgCreatePermanentLockedAccount)(nil), "cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount") - proto.RegisterType((*MsgCreatePermanentLockedAccountResponse)(nil), "cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccountResponse") - proto.RegisterType((*MsgCreatePeriodicVestingAccount)(nil), "cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount") - proto.RegisterType((*MsgCreatePeriodicVestingAccountResponse)(nil), "cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccountResponse") -} - -func init() { proto.RegisterFile("cosmos/vesting/v1beta1/tx.proto", fileDescriptor_5338ca97811f9792) } - -var fileDescriptor_5338ca97811f9792 = []byte{ - // 680 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x95, 0xcf, 0x4f, 0xd4, 0x40, - 0x14, 0xc7, 0xb7, 0x94, 0x5f, 0x3b, 0x10, 0x0d, 0x15, 0xa5, 0x6c, 0xa4, 0x5d, 0x1a, 0x8d, 0x2b, - 0x09, 0x6d, 0x40, 0x13, 0x92, 0xc5, 0x84, 0xb0, 0x24, 0x9e, 0x24, 0x31, 0xd5, 0x78, 0xf0, 0xb2, - 0x99, 0x6d, 0xc7, 0x32, 0x81, 0x76, 0x36, 0x9d, 0x81, 0xb0, 0x37, 0xe2, 0xd1, 0x93, 0x37, 0x8d, - 0xf1, 0xe0, 0xd1, 0x78, 0xe2, 0xe0, 0xbf, 0x60, 0xc2, 0x4d, 0xe2, 0xc9, 0x13, 0x1a, 0x38, 0xe0, - 0x99, 0xbf, 0xc0, 0x4c, 0x67, 0xba, 0xee, 0xae, 0x2d, 0x0b, 0x9e, 0xbc, 0x50, 0x76, 0xde, 0xf7, - 0xfb, 0xde, 0xeb, 0xe7, 0xcd, 0x4c, 0x81, 0xe9, 0x11, 0x1a, 0x12, 0xea, 0xec, 0x20, 0xca, 0x70, - 0x14, 0x38, 0x3b, 0x0b, 0x0d, 0xc4, 0xe0, 0x82, 0xc3, 0x76, 0xed, 0x66, 0x4c, 0x18, 0xd1, 0x6e, - 0x08, 0x81, 0x2d, 0x05, 0xb6, 0x14, 0x94, 0x26, 0x03, 0x12, 0x90, 0x44, 0xe2, 0xf0, 0xff, 0x84, - 0xba, 0x64, 0xc8, 0x74, 0x0d, 0x48, 0x51, 0x3b, 0x97, 0x47, 0x70, 0x24, 0xe3, 0xd3, 0x22, 0x5e, - 0x17, 0x46, 0x99, 0x5a, 0x84, 0x6e, 0xe5, 0x74, 0x92, 0x16, 0x16, 0xaa, 0x29, 0xa9, 0x0a, 0x29, - 0x57, 0xf0, 0x87, 0x0c, 0x4c, 0xc0, 0x10, 0x47, 0xc4, 0x49, 0xfe, 0x8a, 0x25, 0xeb, 0xbd, 0x0a, - 0xa6, 0xd6, 0x69, 0xb0, 0x16, 0x23, 0xc8, 0xd0, 0x33, 0x91, 0x66, 0xd5, 0xf3, 0xc8, 0x76, 0xc4, - 0xb4, 0x65, 0x30, 0xfe, 0x22, 0x26, 0x61, 0x1d, 0xfa, 0x7e, 0x8c, 0x28, 0xd5, 0x95, 0xb2, 0x52, - 0x29, 0xd6, 0xf4, 0x6f, 0x9f, 0xe7, 0x27, 0x65, 0x57, 0xab, 0x22, 0xf2, 0x84, 0xc5, 0x38, 0x0a, - 0xdc, 0x31, 0xae, 0x96, 0x4b, 0xda, 0x12, 0x00, 0x8c, 0xb4, 0xad, 0x03, 0x7d, 0xac, 0x45, 0x46, - 0x52, 0x63, 0x0b, 0x0c, 0xc3, 0x90, 0xd7, 0xd7, 0xd5, 0xb2, 0x5a, 0x19, 0x5b, 0x9c, 0xb6, 0xa5, - 0x83, 0xf3, 0x4a, 0xd1, 0xda, 0x6b, 0x04, 0x47, 0xb5, 0x87, 0x07, 0x47, 0x66, 0xe1, 0xd3, 0x0f, - 0xb3, 0x12, 0x60, 0xb6, 0xb1, 0xdd, 0xb0, 0x3d, 0x12, 0x4a, 0x5e, 0xf2, 0x31, 0x4f, 0xfd, 0x4d, - 0x87, 0xb5, 0x9a, 0x88, 0x26, 0x06, 0xfa, 0xee, 0x74, 0x7f, 0x6e, 0x7c, 0x0b, 0x05, 0xd0, 0x6b, - 0xd5, 0x39, 0x71, 0xfa, 0xf1, 0x74, 0x7f, 0x4e, 0x71, 0x65, 0x41, 0x6d, 0x1a, 0x8c, 0xa2, 0xc8, - 0xaf, 0x33, 0x1c, 0x22, 0x7d, 0xb0, 0xac, 0x54, 0x54, 0x77, 0x04, 0x45, 0xfe, 0x53, 0x1c, 0x22, - 0x4d, 0x07, 0x23, 0x3e, 0xda, 0x82, 0x2d, 0xe4, 0xeb, 0x43, 0x65, 0xa5, 0x32, 0xea, 0xa6, 0x3f, - 0xb5, 0x19, 0x00, 0x28, 0x83, 0x31, 0x13, 0xb6, 0xe1, 0xc4, 0x56, 0x4c, 0x56, 0xb8, 0xb1, 0xfa, - 0xe0, 0xd7, 0x07, 0x53, 0x79, 0xc9, 0xeb, 0x76, 0xb2, 0x7c, 0x75, 0xba, 0x3f, 0x67, 0x75, 0xf4, - 0x98, 0x33, 0x02, 0x6b, 0x16, 0x98, 0x39, 0x21, 0x17, 0xd1, 0x26, 0x89, 0x28, 0xb2, 0xbe, 0x0e, - 0x74, 0x68, 0x1e, 0xa3, 0x38, 0x84, 0x11, 0x8a, 0xd8, 0x23, 0xe2, 0x6d, 0x22, 0x3f, 0x9d, 0x64, - 0x35, 0x73, 0x92, 0x53, 0x67, 0x47, 0xe6, 0xb5, 0x16, 0x0c, 0xb7, 0xaa, 0x56, 0x67, 0xd4, 0xea, - 0x1e, 0xe4, 0xfd, 0x8c, 0x41, 0x5e, 0x3f, 0x3b, 0x32, 0x27, 0x84, 0xf3, 0x4f, 0xcc, 0xfa, 0x3f, - 0xa6, 0x58, 0x5d, 0xc9, 0x25, 0x7e, 0x3b, 0x8b, 0x38, 0x47, 0xd6, 0x45, 0xcb, 0xba, 0x0b, 0xee, - 0xf4, 0x01, 0xda, 0x86, 0xff, 0xa6, 0x07, 0x3e, 0x26, 0x3e, 0xf6, 0x7a, 0x8e, 0xd1, 0x6c, 0x16, - 0xfc, 0x6e, 0xc6, 0x33, 0x7f, 0x33, 0xee, 0x84, 0xd9, 0xbd, 0xc5, 0xd4, 0x9e, 0x2d, 0xa6, 0xb9, - 0xe0, 0xaa, 0xbc, 0x00, 0xea, 0xcd, 0xa4, 0x05, 0xaa, 0x0f, 0x26, 0xd0, 0x0d, 0x3b, 0xfb, 0x62, - 0xb2, 0x45, 0xa7, 0xb5, 0x22, 0x27, 0x2f, 0xe0, 0x5d, 0x91, 0x12, 0x11, 0xa1, 0x09, 0xc4, 0xc2, - 0xa5, 0x20, 0x62, 0xe2, 0xf3, 0x17, 0xcf, 0x81, 0x98, 0x01, 0x26, 0x85, 0xb8, 0xf8, 0x45, 0x05, - 0xea, 0x3a, 0x0d, 0xb4, 0x3d, 0x05, 0x4c, 0x66, 0x5e, 0x44, 0x4e, 0xde, 0x7b, 0xe4, 0x9c, 0x8d, - 0xd2, 0xd2, 0x25, 0x0d, 0x69, 0x2b, 0xda, 0x5b, 0x05, 0xdc, 0x3c, 0xf7, 0x24, 0xf5, 0xcf, 0x9c, - 0x6d, 0x2c, 0xad, 0xfc, 0xa3, 0x31, 0xbb, 0xb5, 0xac, 0x7d, 0x76, 0xa1, 0xd6, 0x32, 0x8c, 0x17, - 0x6b, 0xed, 0x9c, 0x01, 0x96, 0x86, 0xf6, 0xf8, 0x1e, 0xaa, 0x2d, 0x1f, 0x1c, 0x1b, 0xca, 0xe1, - 0xb1, 0xa1, 0xfc, 0x3c, 0x36, 0x94, 0xd7, 0x27, 0x46, 0xe1, 0xf0, 0xc4, 0x28, 0x7c, 0x3f, 0x31, - 0x0a, 0xcf, 0x67, 0x45, 0x01, 0xea, 0x6f, 0xda, 0x98, 0x38, 0xbb, 0x0e, 0xdc, 0x66, 0x1b, 0xed, - 0x8f, 0x58, 0x72, 0xb2, 0x1b, 0xc3, 0xc9, 0xf7, 0xe8, 0xde, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, - 0x59, 0xc3, 0x58, 0xdb, 0x6d, 0x07, 0x00, 0x00, -} - -func (this *MsgCreateVestingAccount) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*MsgCreateVestingAccount) - if !ok { - that2, ok := that.(MsgCreateVestingAccount) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.FromAddress != that1.FromAddress { - return false - } - if this.ToAddress != that1.ToAddress { - return false - } - if len(this.Amount) != len(that1.Amount) { - return false - } - for i := range this.Amount { - if !this.Amount[i].Equal(&that1.Amount[i]) { - return false - } - } - if this.EndTime != that1.EndTime { - return false - } - if this.Delayed != that1.Delayed { - return false - } - if this.StartTime != that1.StartTime { - return false - } - return true -} -func (this *MsgCreatePermanentLockedAccount) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*MsgCreatePermanentLockedAccount) - if !ok { - that2, ok := that.(MsgCreatePermanentLockedAccount) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.FromAddress != that1.FromAddress { - return false - } - if this.ToAddress != that1.ToAddress { - return false - } - if len(this.Amount) != len(that1.Amount) { - return false - } - for i := range this.Amount { - if !this.Amount[i].Equal(&that1.Amount[i]) { - return false - } - } - return true -} - -// 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 { - // CreateVestingAccount defines a method that enables creating a vesting - // account. - CreateVestingAccount(ctx context.Context, in *MsgCreateVestingAccount, opts ...grpc.CallOption) (*MsgCreateVestingAccountResponse, error) - // CreatePermanentLockedAccount defines a method that enables creating a permanent - // locked account. - // - // Since: cosmos-sdk 0.46 - CreatePermanentLockedAccount(ctx context.Context, in *MsgCreatePermanentLockedAccount, opts ...grpc.CallOption) (*MsgCreatePermanentLockedAccountResponse, error) - // CreatePeriodicVestingAccount defines a method that enables creating a - // periodic vesting account. - // - // Since: cosmos-sdk 0.46 - CreatePeriodicVestingAccount(ctx context.Context, in *MsgCreatePeriodicVestingAccount, opts ...grpc.CallOption) (*MsgCreatePeriodicVestingAccountResponse, error) -} - -type msgClient struct { - cc grpc1.ClientConn -} - -func NewMsgClient(cc grpc1.ClientConn) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) CreateVestingAccount(ctx context.Context, in *MsgCreateVestingAccount, opts ...grpc.CallOption) (*MsgCreateVestingAccountResponse, error) { - out := new(MsgCreateVestingAccountResponse) - err := c.cc.Invoke(ctx, "/cosmos.vesting.v1beta1.Msg/CreateVestingAccount", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) CreatePermanentLockedAccount(ctx context.Context, in *MsgCreatePermanentLockedAccount, opts ...grpc.CallOption) (*MsgCreatePermanentLockedAccountResponse, error) { - out := new(MsgCreatePermanentLockedAccountResponse) - err := c.cc.Invoke(ctx, "/cosmos.vesting.v1beta1.Msg/CreatePermanentLockedAccount", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) CreatePeriodicVestingAccount(ctx context.Context, in *MsgCreatePeriodicVestingAccount, opts ...grpc.CallOption) (*MsgCreatePeriodicVestingAccountResponse, error) { - out := new(MsgCreatePeriodicVestingAccountResponse) - err := c.cc.Invoke(ctx, "/cosmos.vesting.v1beta1.Msg/CreatePeriodicVestingAccount", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MsgServer is the server API for Msg service. -type MsgServer interface { - // CreateVestingAccount defines a method that enables creating a vesting - // account. - CreateVestingAccount(context.Context, *MsgCreateVestingAccount) (*MsgCreateVestingAccountResponse, error) - // CreatePermanentLockedAccount defines a method that enables creating a permanent - // locked account. - // - // Since: cosmos-sdk 0.46 - CreatePermanentLockedAccount(context.Context, *MsgCreatePermanentLockedAccount) (*MsgCreatePermanentLockedAccountResponse, error) - // CreatePeriodicVestingAccount defines a method that enables creating a - // periodic vesting account. - // - // Since: cosmos-sdk 0.46 - CreatePeriodicVestingAccount(context.Context, *MsgCreatePeriodicVestingAccount) (*MsgCreatePeriodicVestingAccountResponse, error) -} - -// UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (*UnimplementedMsgServer) CreateVestingAccount(ctx context.Context, req *MsgCreateVestingAccount) (*MsgCreateVestingAccountResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateVestingAccount not implemented") -} -func (*UnimplementedMsgServer) CreatePermanentLockedAccount(ctx context.Context, req *MsgCreatePermanentLockedAccount) (*MsgCreatePermanentLockedAccountResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreatePermanentLockedAccount not implemented") -} -func (*UnimplementedMsgServer) CreatePeriodicVestingAccount(ctx context.Context, req *MsgCreatePeriodicVestingAccount) (*MsgCreatePeriodicVestingAccountResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreatePeriodicVestingAccount not implemented") -} - -func RegisterMsgServer(s grpc1.Server, srv MsgServer) { - s.RegisterService(&_Msg_serviceDesc, srv) -} - -func _Msg_CreateVestingAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgCreateVestingAccount) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).CreateVestingAccount(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.vesting.v1beta1.Msg/CreateVestingAccount", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).CreateVestingAccount(ctx, req.(*MsgCreateVestingAccount)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_CreatePermanentLockedAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgCreatePermanentLockedAccount) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).CreatePermanentLockedAccount(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.vesting.v1beta1.Msg/CreatePermanentLockedAccount", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).CreatePermanentLockedAccount(ctx, req.(*MsgCreatePermanentLockedAccount)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_CreatePeriodicVestingAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgCreatePeriodicVestingAccount) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).CreatePeriodicVestingAccount(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.vesting.v1beta1.Msg/CreatePeriodicVestingAccount", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).CreatePeriodicVestingAccount(ctx, req.(*MsgCreatePeriodicVestingAccount)) - } - return interceptor(ctx, in, info, handler) -} - -var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "cosmos.vesting.v1beta1.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "CreateVestingAccount", - Handler: _Msg_CreateVestingAccount_Handler, - }, - { - MethodName: "CreatePermanentLockedAccount", - Handler: _Msg_CreatePermanentLockedAccount_Handler, - }, - { - MethodName: "CreatePeriodicVestingAccount", - Handler: _Msg_CreatePeriodicVestingAccount_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "cosmos/vesting/v1beta1/tx.proto", -} - -func (m *MsgCreateVestingAccount) 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 *MsgCreateVestingAccount) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgCreateVestingAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.StartTime != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.StartTime)) - i-- - dAtA[i] = 0x30 - } - if m.Delayed { - i-- - if m.Delayed { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x28 - } - if m.EndTime != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.EndTime)) - i-- - dAtA[i] = 0x20 - } - if len(m.Amount) > 0 { - for iNdEx := len(m.Amount) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Amount[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.ToAddress) > 0 { - i -= len(m.ToAddress) - copy(dAtA[i:], m.ToAddress) - i = encodeVarintTx(dAtA, i, uint64(len(m.ToAddress))) - i-- - dAtA[i] = 0x12 - } - if len(m.FromAddress) > 0 { - i -= len(m.FromAddress) - copy(dAtA[i:], m.FromAddress) - i = encodeVarintTx(dAtA, i, uint64(len(m.FromAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgCreateVestingAccountResponse) 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 *MsgCreateVestingAccountResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgCreateVestingAccountResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgCreatePermanentLockedAccount) 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 *MsgCreatePermanentLockedAccount) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgCreatePermanentLockedAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Amount) > 0 { - for iNdEx := len(m.Amount) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Amount[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.ToAddress) > 0 { - i -= len(m.ToAddress) - copy(dAtA[i:], m.ToAddress) - i = encodeVarintTx(dAtA, i, uint64(len(m.ToAddress))) - i-- - dAtA[i] = 0x12 - } - if len(m.FromAddress) > 0 { - i -= len(m.FromAddress) - copy(dAtA[i:], m.FromAddress) - i = encodeVarintTx(dAtA, i, uint64(len(m.FromAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgCreatePermanentLockedAccountResponse) 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 *MsgCreatePermanentLockedAccountResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgCreatePermanentLockedAccountResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgCreatePeriodicVestingAccount) 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 *MsgCreatePeriodicVestingAccount) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgCreatePeriodicVestingAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.VestingPeriods) > 0 { - for iNdEx := len(m.VestingPeriods) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.VestingPeriods[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if m.StartTime != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.StartTime)) - i-- - dAtA[i] = 0x18 - } - if len(m.ToAddress) > 0 { - i -= len(m.ToAddress) - copy(dAtA[i:], m.ToAddress) - i = encodeVarintTx(dAtA, i, uint64(len(m.ToAddress))) - i-- - dAtA[i] = 0x12 - } - if len(m.FromAddress) > 0 { - i -= len(m.FromAddress) - copy(dAtA[i:], m.FromAddress) - i = encodeVarintTx(dAtA, i, uint64(len(m.FromAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgCreatePeriodicVestingAccountResponse) 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 *MsgCreatePeriodicVestingAccountResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgCreatePeriodicVestingAccountResponse) 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 *MsgCreateVestingAccount) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.FromAddress) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.ToAddress) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if len(m.Amount) > 0 { - for _, e := range m.Amount { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } - } - if m.EndTime != 0 { - n += 1 + sovTx(uint64(m.EndTime)) - } - if m.Delayed { - n += 2 - } - if m.StartTime != 0 { - n += 1 + sovTx(uint64(m.StartTime)) - } - return n -} - -func (m *MsgCreateVestingAccountResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgCreatePermanentLockedAccount) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.FromAddress) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.ToAddress) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if len(m.Amount) > 0 { - for _, e := range m.Amount { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } - } - return n -} - -func (m *MsgCreatePermanentLockedAccountResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgCreatePeriodicVestingAccount) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.FromAddress) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.ToAddress) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.StartTime != 0 { - n += 1 + sovTx(uint64(m.StartTime)) - } - if len(m.VestingPeriods) > 0 { - for _, e := range m.VestingPeriods { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } - } - return n -} - -func (m *MsgCreatePeriodicVestingAccountResponse) 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 *MsgCreateVestingAccount) 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: MsgCreateVestingAccount: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCreateVestingAccount: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FromAddress", 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.FromAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ToAddress", 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.ToAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Amount", 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 - } - m.Amount = append(m.Amount, types.Coin{}) - if err := m.Amount[len(m.Amount)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EndTime", wireType) - } - m.EndTime = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.EndTime |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Delayed", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Delayed = bool(v != 0) - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StartTime", wireType) - } - m.StartTime = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.StartTime |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgCreateVestingAccountResponse) 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: MsgCreateVestingAccountResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCreateVestingAccountResponse: 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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgCreatePermanentLockedAccount) 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: MsgCreatePermanentLockedAccount: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCreatePermanentLockedAccount: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FromAddress", 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.FromAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ToAddress", 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.ToAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Amount", 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 - } - m.Amount = append(m.Amount, types.Coin{}) - if err := m.Amount[len(m.Amount)-1].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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgCreatePermanentLockedAccountResponse) 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: MsgCreatePermanentLockedAccountResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCreatePermanentLockedAccountResponse: 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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgCreatePeriodicVestingAccount) 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: MsgCreatePeriodicVestingAccount: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCreatePeriodicVestingAccount: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FromAddress", 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.FromAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ToAddress", 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.ToAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StartTime", wireType) - } - m.StartTime = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.StartTime |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VestingPeriods", 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 - } - m.VestingPeriods = append(m.VestingPeriods, Period{}) - if err := m.VestingPeriods[len(m.VestingPeriods)-1].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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgCreatePeriodicVestingAccountResponse) 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: MsgCreatePeriodicVestingAccountResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCreatePeriodicVestingAccountResponse: 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) || (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") -)